diff options
author | Joel Fischer <joeljfischer@gmail.com> | 2020-10-26 15:18:52 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-26 15:18:52 -0400 |
commit | 21fac926a0e7de618753b73fa880daec581fe516 (patch) | |
tree | c86547b983b0766f142ba938dc000b1259645cb8 | |
parent | 1d1f56013fbb1b56ecc3829c6c3aebabab7a1a73 (diff) | |
parent | 359f1b4eee404ce7a0f393c75fe1498ec728d5bd (diff) | |
download | sdl_ios-21fac926a0e7de618753b73fa880daec581fe516.tar.gz |
Merge branch 'develop' into bugfix/issue-remove-the-suppress-deprecation-warnings-from-tests
5 files changed, 28 insertions, 19 deletions
diff --git a/Example Apps/Example ObjC/ProxyManager.m b/Example Apps/Example ObjC/ProxyManager.m index 63650372b..ed2c057e3 100644 --- a/Example Apps/Example ObjC/ProxyManager.m +++ b/Example Apps/Example ObjC/ProxyManager.m @@ -169,7 +169,6 @@ NS_ASSUME_NONNULL_BEGIN [self.sdlManager.screenManager changeLayout:[[SDLTemplateConfiguration alloc] initWithPredefinedLayout:SDLPredefinedLayoutNonMedia] withCompletionHandler:nil]; [self sdlex_updateScreen]; - self.sdlManager.screenManager.softButtonObjects = [self.buttonManager allScreenSoftButtons]; } - (nullable RefreshUIHandler)refreshUIHandler { @@ -244,8 +243,9 @@ NS_ASSUME_NONNULL_BEGIN // This is our first time in a non-NONE state self.firstHMILevel = newLevel; - // Send static menu items. + // Send static menu items and soft buttons [self sdlex_createMenus]; + self.sdlManager.screenManager.softButtonObjects = [self.buttonManager allScreenSoftButtons]; // Subscribe to vehicle data. [self.vehicleDataManager subscribeToVehicleOdometer]; diff --git a/Example Apps/Example Swift/ProxyManager.swift b/Example Apps/Example Swift/ProxyManager.swift index b0a93edda..bce2617ad 100644 --- a/Example Apps/Example Swift/ProxyManager.swift +++ b/Example Apps/Example Swift/ProxyManager.swift @@ -165,8 +165,9 @@ extension ProxyManager: SDLManagerDelegate { // This is our first time in a non-NONE state firstHMILevelState = newLevel - // Send static menu items. + // Send static menu items and soft buttons createMenuAndGlobalVoiceCommands() + sdlManager.screenManager.softButtonObjects = buttonManager.allScreenSoftButtons() // Subscribe to vehicle data. vehicleDataManager.subscribeToVehicleOdometer() @@ -254,7 +255,6 @@ private extension ProxyManager { sdlManager.screenManager.changeLayout(SDLTemplateConfiguration(predefinedLayout: .nonMedia), withCompletionHandler: nil) updateScreen() - sdlManager.screenManager.softButtonObjects = buttonManager.allScreenSoftButtons() } /// Update the UI's textfields, images and soft buttons diff --git a/SmartDeviceLink/public/SDLOnDriverDistraction.h b/SmartDeviceLink/public/SDLOnDriverDistraction.h index f7df06bd8..e08efc583 100644 --- a/SmartDeviceLink/public/SDLOnDriverDistraction.h +++ b/SmartDeviceLink/public/SDLOnDriverDistraction.h @@ -33,14 +33,14 @@ NS_ASSUME_NONNULL_BEGIN Optional, Boolean */ -@property (strong, nonatomic) NSNumber<SDLBool> *lockScreenDismissalEnabled; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *lockScreenDismissalEnabled; /** Warning message to be displayed on the lock screen when dismissal is enabled. This warning should be used to ensure that the user is not the driver of the vehicle, ex. `Swipe up to dismiss, acknowledging that you are not the driver.`. This parameter must be present if "lockScreenDismissalEnabled" is set to true. Optional, String */ -@property (strong, nonatomic) NSString *lockScreenDismissalWarning; +@property (strong, nonatomic, nullable) NSString *lockScreenDismissalWarning; @end diff --git a/SmartDeviceLink/public/SDLOnDriverDistraction.m b/SmartDeviceLink/public/SDLOnDriverDistraction.m index 40fb3afa2..4d949ffb7 100644 --- a/SmartDeviceLink/public/SDLOnDriverDistraction.m +++ b/SmartDeviceLink/public/SDLOnDriverDistraction.m @@ -30,20 +30,20 @@ NS_ASSUME_NONNULL_BEGIN return [self.parameters sdl_enumForName:SDLRPCParameterNameState error:&error]; } -- (void)setLockScreenDismissalEnabled:(NSNumber<SDLBool> *)lockScreenDismissalEnabled { +- (void)setLockScreenDismissalEnabled:(nullable NSNumber<SDLBool> *)lockScreenDismissalEnabled { [self.parameters sdl_setObject:lockScreenDismissalEnabled forName:SDLRPCParameterNameLockScreenDismissalEnabled]; } -- (NSNumber<SDLBool> *)lockScreenDismissalEnabled { +- (nullable NSNumber<SDLBool> *)lockScreenDismissalEnabled { NSError *error = nil; return [self.parameters sdl_objectForName:SDLRPCParameterNameLockScreenDismissalEnabled ofClass:NSNumber.class error:&error]; } -- (void)setLockScreenDismissalWarning:(NSString *)lockScreenDismissalWarning { +- (void)setLockScreenDismissalWarning:(nullable NSString *)lockScreenDismissalWarning { [self.parameters sdl_setObject:lockScreenDismissalWarning forName:SDLRPCParameterNameLockScreenDismissalWarning]; } -- (NSString *)lockScreenDismissalWarning { +- (nullable NSString *)lockScreenDismissalWarning { NSError *error = nil; return [self.parameters sdl_objectForName:SDLRPCParameterNameLockScreenDismissalWarning ofClass:NSString.class error:&error]; } diff --git a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnDriverDistractionSpec.m b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnDriverDistractionSpec.m index c7709256e..2a5ef88dd 100644 --- a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnDriverDistractionSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnDriverDistractionSpec.m @@ -15,36 +15,44 @@ QuickSpecBegin(SDLOnDriverDistractionSpec) +NSString *testDismissalWarning = @"I got an apple."; + describe(@"Getter/Setter Tests", ^ { it(@"Should set and get correctly", ^ { SDLOnDriverDistraction *testNotification = [[SDLOnDriverDistraction alloc] init]; testNotification.state = SDLDriverDistractionStateOn; testNotification.lockScreenDismissalEnabled = @1; - + testNotification.lockScreenDismissalWarning = testDismissalWarning; + expect(testNotification.state).to(equal(SDLDriverDistractionStateOn)); expect(testNotification.lockScreenDismissalEnabled).to(beTrue()); - - testNotification.lockScreenDismissalEnabled = @0; - expect(testNotification.lockScreenDismissalEnabled).to(beFalse()); + expect(testNotification.lockScreenDismissalWarning).to(equal(testDismissalWarning)); }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary *dictOn = [@{SDLRPCParameterNameNotification: + NSDictionary *dictOn = @{SDLRPCParameterNameNotification: @{SDLRPCParameterNameParameters: @{SDLRPCParameterNameState:SDLDriverDistractionStateOn, - SDLRPCParameterNameLockScreenDismissalEnabled: @1}, - SDLRPCParameterNameOperationName:SDLRPCFunctionNameOnDriverDistraction}} mutableCopy]; + SDLRPCParameterNameLockScreenDismissalEnabled: @1, + SDLRPCParameterNameLockScreenDismissalWarning: testDismissalWarning}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameOnDriverDistraction}}; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + SDLOnDriverDistraction* testNotificationOn = [[SDLOnDriverDistraction alloc] initWithDictionary:dictOn]; expect(testNotificationOn.state).to(equal(SDLDriverDistractionStateOn)); expect(testNotificationOn.lockScreenDismissalEnabled).to(beTrue()); + expect(testNotificationOn.lockScreenDismissalWarning).to(equal(testDismissalWarning)); - NSMutableDictionary *dictOff = [@{SDLRPCParameterNameNotification: + NSDictionary *dictOff = @{SDLRPCParameterNameNotification: @{SDLRPCParameterNameParameters: @{SDLRPCParameterNameState:SDLDriverDistractionStateOff, SDLRPCParameterNameLockScreenDismissalEnabled: @0}, - SDLRPCParameterNameOperationName:SDLRPCFunctionNameOnDriverDistraction}} mutableCopy]; + SDLRPCParameterNameOperationName:SDLRPCFunctionNameOnDriverDistraction}}; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" SDLOnDriverDistraction *testNotificationOff = [[SDLOnDriverDistraction alloc] initWithDictionary:dictOff]; expect(testNotificationOff.state).to(equal(SDLDriverDistractionStateOff)); @@ -55,6 +63,7 @@ describe(@"Getter/Setter Tests", ^ { SDLOnDriverDistraction *testNotification = [[SDLOnDriverDistraction alloc] init]; expect(testNotification.state).to(beNil()); + expect(testNotification.lockScreenDismissalWarning).to(beNil()); expect(testNotification.lockScreenDismissalEnabled).to(beNil()); expect(testNotification.lockScreenDismissalEnabled).to(beFalsy()); }); |