summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBilal Alsharifi <bilal.alsharifi@gmail.com>2020-02-20 14:34:59 -0500
committerBilal Alsharifi <bilal.alsharifi@gmail.com>2020-02-20 14:34:59 -0500
commit49d20093f838fcc119e1210668281baf33e0d621 (patch)
treed07d846ed2c6d3cbeb4aadbca3a916ce71197a3c
parentadfd59364bbeaea67c1e6990e4e13549cc33b7d9 (diff)
downloadsdl_android-49d20093f838fcc119e1210668281baf33e0d621.tar.gz
Prevent sending GetSystemCapability for DISPLAYS
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/SystemCapabilityManager.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/base/src/main/java/com/smartdevicelink/proxy/SystemCapabilityManager.java b/base/src/main/java/com/smartdevicelink/proxy/SystemCapabilityManager.java
index 0f6f12963..63ad1e9f5 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/SystemCapabilityManager.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/SystemCapabilityManager.java
@@ -312,6 +312,7 @@ public class SystemCapabilityManager {
// this notification can return only affected windows (hence not all windows)
List<DisplayCapability> newCapabilities = (List<DisplayCapability>) capability;
updateCachedDisplayCapabilityList(newCapabilities);
+ systemCapabilitiesSubscriptionStatus.put(SystemCapabilityType.DISPLAYS, true);
}
}
if (capability != null) {
@@ -527,7 +528,7 @@ public class SystemCapabilityManager {
&& onSystemCapabilityListeners.get(systemCapabilityType) != null) {
success = onSystemCapabilityListeners.get(systemCapabilityType).remove(listener);
// If the last listener for the supplied capability type is removed, unsubscribe from the capability type
- if (success && onSystemCapabilityListeners.get(systemCapabilityType).isEmpty() && isSubscribedToSystemCapability(systemCapabilityType)) {
+ if (success && onSystemCapabilityListeners.get(systemCapabilityType).isEmpty() && isSubscribedToSystemCapability(systemCapabilityType) && systemCapabilityType != SystemCapabilityType.DISPLAYS) {
retrieveCapability(systemCapabilityType, null, false);
}
}
@@ -540,7 +541,7 @@ public class SystemCapabilityManager {
* @param subscribe flag to subscribe to updates of the supplied capability type. True means subscribe; false means cancel subscription; null means don't change current subscription status.
*/
private void retrieveCapability(final SystemCapabilityType systemCapabilityType, final OnSystemCapabilityListener scListener, final Boolean subscribe) {
- if (!systemCapabilityType.isQueryable()) {
+ if (!systemCapabilityType.isQueryable() || systemCapabilityType == SystemCapabilityType.DISPLAYS) {
String message = "This systemCapabilityType cannot be queried for";
DebugTool.logError(message);
if (scListener != null) {