summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Fischer <joeljfischer@gmail.com>2018-10-17 10:56:04 -0400
committerJoel Fischer <joeljfischer@gmail.com>2018-10-17 10:56:04 -0400
commit51ba2678dee01526b43c9727007dcbb64d096d9c (patch)
tree8ce35c3525fb5fa041db6b7521f1f7567cd0e254
parentc47dd1c44fac56f9af9aa85535280f5a0e5f76da (diff)
downloadsdl_ios-51ba2678dee01526b43c9727007dcbb64d096d9c.tar.gz
If screen managers get a failed register / setdisplaylayout response, don’t take the `nil` displayCapabilitiesbugfix/issue_1108_setdisplaylayout_screenmanager_fail
-rw-r--r--SmartDeviceLink/SDLChoiceSetManager.m6
-rw-r--r--SmartDeviceLink/SDLSoftButtonManager.m5
-rw-r--r--SmartDeviceLink/SDLTextAndGraphicManager.m6
3 files changed, 17 insertions, 0 deletions
diff --git a/SmartDeviceLink/SDLChoiceSetManager.m b/SmartDeviceLink/SDLChoiceSetManager.m
index 35037ccc0..84c817bd0 100644
--- a/SmartDeviceLink/SDLChoiceSetManager.m
+++ b/SmartDeviceLink/SDLChoiceSetManager.m
@@ -404,11 +404,17 @@ UInt16 const ChoiceCellIdMin = 1;
- (void)sdl_registerResponse:(SDLRPCResponseNotification *)notification {
SDLRegisterAppInterfaceResponse *response = (SDLRegisterAppInterfaceResponse *)notification.response;
+
+ if (!response.success.boolValue) { return; }
+
self.displayCapabilities = response.displayCapabilities;
}
- (void)sdl_displayLayoutResponse:(SDLRPCResponseNotification *)notification {
SDLSetDisplayLayoutResponse *response = (SDLSetDisplayLayoutResponse *)notification.response;
+
+ if (!response.success.boolValue) { return; }
+
self.displayCapabilities = response.displayCapabilities;
}
diff --git a/SmartDeviceLink/SDLSoftButtonManager.m b/SmartDeviceLink/SDLSoftButtonManager.m
index e3e9278b2..a3d768829 100644
--- a/SmartDeviceLink/SDLSoftButtonManager.m
+++ b/SmartDeviceLink/SDLSoftButtonManager.m
@@ -355,6 +355,9 @@ NS_ASSUME_NONNULL_BEGIN
- (void)sdl_registerResponse:(SDLRPCResponseNotification *)notification {
SDLRegisterAppInterfaceResponse *response = (SDLRegisterAppInterfaceResponse *)notification.response;
+
+ if (!response.success.boolValue) { return; }
+
self.softButtonCapabilities = response.softButtonCapabilities ? response.softButtonCapabilities.firstObject : nil;
self.displayCapabilities = response.displayCapabilities;
}
@@ -362,6 +365,8 @@ NS_ASSUME_NONNULL_BEGIN
- (void)sdl_displayLayoutResponse:(SDLRPCResponseNotification *)notification {
SDLSetDisplayLayoutResponse *response = (SDLSetDisplayLayoutResponse *)notification.response;
+ if (!response.success.boolValue) { return; }
+
self.softButtonCapabilities = response.softButtonCapabilities ? response.softButtonCapabilities.firstObject : nil;
self.displayCapabilities = response.displayCapabilities;
diff --git a/SmartDeviceLink/SDLTextAndGraphicManager.m b/SmartDeviceLink/SDLTextAndGraphicManager.m
index 644200215..b9888ad1c 100644
--- a/SmartDeviceLink/SDLTextAndGraphicManager.m
+++ b/SmartDeviceLink/SDLTextAndGraphicManager.m
@@ -674,11 +674,17 @@ NS_ASSUME_NONNULL_BEGIN
- (void)sdl_registerResponse:(SDLRPCResponseNotification *)notification {
SDLRegisterAppInterfaceResponse *response = (SDLRegisterAppInterfaceResponse *)notification.response;
+
+ if (!response.success.boolValue) { return; }
+
self.displayCapabilities = response.displayCapabilities;
}
- (void)sdl_displayLayoutResponse:(SDLRPCResponseNotification *)notification {
SDLSetDisplayLayoutResponse *response = (SDLSetDisplayLayoutResponse *)notification.response;
+
+ if (!response.success.boolValue) { return; }
+
self.displayCapabilities = response.displayCapabilities;
// Auto-send an updated show