summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Beharry <justin.beharry@livio.io>2022-08-30 16:55:29 -0400
committerJustin Beharry <justin.beharry@livio.io>2022-08-30 16:55:29 -0400
commit828c502a044a069848e7512e4c28e8d787c5b788 (patch)
tree2c9b35cb9949154137a7ca4d24599d9432769521
parent4e7d4d25e07855bb630f381b2780ceac47f5de59 (diff)
downloadsdl_ios-828c502a044a069848e7512e4c28e8d787c5b788.tar.gz
Make failedScreenState key into a global variable
-rw-r--r--SmartDeviceLink/private/SDLTextAndGraphicManager.m2
-rw-r--r--SmartDeviceLink/private/SDLTextAndGraphicUpdateOperation.h2
-rw-r--r--SmartDeviceLink/private/SDLTextAndGraphicUpdateOperation.m4
3 files changed, 6 insertions, 2 deletions
diff --git a/SmartDeviceLink/private/SDLTextAndGraphicManager.m b/SmartDeviceLink/private/SDLTextAndGraphicManager.m
index 8bebc49e4..f62487338 100644
--- a/SmartDeviceLink/private/SDLTextAndGraphicManager.m
+++ b/SmartDeviceLink/private/SDLTextAndGraphicManager.m
@@ -178,7 +178,7 @@ NS_ASSUME_NONNULL_BEGIN
} else if (error != nil) {
// Invalidate data that's different from our current screen data if a Show or SetDisplayLayout fails. This will prevent subsequent `Show`s from failing if the request failed due to the developer setting invalid data or subsequent `SetDisplayLayout`s from failing if the template is not supported on the module.
[strongSelf sdl_resetFieldsToCurrentScreenData];
- [strongSelf sdl_updatePendingOperationsWithFailedScreenState:error.userInfo[@"failedScreenState"]];
+ [strongSelf sdl_updatePendingOperationsWithFailedScreenState:error.userInfo[SDLTextAndGraphicFailedScreenStateErrorKey]];
}
} updateCompletionHandler:handler];
diff --git a/SmartDeviceLink/private/SDLTextAndGraphicUpdateOperation.h b/SmartDeviceLink/private/SDLTextAndGraphicUpdateOperation.h
index ebdab578b..e06306937 100644
--- a/SmartDeviceLink/private/SDLTextAndGraphicUpdateOperation.h
+++ b/SmartDeviceLink/private/SDLTextAndGraphicUpdateOperation.h
@@ -21,6 +21,8 @@
NS_ASSUME_NONNULL_BEGIN
+extern NSString *const SDLTextAndGraphicFailedScreenStateErrorKey;
+
typedef void(^SDLTextAndGraphicUpdateCompletionHandler)(NSError *__nullable error);
typedef void(^CurrentDataUpdatedHandler)(SDLTextAndGraphicState *__nullable newScreenData, NSError *__nullable error);
diff --git a/SmartDeviceLink/private/SDLTextAndGraphicUpdateOperation.m b/SmartDeviceLink/private/SDLTextAndGraphicUpdateOperation.m
index 582bf7a03..a2479570b 100644
--- a/SmartDeviceLink/private/SDLTextAndGraphicUpdateOperation.m
+++ b/SmartDeviceLink/private/SDLTextAndGraphicUpdateOperation.m
@@ -26,6 +26,8 @@
NS_ASSUME_NONNULL_BEGIN
+NSString *const SDLTextAndGraphicFailedScreenStateErrorKey = @"failedScreenState";
+
@interface SDLTextAndGraphicUpdateOperation ()
@property (weak, nonatomic) id<SDLConnectionManagerType> connectionManager;
@@ -178,7 +180,7 @@ NS_ASSUME_NONNULL_BEGIN
SDLLogE(@"Text and Graphic Show failed: %@", error);
NSError *updateError = [NSError errorWithDomain:error.domain code:error.code userInfo:@{
NSUnderlyingErrorKey: error.userInfo,
- @"failedScreenState": self.updatedState
+ SDLTextAndGraphicFailedScreenStateErrorKey: self.updatedState
}];
self.currentDataUpdatedHandler(nil, updateError);
}