From 4865b9dba15a2e70fc4e963770ed44f12bc2a9c3 Mon Sep 17 00:00:00 2001 From: Yasuhiro Yoneyama Date: Wed, 10 Jul 2019 10:39:36 +0900 Subject: [PATCH 01/22] implement proposal SDL-0237 'Add feature do disable "Video Streaming Backgrounded String" feature' --- SmartDeviceLink/SDLStreamingMediaConfiguration.h | 5 +++++ SmartDeviceLink/SDLStreamingMediaConfiguration.m | 1 + SmartDeviceLink/SDLStreamingVideoLifecycleManager.m | 6 +++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/SmartDeviceLink/SDLStreamingMediaConfiguration.h b/SmartDeviceLink/SDLStreamingMediaConfiguration.h index 3e4f91849..37e3ef433 100644 --- a/SmartDeviceLink/SDLStreamingMediaConfiguration.h +++ b/SmartDeviceLink/SDLStreamingMediaConfiguration.h @@ -85,6 +85,11 @@ typedef NS_ENUM(NSUInteger, SDLCarWindowRenderingType) { */ @property (assign, nonatomic) BOOL allowMultipleViewControllerOrientations; +/** + When YES, the StreamingMediaManager will send a black screen with "Video Backgrounded String". Defaults to YES. + */ +@property (assign, nonatomic) BOOL showVideoBackgroundDisplay; + /** Create an insecure video streaming configuration. No security managers will be provided and the encryption flag will be set to None. If you'd like custom video encoder settings, you can set the property manually. diff --git a/SmartDeviceLink/SDLStreamingMediaConfiguration.m b/SmartDeviceLink/SDLStreamingMediaConfiguration.m index 41c7df822..b100ea361 100644 --- a/SmartDeviceLink/SDLStreamingMediaConfiguration.m +++ b/SmartDeviceLink/SDLStreamingMediaConfiguration.m @@ -37,6 +37,7 @@ - (instancetype)initWithSecurityManagers:(nullable NSArray @property (copy, nonatomic, readonly) NSString *appName; @property (assign, nonatomic) CV_NULLABLE CVPixelBufferRef backgroundingPixelBuffer; +@property (assign, nonatomic) BOOL showVideoBackgroundDisplay; @property (strong, nonatomic, nullable) CADisplayLink *displayLink; @property (assign, nonatomic) BOOL useDisplayLink; @@ -122,6 +123,7 @@ - (instancetype)initWithConnectionManager:(id)connecti _useDisplayLink = configuration.streamingMediaConfig.enableForcedFramerateSync; _screenSize = SDLDefaultScreenSize; _backgroundingPixelBuffer = NULL; + _showVideoBackgroundDisplay = configuration.showVideoBackgroundDisplay; _preferredFormatIndex = 0; _preferredResolutionIndex = 0; @@ -272,7 +274,9 @@ - (void)didEnterStateAppInactive { SDLLogD(@"App became inactive"); if (!self.protocol) { return; } - [self sdl_sendBackgroundFrames]; + if (_showVideoBackgroundDisplay) { + [self sdl_sendBackgroundFrames]; + } [self.touchManager cancelPendingTouches]; if (self.isVideoConnected) { From 7f3f46e21e9e0d0800bd880fe9f495adda901bd7 Mon Sep 17 00:00:00 2001 From: Takamitsu Yoshii Date: Wed, 24 Jul 2019 10:06:40 +0900 Subject: [PATCH 02/22] fix-review: fix incorrect variable reference --- SmartDeviceLink/SDLStreamingVideoLifecycleManager.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SmartDeviceLink/SDLStreamingVideoLifecycleManager.m b/SmartDeviceLink/SDLStreamingVideoLifecycleManager.m index ffb4b3796..1a0076b39 100644 --- a/SmartDeviceLink/SDLStreamingVideoLifecycleManager.m +++ b/SmartDeviceLink/SDLStreamingVideoLifecycleManager.m @@ -123,7 +123,7 @@ - (instancetype)initWithConnectionManager:(id)connecti _useDisplayLink = configuration.streamingMediaConfig.enableForcedFramerateSync; _screenSize = SDLDefaultScreenSize; _backgroundingPixelBuffer = NULL; - _showVideoBackgroundDisplay = configuration.showVideoBackgroundDisplay; + _showVideoBackgroundDisplay = configuration.streamingMediaConfig.showVideoBackgroundDisplay; _preferredFormatIndex = 0; _preferredResolutionIndex = 0; From 478c594347d76410d72cf3e0dd659fd1499b2295 Mon Sep 17 00:00:00 2001 From: Takamitsu Yoshii Date: Wed, 24 Jul 2019 10:17:33 +0900 Subject: [PATCH 03/22] add test --- .../DevAPISpecs/SDLStreamingMediaConfigurationSpec.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLStreamingMediaConfigurationSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLStreamingMediaConfigurationSpec.m index c5fc8949c..096dac630 100644 --- a/SmartDeviceLinkTests/DevAPISpecs/SDLStreamingMediaConfigurationSpec.m +++ b/SmartDeviceLinkTests/DevAPISpecs/SDLStreamingMediaConfigurationSpec.m @@ -38,6 +38,7 @@ expect(testConfig.allowMultipleViewControllerOrientations).to(equal(NO)); expect(testConfig.dataSource).to(equal(testDataSource)); expect(testConfig.rootViewController).to(equal(testViewController)); + expect(testConfig.showVideoBackgroundDisplay).to(equal(YES)); }); }); @@ -53,6 +54,7 @@ expect(testConfig.allowMultipleViewControllerOrientations).to(equal(NO)); expect(testConfig.dataSource).to(beNil()); expect(testConfig.rootViewController).to(beNil()); + expect(testConfig.showVideoBackgroundDisplay).to(equal(YES)); }); }); @@ -72,6 +74,7 @@ expect(testConfig.allowMultipleViewControllerOrientations).to(equal(NO)); expect(testConfig.dataSource).to(beNil()); expect(testConfig.rootViewController).to(beNil()); + expect(testConfig.showVideoBackgroundDisplay).to(equal(YES)); }); }); }); From b49326faf6c036bbd6c87ffd23874f309d4bea03 Mon Sep 17 00:00:00 2001 From: Joel Fischer Date: Thu, 1 Aug 2019 13:48:10 -0400 Subject: [PATCH 04/22] Add a configuration option to disable lock screen dismissal --- SmartDeviceLink/SDLLockScreenConfiguration.h | 11 +++- SmartDeviceLink/SDLLockScreenConfiguration.m | 17 +++--- SmartDeviceLink/SDLLockScreenManager.m | 3 +- .../SDLLockScreenConfigurationSpec.m | 20 ++++--- .../DevAPISpecs/SDLLockScreenManagerSpec.m | 57 +++++++++++++++++-- 5 files changed, 82 insertions(+), 26 deletions(-) diff --git a/SmartDeviceLink/SDLLockScreenConfiguration.h b/SmartDeviceLink/SDLLockScreenConfiguration.h index 80575567a..854196520 100644 --- a/SmartDeviceLink/SDLLockScreenConfiguration.h +++ b/SmartDeviceLink/SDLLockScreenConfiguration.h @@ -14,9 +14,9 @@ NS_ASSUME_NONNULL_BEGIN @interface SDLLockScreenConfiguration : NSObject /** - * Whether or not the lock screen should be shown in the "lock screen optional" state. Defaults to false. + * Whether or not the lock screen should be shown in the "lock screen optional" state. Defaults to NO. * - * @discussion In order for the "lock screen optional" state to occur, the following must be true: + * In order for the "lock screen optional" state to occur, the following must be true: * 1. The app should have received at least 1 driver distraction notification (i.e. a `OnDriverDistraction` notification) from SDL Core. Older versions of Core did not send a notification immediately on connection. * 2. The driver is not distracted (i.e. the last `OnDriverDistraction` notification received was for a driver distraction state off). * 3. The `hmiLevel` can not be `NONE`. @@ -25,7 +25,12 @@ NS_ASSUME_NONNULL_BEGIN @property (assign, nonatomic) BOOL showInOptionalState; /** - * If YES, the lock screen should be managed by SDL and automatically engage when necessary. If NO, then the lock screen will never be engaged. + If YES, then the lock screen can be dismissed with a downward swipe on compatible head units. Requires a connection of SDL 6.0+ and the head unit to enable the feature. Defaults to YES. + */ +@property (assign, nonatomic) BOOL enableDismissGesture; + +/** + * If YES, the lock screen should be managed by SDL and automatically engage when necessary. If NO, then the lock screen will never be engaged. Defaults to YES. */ @property (assign, nonatomic, readonly) BOOL enableAutomaticLockScreen; diff --git a/SmartDeviceLink/SDLLockScreenConfiguration.m b/SmartDeviceLink/SDLLockScreenConfiguration.m index 4f82c287a..4798cf9d4 100644 --- a/SmartDeviceLink/SDLLockScreenConfiguration.m +++ b/SmartDeviceLink/SDLLockScreenConfiguration.m @@ -20,7 +20,7 @@ @implementation SDLLockScreenConfiguration #pragma mark - Lifecycle -- (instancetype)initWithAutoLockScreen:(BOOL)enableAutomatic enableInOptional:(BOOL)enableOptional backgroundColor:(UIColor *)backgroundColor appIcon:(nullable UIImage *)appIcon viewController:(nullable UIViewController *)customViewController { +- (instancetype)initWithAutoLockScreen:(BOOL)enableAutomatic enableInOptional:(BOOL)enableOptional enableDismissGesture:(BOOL)enableDismissGesture backgroundColor:(UIColor *)backgroundColor appIcon:(nullable UIImage *)appIcon viewController:(nullable UIViewController *)customViewController { self = [super init]; if (!self) { return nil; @@ -28,6 +28,7 @@ - (instancetype)initWithAutoLockScreen:(BOOL)enableAutomatic enableInOptional:(B _enableAutomaticLockScreen = enableAutomatic; _showInOptionalState = enableOptional; + _enableDismissGesture = enableDismissGesture; _backgroundColor = backgroundColor; _appIcon = appIcon; _customViewController = customViewController; @@ -36,11 +37,11 @@ - (instancetype)initWithAutoLockScreen:(BOOL)enableAutomatic enableInOptional:(B } + (instancetype)disabledConfiguration { - return [[self alloc] initWithAutoLockScreen:NO enableInOptional:NO backgroundColor:[self sdl_defaultBackgroundColor] appIcon:nil viewController:nil]; + return [[self alloc] initWithAutoLockScreen:NO enableInOptional:NO enableDismissGesture:NO backgroundColor:[self sdl_defaultBackgroundColor] appIcon:nil viewController:nil]; } + (instancetype)enabledConfiguration { - return [[self alloc] initWithAutoLockScreen:YES enableInOptional:NO backgroundColor:[self sdl_defaultBackgroundColor] appIcon:nil viewController:nil]; + return [[self alloc] initWithAutoLockScreen:YES enableInOptional:NO enableDismissGesture:YES backgroundColor:[self sdl_defaultBackgroundColor] appIcon:nil viewController:nil]; } + (instancetype)enabledConfigurationWithAppIcon:(UIImage *)lockScreenAppIcon backgroundColor:(nullable UIColor *)lockScreenBackgroundColor { @@ -48,11 +49,11 @@ + (instancetype)enabledConfigurationWithAppIcon:(UIImage *)lockScreenAppIcon bac lockScreenBackgroundColor = [self.class sdl_defaultBackgroundColor]; } - return [[self alloc] initWithAutoLockScreen:YES enableInOptional:NO backgroundColor:lockScreenBackgroundColor appIcon:lockScreenAppIcon viewController:nil]; + return [[self alloc] initWithAutoLockScreen:YES enableInOptional:NO enableDismissGesture:YES backgroundColor:lockScreenBackgroundColor appIcon:lockScreenAppIcon viewController:nil]; } + (instancetype)enabledConfigurationWithViewController:(UIViewController *)viewController { - return [[self alloc] initWithAutoLockScreen:YES enableInOptional:NO backgroundColor:[self.class sdl_defaultBackgroundColor] appIcon:nil viewController:viewController]; + return [[self alloc] initWithAutoLockScreen:YES enableInOptional:NO enableDismissGesture:YES backgroundColor:[self.class sdl_defaultBackgroundColor] appIcon:nil viewController:viewController]; } @@ -66,11 +67,7 @@ + (UIColor *)sdl_defaultBackgroundColor { #pragma mark - NSCopying - (id)copyWithZone:(nullable NSZone *)zone { - SDLLockScreenConfiguration *new = [[SDLLockScreenConfiguration allocWithZone:zone] initWithAutoLockScreen : _enableAutomaticLockScreen - enableInOptional : _showInOptionalState - backgroundColor : _backgroundColor - appIcon : _appIcon - viewController : _customViewController]; + SDLLockScreenConfiguration *new = [[SDLLockScreenConfiguration allocWithZone:zone] initWithAutoLockScreen:_enableAutomaticLockScreen enableInOptional:_showInOptionalState enableDismissGesture:_enableDismissGesture backgroundColor:_backgroundColor appIcon:_appIcon viewController:_customViewController]; return new; } diff --git a/SmartDeviceLink/SDLLockScreenManager.m b/SmartDeviceLink/SDLLockScreenManager.m index 0ffba3f7c..3d8ca341a 100644 --- a/SmartDeviceLink/SDLLockScreenManager.m +++ b/SmartDeviceLink/SDLLockScreenManager.m @@ -172,7 +172,8 @@ - (void)sdl_checkLockScreen { - (void)sdl_updateLockScreenDismissable { if (self.lastDriverDistractionNotification == nil || self.lastDriverDistractionNotification.lockScreenDismissalEnabled == nil || - !self.lastDriverDistractionNotification.lockScreenDismissalEnabled.boolValue) { + !self.lastDriverDistractionNotification.lockScreenDismissalEnabled.boolValue || + !self.config.enableDismissGesture) { self.lockScreenDismissable = NO; } else { self.lockScreenDismissable = YES; diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLLockScreenConfigurationSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLLockScreenConfigurationSpec.m index 59c3974df..f0a9bff24 100644 --- a/SmartDeviceLinkTests/DevAPISpecs/SDLLockScreenConfigurationSpec.m +++ b/SmartDeviceLinkTests/DevAPISpecs/SDLLockScreenConfigurationSpec.m @@ -14,8 +14,9 @@ }); it(@"should properly set properties", ^{ - expect(@(testConfig.enableAutomaticLockScreen)).to(beFalsy()); - expect(@(testConfig.showInOptionalState)).to(beFalsy()); + expect(testConfig.enableAutomaticLockScreen).to(beFalse()); + expect(testConfig.showInOptionalState).to(beFalse()); + expect(testConfig.enableDismissGesture).to(beFalse()); expect(testConfig.backgroundColor).to(equal([UIColor colorWithRed:(57.0/255.0) green:(78.0/255.0) blue:(96.0/255.0) alpha:1.0])); expect(testConfig.appIcon).to(beNil()); expect(testConfig.customViewController).to(beNil()); @@ -28,8 +29,9 @@ }); it(@"should properly set properties", ^{ - expect(@(testConfig.enableAutomaticLockScreen)).to(beTruthy()); - expect(@(testConfig.showInOptionalState)).to(beFalsy()); + expect(testConfig.enableAutomaticLockScreen).to(beTrue()); + expect(testConfig.showInOptionalState).to(beFalse()); + expect(testConfig.enableDismissGesture).to(beTrue()); expect(testConfig.backgroundColor).to(equal([UIColor colorWithRed:(57.0/255.0) green:(78.0/255.0) blue:(96.0/255.0) alpha:1.0])); expect(testConfig.appIcon).to(beNil()); expect(testConfig.customViewController).to(beNil()); @@ -48,8 +50,9 @@ }); it(@"should properly set properties", ^{ - expect(@(testConfig.enableAutomaticLockScreen)).to(beTruthy()); - expect(@(testConfig.showInOptionalState)).to(beFalsy()); + expect(testConfig.enableAutomaticLockScreen).to(beTrue()); + expect(testConfig.showInOptionalState).to(beFalse()); + expect(testConfig.enableDismissGesture).to(beTrue()); expect(testConfig.backgroundColor).to(equal([UIColor blueColor])); expect(testConfig.appIcon).to(equal(testImage)); expect(testConfig.customViewController).to(beNil()); @@ -66,8 +69,9 @@ }); it(@"should properly set properties", ^{ - expect(@(testConfig.enableAutomaticLockScreen)).to(beTruthy()); - expect(@(testConfig.showInOptionalState)).to(beFalsy()); + expect(testConfig.enableAutomaticLockScreen).to(beTrue()); + expect(testConfig.showInOptionalState).to(beFalse()); + expect(testConfig.enableDismissGesture).to(beTrue()); expect(testConfig.backgroundColor).to(equal([UIColor colorWithRed:(57.0/255.0) green:(78.0/255.0) blue:(96.0/255.0) alpha:1.0])); expect(testConfig.appIcon).to(beNil()); expect(testConfig.customViewController).to(equal(testVC)); diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLLockScreenManagerSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLLockScreenManagerSpec.m index 542ce850b..596c863b1 100644 --- a/SmartDeviceLinkTests/DevAPISpecs/SDLLockScreenManagerSpec.m +++ b/SmartDeviceLinkTests/DevAPISpecs/SDLLockScreenManagerSpec.m @@ -13,6 +13,22 @@ #import "SDLOnDriverDistraction.h" #import "SDLRPCNotificationNotification.h" +@interface SDLLockScreenManager () + +@property (assign, nonatomic) BOOL canPresent; +@property (strong, nonatomic, readwrite) SDLLockScreenConfiguration *config; +@property (strong, nonatomic) id presenter; + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +@property (strong, nonatomic, nullable) SDLOnLockScreenStatus *lastLockNotification; +#pragma clang diagnostic pop + +@property (strong, nonatomic, nullable) SDLOnDriverDistraction *lastDriverDistractionNotification; +@property (assign, nonatomic, readwrite, getter=isLockScreenDismissable) BOOL lockScreenDismissable; +@property (assign, nonatomic) BOOL lockScreenDismissedByUser; + +@end QuickSpecBegin(SDLLockScreenManagerSpec) @@ -32,7 +48,7 @@ it(@"should set properties correctly", ^{ // Note: We can't check the "lockScreenPresented" flag on the Lock Screen Manager because it's a computer property checking the window - expect(@(fakePresenter.presented)).to(beFalsy()); + expect(fakePresenter.presented).to(beFalse()); expect(testManager.lockScreenViewController).to(beNil()); }); @@ -110,7 +126,7 @@ }); it(@"should have presented the lock screen", ^{ - expect(@(fakePresenter.presented)).to(beTruthy()); + expect(fakePresenter.presented).to(beTrue()); }); it(@"should not have a vehicle icon", ^{ @@ -146,10 +162,9 @@ it(@"should be able to be dismissed", ^{ expect(testManager.isLockScreenDismissable).toEventually(equal(YES)); }); - }); - describe(@"when a driver distraction notification is posted with lockScreenDismissableEnabled 0 bit", ^{ + describe(@"when a driver distraction notification is posted with lockScreenDismissableEnabled as false", ^{ __block SDLRPCNotificationNotification *testDriverDistractionNotification = nil; beforeEach(^{ @@ -277,6 +292,40 @@ }); }); + context(@"with a dismissable false configuration", ^{ + beforeEach(^{ + SDLLockScreenConfiguration *config = [SDLLockScreenConfiguration enabledConfiguration]; + config.enableDismissGesture = NO; + + testManager = [[SDLLockScreenManager alloc] initWithConfiguration:config notificationDispatcher:nil presenter:fakePresenter]; + [testManager start]; + }); + + describe(@"when a driver distraction notification is posted with lockScreenDismissableEnabled as true", ^{ + __block SDLRPCNotificationNotification *testDriverDistractionNotification = nil; + + beforeEach(^{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + SDLOnLockScreenStatus *status = [[SDLOnLockScreenStatus alloc] init]; +#pragma clang diagnostic pop + status.lockScreenStatus = SDLLockScreenStatusRequired; + testManager.lastLockNotification = status; + + SDLOnDriverDistraction *testDriverDistraction = [[SDLOnDriverDistraction alloc] init]; + testDriverDistraction.lockScreenDismissalEnabled = @YES; + + testDriverDistractionNotification = [[SDLRPCNotificationNotification alloc] initWithName:SDLDidChangeDriverDistractionStateNotification object:nil rpcNotification:testDriverDistraction]; + + [[NSNotificationCenter defaultCenter] postNotification:testDriverDistractionNotification]; + }); + + it(@"should not be able to be dismissed", ^{ + expect(testManager.isLockScreenDismissable).toEventually(equal(NO)); + }); + }); + }); + describe(@"A lock screen status of OPTIONAL", ^{ __block SDLLockScreenManager *testLockScreenManager = nil; __block SDLLockScreenConfiguration *testLockScreenConfig = nil; From 9e7dfd855755a00c9537797b145403c83c4a3df2 Mon Sep 17 00:00:00 2001 From: Joel Fischer Date: Thu, 1 Aug 2019 16:03:46 -0400 Subject: [PATCH 05/22] Fix SDLDisplayCapabilities templatesAvailable documentation --- SmartDeviceLink/SDLDisplayCapabilities.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SmartDeviceLink/SDLDisplayCapabilities.h b/SmartDeviceLink/SDLDisplayCapabilities.h index b278ef3a2..b5644379f 100644 --- a/SmartDeviceLink/SDLDisplayCapabilities.h +++ b/SmartDeviceLink/SDLDisplayCapabilities.h @@ -75,11 +75,11 @@ NS_ASSUME_NONNULL_BEGIN @property (strong, nonatomic) NSNumber *graphicSupported; /** - * Number of presets the screen supports + * An array of all predefined persistent display templates available on the head unit. * - * @discussion The number of on-screen custom presets available (if any) + * Optional, Array of String, max string size 100, 0 - 100 objects, since SDL 3.0 * - * Optional, Array of String, max string size 100, 0 - 100 objects + * See SDLPredefinedLayout */ @property (nullable, strong, nonatomic) NSArray *templatesAvailable; From a2a2c96031a21efba653c71b4af800ff63dcf372 Mon Sep 17 00:00:00 2001 From: Justin Gluck Date: Fri, 2 Aug 2019 09:34:07 -0400 Subject: [PATCH 06/22] adding optional parameter to hide vehicle logo from lock screen --- Example Apps/Example ObjC/ProxyManager.m | 5 ++++- SmartDeviceLink/SDLLockScreenConfiguration.h | 5 +++++ SmartDeviceLink/SDLLockScreenConfiguration.m | 1 + SmartDeviceLink/SDLLockScreenManager.m | 2 +- 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Example Apps/Example ObjC/ProxyManager.m b/Example Apps/Example ObjC/ProxyManager.m index 980c5b137..cc25ecdbd 100644 --- a/Example Apps/Example ObjC/ProxyManager.m +++ b/Example Apps/Example ObjC/ProxyManager.m @@ -114,7 +114,10 @@ - (void)sdlex_setupConfigurationWithLifecycleConfiguration:(SDLLifecycleConfigur [self sdlex_startManager]; return; } - SDLConfiguration *config = [SDLConfiguration configurationWithLifecycle:lifecycleConfiguration lockScreen:[SDLLockScreenConfiguration enabledConfigurationWithAppIcon:[UIImage imageNamed:ExampleAppLogoName] backgroundColor:nil] logging:[self.class sdlex_logConfiguration] fileManager:[SDLFileManagerConfiguration defaultConfiguration]]; + SDLLockScreenConfiguration *lockscreen = [SDLLockScreenConfiguration enabledConfigurationWithAppIcon:[UIImage imageNamed:ExampleAppLogoName] backgroundColor:nil]; + lockscreen.showDeviceLogo = false; + + SDLConfiguration *config = [SDLConfiguration configurationWithLifecycle:lifecycleConfiguration lockScreen: lockscreen logging:[self.class sdlex_logConfiguration] fileManager:[SDLFileManagerConfiguration defaultConfiguration]]; self.sdlManager = [[SDLManager alloc] initWithConfiguration:config delegate:self]; [self sdlex_startManager]; } diff --git a/SmartDeviceLink/SDLLockScreenConfiguration.h b/SmartDeviceLink/SDLLockScreenConfiguration.h index 80575567a..06963c85a 100644 --- a/SmartDeviceLink/SDLLockScreenConfiguration.h +++ b/SmartDeviceLink/SDLLockScreenConfiguration.h @@ -24,6 +24,11 @@ NS_ASSUME_NONNULL_BEGIN */ @property (assign, nonatomic) BOOL showInOptionalState; +/** + * Set showDeviceLogo to false to hide the vehicle logo. + */ +@property (assign, nonatomic) BOOL showDeviceLogo; + /** * If YES, the lock screen should be managed by SDL and automatically engage when necessary. If NO, then the lock screen will never be engaged. */ diff --git a/SmartDeviceLink/SDLLockScreenConfiguration.m b/SmartDeviceLink/SDLLockScreenConfiguration.m index 4f82c287a..92da8c3a9 100644 --- a/SmartDeviceLink/SDLLockScreenConfiguration.m +++ b/SmartDeviceLink/SDLLockScreenConfiguration.m @@ -31,6 +31,7 @@ - (instancetype)initWithAutoLockScreen:(BOOL)enableAutomatic enableInOptional:(B _backgroundColor = backgroundColor; _appIcon = appIcon; _customViewController = customViewController; + _showDeviceLogo = true; return self; } diff --git a/SmartDeviceLink/SDLLockScreenManager.m b/SmartDeviceLink/SDLLockScreenManager.m index 0ffba3f7c..8a8093d23 100644 --- a/SmartDeviceLink/SDLLockScreenManager.m +++ b/SmartDeviceLink/SDLLockScreenManager.m @@ -126,7 +126,7 @@ - (void)sdl_lockScreenIconReceived:(NSNotification *)notification { UIImage *icon = notification.userInfo[SDLNotificationUserInfoObject]; // If the VC is our special type, then add the vehicle icon. If they passed in a custom VC, there's no current way to show the vehicle icon. If they're managing it themselves, they can grab the notification themselves. - if ([self.lockScreenViewController isKindOfClass:[SDLLockScreenViewController class]]) { + if ([self.lockScreenViewController isKindOfClass:[SDLLockScreenViewController class]] && self.config.showDeviceLogo) { ((SDLLockScreenViewController *)self.lockScreenViewController).vehicleIcon = icon; } } From 4b0703159a535911d89a24692a0a37113402ed19 Mon Sep 17 00:00:00 2001 From: Joel Fischer Date: Wed, 7 Aug 2019 15:10:28 -0400 Subject: [PATCH 07/22] Add a single state soft button object without having to create a state object first --- SmartDeviceLink/SDLSoftButtonObject.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/SmartDeviceLink/SDLSoftButtonObject.h b/SmartDeviceLink/SDLSoftButtonObject.h index fe641a56e..abcb36d46 100644 --- a/SmartDeviceLink/SDLSoftButtonObject.h +++ b/SmartDeviceLink/SDLSoftButtonObject.h @@ -58,11 +58,23 @@ NS_ASSUME_NONNULL_BEGIN Create a single-state soft button. For example, a button that brings up a Perform Interaction menu. @param name The name of the button - @param eventHandler The handler to be called when the button is in the current state and is pressed @param state The single state of the button + @param eventHandler The handler to be called when the button is pressed + @return The button object */ - (instancetype)initWithName:(NSString *)name state:(SDLSoftButtonState *)state handler:(nullable SDLRPCButtonNotificationHandler)eventHandler; +/** + Create a single-state soft button. For example, a button that brings up a Perform Interaction menu. + + @param name The name of the button + @param text The text to be displayed on the button + @param artwork The artwork to be displayed on the button + @param eventHandler The handler to be called when the button is pressed + @return The button object + */ +- (instancetype)initWithName:(NSString *)name text:(nullable NSString *)text artwork:(nullable SDLArtwork *)artwork handler:(nullable SDLRPCButtonNotificationHandler)eventHandler; + /** Transition the soft button to another state in the `states` property. The wrapper considers all transitions valid (assuming a state with that name exists). From f0e6c968a2ac0ba47c36b192eb42655d2f358d46 Mon Sep 17 00:00:00 2001 From: Joel Fischer Date: Wed, 7 Aug 2019 16:29:52 -0400 Subject: [PATCH 08/22] Add tests --- SmartDeviceLink/SDLSoftButtonObject.h | 1 + SmartDeviceLink/SDLSoftButtonObject.m | 5 +++ .../SDLSoftButtonObjectSpec.m | 31 +++++++++++++++++++ 3 files changed, 37 insertions(+) diff --git a/SmartDeviceLink/SDLSoftButtonObject.h b/SmartDeviceLink/SDLSoftButtonObject.h index abcb36d46..eb2512fca 100644 --- a/SmartDeviceLink/SDLSoftButtonObject.h +++ b/SmartDeviceLink/SDLSoftButtonObject.h @@ -10,6 +10,7 @@ #import "SDLNotificationConstants.h" +@class SDLArtwork; @class SDLSoftButton; @class SDLSoftButtonObject; @class SDLSoftButtonState; diff --git a/SmartDeviceLink/SDLSoftButtonObject.m b/SmartDeviceLink/SDLSoftButtonObject.m index 427421590..3d74c168a 100644 --- a/SmartDeviceLink/SDLSoftButtonObject.m +++ b/SmartDeviceLink/SDLSoftButtonObject.m @@ -53,6 +53,11 @@ - (instancetype)initWithName:(NSString *)name state:(SDLSoftButtonState *)state return [self initWithName:name states:@[state] initialStateName:state.name handler:eventHandler]; } +- (instancetype)initWithName:(NSString *)name text:(nullable NSString *)text artwork:(nullable SDLArtwork *)artwork handler:(nullable SDLRPCButtonNotificationHandler)eventHandler { + SDLSoftButtonState *implicitState = [[SDLSoftButtonState alloc] initWithStateName:name text:text artwork:artwork]; + return [self initWithName:name state:implicitState handler:eventHandler]; +} + - (BOOL)transitionToStateNamed:(NSString *)stateName { if ([self stateWithName:stateName] == nil) { SDLLogE(@"Attempted to transition to state: %@ on soft button: %@ but no state with that name was found", stateName, self.name); diff --git a/SmartDeviceLinkTests/SDLSoftButtonObjectSpec.m b/SmartDeviceLinkTests/SDLSoftButtonObjectSpec.m index 6122c6a8b..201b08dd3 100644 --- a/SmartDeviceLinkTests/SDLSoftButtonObjectSpec.m +++ b/SmartDeviceLinkTests/SDLSoftButtonObjectSpec.m @@ -2,6 +2,7 @@ #import #import +#import "SDLArtwork.h" #import "SDLSoftButton.h" #import "SDLSoftButtonObject.h" #import "SDLSoftButtonState.h" @@ -45,6 +46,36 @@ }); }); + context(@"with a single state implicitly created", ^{ + NSString *testText = @"Hello"; + SDLArtwork *testArt = [[SDLArtwork alloc] initWithStaticIcon:SDLStaticIconNameKey]; + + beforeEach(^{ + testObject = [[SDLSoftButtonObject alloc] initWithName:testObjectName text:testText artwork:testArt handler:nil]; + }); + + it(@"should create correctly", ^{ + expect(testObject.name).to(equal(testObjectName)); + expect(testObject.currentState.name).to(equal(testObjectName)); + expect(testObject.currentState.text).to(equal(testText)); + expect(testObject.currentState.artwork).to(equal(testArt)); + expect(testObject.states).to(haveCount(1)); + }); + + it(@"should not allow transitioning to another state", ^{ + BOOL performedTransition = [testObject transitionToStateNamed:@"Some other state"]; + expect(performedTransition).to(beFalse()); + }); + + it(@"should return a state when asked and not when incorrect", ^{ + SDLSoftButtonState *returnedState = [testObject stateWithName:testObjectName]; + expect(returnedState).toNot(beNil()); + + returnedState = [testObject stateWithName:@"Some other state"]; + expect(returnedState).to(beNil()); + }); + }); + context(@"with multiple states", ^{ __block SDLSoftButtonState *testFirstState = OCMClassMock([SDLSoftButtonState class]); __block NSString *testFirstStateName = @"Test First Name"; From 9e3ecd184ab60eebb954c6f649a4889141bc9087 Mon Sep 17 00:00:00 2001 From: Joel Fischer Date: Thu, 8 Aug 2019 14:17:07 -0400 Subject: [PATCH 09/22] Don't try to transition SoftButtonObject if there's only one state --- SmartDeviceLink/SDLSoftButtonObject.m | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/SmartDeviceLink/SDLSoftButtonObject.m b/SmartDeviceLink/SDLSoftButtonObject.m index 3d74c168a..adb153e1a 100644 --- a/SmartDeviceLink/SDLSoftButtonObject.m +++ b/SmartDeviceLink/SDLSoftButtonObject.m @@ -64,6 +64,11 @@ - (BOOL)transitionToStateNamed:(NSString *)stateName { return NO; } + if (self.states.count == 1) { + SDLLogW(@"There's only one state, so no transitioning is possible!"); + return NO; + } + SDLLogD(@"Transitioning button %@ to state %@", self.name, stateName); self.currentStateName = stateName; [self.manager sdl_transitionSoftButton:self]; From d16cd3cccd87980a7d7b37cdbc13d91649913948 Mon Sep 17 00:00:00 2001 From: Justin Gluck Date: Thu, 8 Aug 2019 15:03:26 -0400 Subject: [PATCH 10/22] adding unit tests and updating config --- SmartDeviceLink/SDLLockScreenConfiguration.h | 6 +++++ SmartDeviceLink/SDLLockScreenConfiguration.m | 14 +++++----- .../SDLLockScreenConfigurationSpec.m | 4 +++ .../DevAPISpecs/SDLLockScreenManagerSpec.m | 26 ++++++++++++++++++- 4 files changed, 42 insertions(+), 8 deletions(-) diff --git a/SmartDeviceLink/SDLLockScreenConfiguration.h b/SmartDeviceLink/SDLLockScreenConfiguration.h index 854196520..91e4bfabf 100644 --- a/SmartDeviceLink/SDLLockScreenConfiguration.h +++ b/SmartDeviceLink/SDLLockScreenConfiguration.h @@ -29,6 +29,12 @@ NS_ASSUME_NONNULL_BEGIN */ @property (assign, nonatomic) BOOL enableDismissGesture; +/** +* If YES, then the lockscreen will show the vehicle logo. If NO, then the lockscreen will not show the vehicle logo. + Defaults to YES. +*/ +@property (assign, nonatomic) BOOL showDeviceLogo; + /** * If YES, the lock screen should be managed by SDL and automatically engage when necessary. If NO, then the lock screen will never be engaged. Defaults to YES. */ diff --git a/SmartDeviceLink/SDLLockScreenConfiguration.m b/SmartDeviceLink/SDLLockScreenConfiguration.m index 985657243..f2cf71f9f 100644 --- a/SmartDeviceLink/SDLLockScreenConfiguration.m +++ b/SmartDeviceLink/SDLLockScreenConfiguration.m @@ -20,7 +20,7 @@ @implementation SDLLockScreenConfiguration #pragma mark - Lifecycle -- (instancetype)initWithAutoLockScreen:(BOOL)enableAutomatic enableInOptional:(BOOL)enableOptional enableDismissGesture:(BOOL)enableDismissGesture backgroundColor:(UIColor *)backgroundColor appIcon:(nullable UIImage *)appIcon viewController:(nullable UIViewController *)customViewController { +- (instancetype)initWithAutoLockScreen:(BOOL)enableAutomatic enableInOptional:(BOOL)enableOptional enableDismissGesture:(BOOL)enableDismissGesture showDeviceLogo:(BOOL)showDeviceLogo backgroundColor:(UIColor *)backgroundColor appIcon:(nullable UIImage *)appIcon viewController:(nullable UIViewController *)customViewController { self = [super init]; if (!self) { return nil; @@ -32,17 +32,17 @@ - (instancetype)initWithAutoLockScreen:(BOOL)enableAutomatic enableInOptional:(B _backgroundColor = backgroundColor; _appIcon = appIcon; _customViewController = customViewController; - _showDeviceLogo = true; + _showDeviceLogo = showDeviceLogo; return self; } + (instancetype)disabledConfiguration { - return [[self alloc] initWithAutoLockScreen:NO enableInOptional:NO enableDismissGesture:NO backgroundColor:[self sdl_defaultBackgroundColor] appIcon:nil viewController:nil]; + return [[self alloc] initWithAutoLockScreen:NO enableInOptional:NO enableDismissGesture:NO showDeviceLogo:NO backgroundColor:[self sdl_defaultBackgroundColor] appIcon:nil viewController:nil]; } + (instancetype)enabledConfiguration { - return [[self alloc] initWithAutoLockScreen:YES enableInOptional:NO enableDismissGesture:YES backgroundColor:[self sdl_defaultBackgroundColor] appIcon:nil viewController:nil]; + return [[self alloc] initWithAutoLockScreen:YES enableInOptional:NO enableDismissGesture:YES showDeviceLogo:YES backgroundColor:[self sdl_defaultBackgroundColor] appIcon:nil viewController:nil]; } + (instancetype)enabledConfigurationWithAppIcon:(UIImage *)lockScreenAppIcon backgroundColor:(nullable UIColor *)lockScreenBackgroundColor { @@ -50,11 +50,11 @@ + (instancetype)enabledConfigurationWithAppIcon:(UIImage *)lockScreenAppIcon bac lockScreenBackgroundColor = [self.class sdl_defaultBackgroundColor]; } - return [[self alloc] initWithAutoLockScreen:YES enableInOptional:NO enableDismissGesture:YES backgroundColor:lockScreenBackgroundColor appIcon:lockScreenAppIcon viewController:nil]; + return [[self alloc] initWithAutoLockScreen:YES enableInOptional:NO enableDismissGesture:YES showDeviceLogo:YES backgroundColor:lockScreenBackgroundColor appIcon:lockScreenAppIcon viewController:nil]; } + (instancetype)enabledConfigurationWithViewController:(UIViewController *)viewController { - return [[self alloc] initWithAutoLockScreen:YES enableInOptional:NO enableDismissGesture:YES backgroundColor:[self.class sdl_defaultBackgroundColor] appIcon:nil viewController:viewController]; + return [[self alloc] initWithAutoLockScreen:YES enableInOptional:NO enableDismissGesture:YES showDeviceLogo:YES backgroundColor:[self.class sdl_defaultBackgroundColor] appIcon:nil viewController:viewController]; } @@ -68,7 +68,7 @@ + (UIColor *)sdl_defaultBackgroundColor { #pragma mark - NSCopying - (id)copyWithZone:(nullable NSZone *)zone { - SDLLockScreenConfiguration *new = [[SDLLockScreenConfiguration allocWithZone:zone] initWithAutoLockScreen:_enableAutomaticLockScreen enableInOptional:_showInOptionalState enableDismissGesture:_enableDismissGesture backgroundColor:_backgroundColor appIcon:_appIcon viewController:_customViewController]; + SDLLockScreenConfiguration *new = [[SDLLockScreenConfiguration allocWithZone:zone] initWithAutoLockScreen:_enableAutomaticLockScreen enableInOptional:_showInOptionalState enableDismissGesture:_enableDismissGesture showDeviceLogo:_showDeviceLogo backgroundColor:_backgroundColor appIcon:_appIcon viewController:_customViewController]; return new; } diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLLockScreenConfigurationSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLLockScreenConfigurationSpec.m index f0a9bff24..d35717658 100644 --- a/SmartDeviceLinkTests/DevAPISpecs/SDLLockScreenConfigurationSpec.m +++ b/SmartDeviceLinkTests/DevAPISpecs/SDLLockScreenConfigurationSpec.m @@ -17,6 +17,7 @@ expect(testConfig.enableAutomaticLockScreen).to(beFalse()); expect(testConfig.showInOptionalState).to(beFalse()); expect(testConfig.enableDismissGesture).to(beFalse()); + expect(testConfig.showDeviceLogo).to(beFalse()); expect(testConfig.backgroundColor).to(equal([UIColor colorWithRed:(57.0/255.0) green:(78.0/255.0) blue:(96.0/255.0) alpha:1.0])); expect(testConfig.appIcon).to(beNil()); expect(testConfig.customViewController).to(beNil()); @@ -32,6 +33,7 @@ expect(testConfig.enableAutomaticLockScreen).to(beTrue()); expect(testConfig.showInOptionalState).to(beFalse()); expect(testConfig.enableDismissGesture).to(beTrue()); + expect(testConfig.showDeviceLogo).to(beTrue()); expect(testConfig.backgroundColor).to(equal([UIColor colorWithRed:(57.0/255.0) green:(78.0/255.0) blue:(96.0/255.0) alpha:1.0])); expect(testConfig.appIcon).to(beNil()); expect(testConfig.customViewController).to(beNil()); @@ -53,6 +55,7 @@ expect(testConfig.enableAutomaticLockScreen).to(beTrue()); expect(testConfig.showInOptionalState).to(beFalse()); expect(testConfig.enableDismissGesture).to(beTrue()); + expect(testConfig.showDeviceLogo).to(beTrue()); expect(testConfig.backgroundColor).to(equal([UIColor blueColor])); expect(testConfig.appIcon).to(equal(testImage)); expect(testConfig.customViewController).to(beNil()); @@ -72,6 +75,7 @@ expect(testConfig.enableAutomaticLockScreen).to(beTrue()); expect(testConfig.showInOptionalState).to(beFalse()); expect(testConfig.enableDismissGesture).to(beTrue()); + expect(testConfig.showDeviceLogo).to(beTrue()); expect(testConfig.backgroundColor).to(equal([UIColor colorWithRed:(57.0/255.0) green:(78.0/255.0) blue:(96.0/255.0) alpha:1.0])); expect(testConfig.appIcon).to(beNil()); expect(testConfig.customViewController).to(equal(testVC)); diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLLockScreenManagerSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLLockScreenManagerSpec.m index 596c863b1..912fe9161 100644 --- a/SmartDeviceLinkTests/DevAPISpecs/SDLLockScreenManagerSpec.m +++ b/SmartDeviceLinkTests/DevAPISpecs/SDLLockScreenManagerSpec.m @@ -233,7 +233,31 @@ @interface SDLLockScreenManager () }); }); }); - + + context(@"with showDeiveLogo as false", ^{ + beforeEach(^{ + SDLLockScreenConfiguration *config = [SDLLockScreenConfiguration enabledConfiguration]; + config.showDeviceLogo = NO; + + testManager = [[SDLLockScreenManager alloc] initWithConfiguration:config notificationDispatcher:nil presenter:fakePresenter]; + [testManager start]; + }); + + describe(@"when a vehicle icon is received", ^{ + __block UIImage *testIcon = nil; + + beforeEach(^{ + testIcon = [UIImage imageNamed:@"testImagePNG" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil]; + [[NSNotificationCenter defaultCenter] postNotificationName:SDLDidReceiveLockScreenIcon object:nil userInfo:@{ SDLNotificationUserInfoObject: testIcon }]; + }); + + it(@"should have a vehicle icon if showDeviceLogo is set to true", ^{ + expect(((SDLLockScreenViewController *)testManager.lockScreenViewController).vehicleIcon).to(beNil()); + }); + }); + + }); + context(@"with a custom color configuration", ^{ __block UIColor *testColor = nil; __block UIImage *testImage = nil; From add0c013b767710d55dfe9509850f0e32dd13750 Mon Sep 17 00:00:00 2001 From: Justin Gluck Date: Thu, 8 Aug 2019 15:12:15 -0400 Subject: [PATCH 11/22] removing showDeviceLogo being set to false --- Example Apps/Example ObjC/ProxyManager.m | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Example Apps/Example ObjC/ProxyManager.m b/Example Apps/Example ObjC/ProxyManager.m index cc25ecdbd..36d9699ff 100644 --- a/Example Apps/Example ObjC/ProxyManager.m +++ b/Example Apps/Example ObjC/ProxyManager.m @@ -115,9 +115,8 @@ - (void)sdlex_setupConfigurationWithLifecycleConfiguration:(SDLLifecycleConfigur return; } SDLLockScreenConfiguration *lockscreen = [SDLLockScreenConfiguration enabledConfigurationWithAppIcon:[UIImage imageNamed:ExampleAppLogoName] backgroundColor:nil]; - lockscreen.showDeviceLogo = false; - SDLConfiguration *config = [SDLConfiguration configurationWithLifecycle:lifecycleConfiguration lockScreen: lockscreen logging:[self.class sdlex_logConfiguration] fileManager:[SDLFileManagerConfiguration defaultConfiguration]]; + SDLConfiguration *config = [SDLConfiguration configurationWithLifecycle:lifecycleConfiguration lockScreen:lockscreen logging:[self.class sdlex_logConfiguration] fileManager:[SDLFileManagerConfiguration defaultConfiguration]]; self.sdlManager = [[SDLManager alloc] initWithConfiguration:config delegate:self]; [self sdlex_startManager]; } From 82ea120ad5b3d0df4a0d9e074924eff000c17691 Mon Sep 17 00:00:00 2001 From: Justin Gluck Date: Thu, 8 Aug 2019 15:12:47 -0400 Subject: [PATCH 12/22] undoing things --- Example Apps/Example ObjC/ProxyManager.m | 2 -- 1 file changed, 2 deletions(-) diff --git a/Example Apps/Example ObjC/ProxyManager.m b/Example Apps/Example ObjC/ProxyManager.m index 36d9699ff..89e979fce 100644 --- a/Example Apps/Example ObjC/ProxyManager.m +++ b/Example Apps/Example ObjC/ProxyManager.m @@ -114,8 +114,6 @@ - (void)sdlex_setupConfigurationWithLifecycleConfiguration:(SDLLifecycleConfigur [self sdlex_startManager]; return; } - SDLLockScreenConfiguration *lockscreen = [SDLLockScreenConfiguration enabledConfigurationWithAppIcon:[UIImage imageNamed:ExampleAppLogoName] backgroundColor:nil]; - SDLConfiguration *config = [SDLConfiguration configurationWithLifecycle:lifecycleConfiguration lockScreen:lockscreen logging:[self.class sdlex_logConfiguration] fileManager:[SDLFileManagerConfiguration defaultConfiguration]]; self.sdlManager = [[SDLManager alloc] initWithConfiguration:config delegate:self]; [self sdlex_startManager]; From d46dcd0d2e87408fca74a1c7aca971ec25162a4d Mon Sep 17 00:00:00 2001 From: Justin Gluck Date: Thu, 8 Aug 2019 15:13:41 -0400 Subject: [PATCH 13/22] no message --- Example Apps/Example ObjC/ProxyManager.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Example Apps/Example ObjC/ProxyManager.m b/Example Apps/Example ObjC/ProxyManager.m index 89e979fce..980c5b137 100644 --- a/Example Apps/Example ObjC/ProxyManager.m +++ b/Example Apps/Example ObjC/ProxyManager.m @@ -114,7 +114,7 @@ - (void)sdlex_setupConfigurationWithLifecycleConfiguration:(SDLLifecycleConfigur [self sdlex_startManager]; return; } - SDLConfiguration *config = [SDLConfiguration configurationWithLifecycle:lifecycleConfiguration lockScreen:lockscreen logging:[self.class sdlex_logConfiguration] fileManager:[SDLFileManagerConfiguration defaultConfiguration]]; + SDLConfiguration *config = [SDLConfiguration configurationWithLifecycle:lifecycleConfiguration lockScreen:[SDLLockScreenConfiguration enabledConfigurationWithAppIcon:[UIImage imageNamed:ExampleAppLogoName] backgroundColor:nil] logging:[self.class sdlex_logConfiguration] fileManager:[SDLFileManagerConfiguration defaultConfiguration]]; self.sdlManager = [[SDLManager alloc] initWithConfiguration:config delegate:self]; [self sdlex_startManager]; } From cb560a116064d6dfc4086a4bb1859dbacc6da48e Mon Sep 17 00:00:00 2001 From: Takamitsu Yoshii Date: Fri, 9 Aug 2019 10:46:26 +0900 Subject: [PATCH 14/22] make `showVideoBackgroundDisplay` togglable --- SmartDeviceLink/SDLStreamingMediaConfiguration.h | 5 ----- SmartDeviceLink/SDLStreamingMediaConfiguration.m | 1 - SmartDeviceLink/SDLStreamingMediaManager.h | 5 +++++ SmartDeviceLink/SDLStreamingMediaManager.m | 9 +++++++++ SmartDeviceLink/SDLStreamingVideoLifecycleManager.h | 6 ++++++ SmartDeviceLink/SDLStreamingVideoLifecycleManager.m | 3 +-- 6 files changed, 21 insertions(+), 8 deletions(-) diff --git a/SmartDeviceLink/SDLStreamingMediaConfiguration.h b/SmartDeviceLink/SDLStreamingMediaConfiguration.h index 37e3ef433..3e4f91849 100644 --- a/SmartDeviceLink/SDLStreamingMediaConfiguration.h +++ b/SmartDeviceLink/SDLStreamingMediaConfiguration.h @@ -85,11 +85,6 @@ typedef NS_ENUM(NSUInteger, SDLCarWindowRenderingType) { */ @property (assign, nonatomic) BOOL allowMultipleViewControllerOrientations; -/** - When YES, the StreamingMediaManager will send a black screen with "Video Backgrounded String". Defaults to YES. - */ -@property (assign, nonatomic) BOOL showVideoBackgroundDisplay; - /** Create an insecure video streaming configuration. No security managers will be provided and the encryption flag will be set to None. If you'd like custom video encoder settings, you can set the property manually. diff --git a/SmartDeviceLink/SDLStreamingMediaConfiguration.m b/SmartDeviceLink/SDLStreamingMediaConfiguration.m index b100ea361..41c7df822 100644 --- a/SmartDeviceLink/SDLStreamingMediaConfiguration.m +++ b/SmartDeviceLink/SDLStreamingMediaConfiguration.m @@ -37,7 +37,6 @@ - (instancetype)initWithSecurityManagers:(nullable NSArray @property (copy, nonatomic, readonly) NSString *appName; @property (assign, nonatomic) CV_NULLABLE CVPixelBufferRef backgroundingPixelBuffer; -@property (assign, nonatomic) BOOL showVideoBackgroundDisplay; @property (strong, nonatomic, nullable) CADisplayLink *displayLink; @property (assign, nonatomic) BOOL useDisplayLink; @@ -123,7 +122,7 @@ - (instancetype)initWithConnectionManager:(id)connecti _useDisplayLink = configuration.streamingMediaConfig.enableForcedFramerateSync; _screenSize = SDLDefaultScreenSize; _backgroundingPixelBuffer = NULL; - _showVideoBackgroundDisplay = configuration.streamingMediaConfig.showVideoBackgroundDisplay; + _showVideoBackgroundDisplay = YES; _preferredFormatIndex = 0; _preferredResolutionIndex = 0; From 3eb24df69b4d84aac2730b9d8793c396018cf1c8 Mon Sep 17 00:00:00 2001 From: Takamitsu Yoshii Date: Fri, 9 Aug 2019 11:14:05 +0900 Subject: [PATCH 15/22] update test --- .../DevAPISpecs/SDLStreamingMediaConfigurationSpec.m | 3 --- .../DevAPISpecs/SDLStreamingVideoLifecycleManagerSpec.m | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLStreamingMediaConfigurationSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLStreamingMediaConfigurationSpec.m index 096dac630..c5fc8949c 100644 --- a/SmartDeviceLinkTests/DevAPISpecs/SDLStreamingMediaConfigurationSpec.m +++ b/SmartDeviceLinkTests/DevAPISpecs/SDLStreamingMediaConfigurationSpec.m @@ -38,7 +38,6 @@ expect(testConfig.allowMultipleViewControllerOrientations).to(equal(NO)); expect(testConfig.dataSource).to(equal(testDataSource)); expect(testConfig.rootViewController).to(equal(testViewController)); - expect(testConfig.showVideoBackgroundDisplay).to(equal(YES)); }); }); @@ -54,7 +53,6 @@ expect(testConfig.allowMultipleViewControllerOrientations).to(equal(NO)); expect(testConfig.dataSource).to(beNil()); expect(testConfig.rootViewController).to(beNil()); - expect(testConfig.showVideoBackgroundDisplay).to(equal(YES)); }); }); @@ -74,7 +72,6 @@ expect(testConfig.allowMultipleViewControllerOrientations).to(equal(NO)); expect(testConfig.dataSource).to(beNil()); expect(testConfig.rootViewController).to(beNil()); - expect(testConfig.showVideoBackgroundDisplay).to(equal(YES)); }); }); }); diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLStreamingVideoLifecycleManagerSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLStreamingVideoLifecycleManagerSpec.m index 872f5eb72..31737c214 100644 --- a/SmartDeviceLinkTests/DevAPISpecs/SDLStreamingVideoLifecycleManagerSpec.m +++ b/SmartDeviceLinkTests/DevAPISpecs/SDLStreamingVideoLifecycleManagerSpec.m @@ -90,6 +90,7 @@ __block void (^sendNotificationForHMILevel)(SDLHMILevel hmiLevel, SDLVideoStream expect(@(CGSizeEqualToSize(streamingLifecycleManager.screenSize, CGSizeZero))).to(equal(@YES)); expect(@(streamingLifecycleManager.pixelBufferPool == NULL)).to(equal(@YES)); expect(@(streamingLifecycleManager.requestedEncryptionType)).to(equal(@(SDLStreamingEncryptionFlagNone))); + expect(@(streamingLifecycleManager.showVideoBackgroundDisplay)).to(equal(@YES)); expect(streamingLifecycleManager.currentAppState).to(equal(SDLAppStateActive)); expect(streamingLifecycleManager.currentVideoStreamState).to(equal(SDLVideoStreamManagerStateStopped)); expect(streamingLifecycleManager.videoFormat).to(beNil()); From cce63e5142ee5b542399fa761377f99693992773 Mon Sep 17 00:00:00 2001 From: Joel Fischer Date: Mon, 12 Aug 2019 14:21:26 -0400 Subject: [PATCH 16/22] Fixes #1380 * Add a lifecycle configuration option to disable/enable secondary transports --- SmartDeviceLink/SDLLifecycleConfiguration.h | 14 ++++++++++++ SmartDeviceLink/SDLLifecycleConfiguration.m | 2 ++ SmartDeviceLink/SDLLifecycleManager.m | 13 +++++------ .../DevAPISpecs/SDLLifecycleManagerSpec.m | 22 +++++++++++++++++++ 4 files changed, 44 insertions(+), 7 deletions(-) diff --git a/SmartDeviceLink/SDLLifecycleConfiguration.h b/SmartDeviceLink/SDLLifecycleConfiguration.h index 878895416..36ad3565e 100644 --- a/SmartDeviceLink/SDLLifecycleConfiguration.h +++ b/SmartDeviceLink/SDLLifecycleConfiguration.h @@ -19,6 +19,11 @@ NS_ASSUME_NONNULL_BEGIN +typedef NS_OPTIONS(NSUInteger, SDLSecondaryTransports) { + SDLSecondaryTransportsNone = 0, + SDLSecondaryTransportsTCP = 1 << 0 +}; + /** * Configuration options for SDLManager */ @@ -178,6 +183,15 @@ NS_ASSUME_NONNULL_BEGIN */ @property (strong, nonatomic) SDLVersion *minimumRPCVersion; +/** + Which transports are permitted to be used as secondary transports. A secondary transport is a transport that is connected as an alternate, higher bandwidth transport for situations when a low-bandwidth primary transport (such as Bluetooth) will restrict certain features (such as video streaming navigation). + + The only currently available secondary transport is TCP over WiFi. This is set to permit TCP by default, but it can be disabled by using SDLSecondaryTransportsNone instead. + + This will only affect apps that have high-bandwidth requirements; currently that is only video streaming navigation apps. + */ +@property (assign, nonatomic) SDLSecondaryTransports allowedSecondaryTransports; + @end NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLLifecycleConfiguration.m b/SmartDeviceLink/SDLLifecycleConfiguration.m index 5f163d8e6..09847120d 100644 --- a/SmartDeviceLink/SDLLifecycleConfiguration.m +++ b/SmartDeviceLink/SDLLifecycleConfiguration.m @@ -69,6 +69,7 @@ - (instancetype)initDefaultConfigurationWithAppName:(NSString *)appName fullAppI _voiceRecognitionCommandNames = nil; _minimumProtocolVersion = [SDLVersion versionWithString:@"1.0.0"]; _minimumRPCVersion = [SDLVersion versionWithString:@"1.0.0"]; + _allowedSecondaryTransports = SDLSecondaryTransportsTCP; _fullAppId = fullAppId; _appId = fullAppId != nil ? [self.class sdlex_shortAppIdFromFullAppId:fullAppId] : appId; @@ -156,6 +157,7 @@ - (id)copyWithZone:(nullable NSZone *)zone { newConfig->_voiceRecognitionCommandNames = _voiceRecognitionCommandNames; newConfig->_dayColorScheme = _dayColorScheme; newConfig->_nightColorScheme = _nightColorScheme; + newConfig->_allowedSecondaryTransports = _allowedSecondaryTransports; return newConfig; } diff --git a/SmartDeviceLink/SDLLifecycleManager.m b/SmartDeviceLink/SDLLifecycleManager.m index d59b1e4eb..c0bc8fbb6 100644 --- a/SmartDeviceLink/SDLLifecycleManager.m +++ b/SmartDeviceLink/SDLLifecycleManager.m @@ -224,19 +224,18 @@ - (void)didEnterStateStarted { // Start up the internal proxy object #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" + self.secondaryTransportManager = nil; if (self.configuration.lifecycleConfig.tcpDebugMode) { - // secondary transport manager is not used - self.secondaryTransportManager = nil; self.proxy = [SDLProxy tcpProxyWithListener:self.notificationDispatcher tcpIPAddress:self.configuration.lifecycleConfig.tcpDebugIPAddress tcpPort:@(self.configuration.lifecycleConfig.tcpDebugPort).stringValue secondaryTransportManager:self.secondaryTransportManager]; + } else if (self.configuration.lifecycleConfig.allowedSecondaryTransports == SDLSecondaryTransportsNone) { + self.proxy = [SDLProxy iapProxyWithListener:self.notificationDispatcher secondaryTransportManager:nil]; } else { - // we reuse our queue to run secondary transport manager's state machine - self.secondaryTransportManager = [[SDLSecondaryTransportManager alloc] initWithStreamingProtocolDelegate:self - serialQueue:self.lifecycleQueue]; - self.proxy = [SDLProxy iapProxyWithListener:self.notificationDispatcher - secondaryTransportManager:self.secondaryTransportManager]; + // We reuse our queue to run secondary transport manager's state machine + self.secondaryTransportManager = [[SDLSecondaryTransportManager alloc] initWithStreamingProtocolDelegate:self serialQueue:self.lifecycleQueue]; + self.proxy = [SDLProxy iapProxyWithListener:self.notificationDispatcher secondaryTransportManager:self.secondaryTransportManager]; } #pragma clang diagnostic pop } diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleManagerSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleManagerSpec.m index 6d2fd0c79..8e0d85c5b 100644 --- a/SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleManagerSpec.m +++ b/SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleManagerSpec.m @@ -668,6 +668,28 @@ @interface SDLLifecycleManager () }); }); +describe(@"configuring the lifecycle manager", ^{ + __block SDLLifecycleConfiguration *lifecycleConfig = nil; + __block SDLLifecycleManager *testManager = nil; + + beforeEach(^{ + lifecycleConfig = [SDLLifecycleConfiguration defaultConfigurationWithAppName:@"Test app" fullAppId:@"Test ID"]; + }); + + context(@"if no secondary transport is allowed", ^{ + beforeEach(^{ + lifecycleConfig.allowedSecondaryTransports = SDLSecondaryTransportsNone; + + SDLConfiguration *config = [[SDLConfiguration alloc] initWithLifecycle:lifecycleConfig lockScreen:nil logging:nil fileManager:nil]; + testManager = [[SDLLifecycleManager alloc] initWithConfiguration:config delegate:nil]; + }); + + it(@"should not create a secondary transport manager", ^{ + expect(testManager.secondaryTransportManager).to(beNil()); + }); + }); +}); + QuickSpecEnd #pragma clang diagnostic pop From b66221471c3f42523da567981fe630ed5263b1a7 Mon Sep 17 00:00:00 2001 From: Joel Fischer Date: Mon, 12 Aug 2019 16:45:37 -0400 Subject: [PATCH 17/22] Add Slider and Scrollable Message example apps --- Example Apps/Example ObjC/MenuManager.m | 16 ++++++++++++++++ Example Apps/Example Swift/MenuManager.swift | 16 ++++++++++++++++ Example Apps/Shared/AppConstants.h | 2 ++ Example Apps/Shared/AppConstants.m | 2 ++ 4 files changed, 36 insertions(+) diff --git a/Example Apps/Example ObjC/MenuManager.m b/Example Apps/Example ObjC/MenuManager.m index 41458da3b..44adcc223 100644 --- a/Example Apps/Example ObjC/MenuManager.m +++ b/Example Apps/Example ObjC/MenuManager.m @@ -23,6 +23,8 @@ @implementation MenuManager return @[[self sdlex_menuCellSpeakNameWithManager:manager], [self sdlex_menuCellGetAllVehicleDataWithManager:manager], [self sdlex_menuCellShowPerformInteractionWithManager:manager performManager:performManager], + [self sdlex_sliderMenuCellWithManager:manager], + [self sdlex_scrollableMessageMenuCellWithManager:manager], [self sdlex_menuCellRecordInCarMicrophoneAudioWithManager:manager], [self sdlex_menuCellDialNumberWithManager:manager], [self sdlex_menuCellChangeTemplateWithManager:manager], @@ -130,6 +132,20 @@ + (SDLMenuCell *)sdlex_menuCellWithSubmenuWithManager:(SDLManager *)manager { return [[SDLMenuCell alloc] initWithTitle:ACSubmenuMenuName icon:[SDLArtwork artworkWithImage:[[UIImage imageNamed:MenuBWIconImageName] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate] asImageFormat:SDLArtworkImageFormatPNG] subCells:[submenuItems copy]]; } ++ (SDLMenuCell *)sdlex_sliderMenuCellWithManager:(SDLManager *)manager { + return [[SDLMenuCell alloc] initWithTitle:ACSliderMenuName icon:nil voiceCommands:@[ACSliderMenuName] handler:^(SDLTriggerSource _Nonnull triggerSource) { + SDLSlider *sliderRPC = [[SDLSlider alloc] initWithNumTicks:3 position:1 sliderHeader:@"Select a letter" sliderFooters:@[@"A", @"B", @"C"] timeout:10000]; + [manager sendRequest:sliderRPC]; + }]; +} + ++ (SDLMenuCell *)sdlex_scrollableMessageMenuCellWithManager:(SDLManager *)manager { + return [[SDLMenuCell alloc] initWithTitle:ACScrollableMessageMenuName icon:nil voiceCommands:@[ACScrollableMessageMenuName] handler:^(SDLTriggerSource _Nonnull triggerSource) { + SDLScrollableMessage *messageRPC = [[SDLScrollableMessage alloc] initWithMessage:@"This is a scrollable message\nIt can contain many lines" timeout:10000 softButtons:nil]; + [manager sendRequest:messageRPC]; + }]; +} + #pragma mark - Voice Commands + (SDLVoiceCommand *)sdlex_voiceCommandStartWithManager:(SDLManager *)manager { diff --git a/Example Apps/Example Swift/MenuManager.swift b/Example Apps/Example Swift/MenuManager.swift index c5171510d..7cd5dd9de 100644 --- a/Example Apps/Example Swift/MenuManager.swift +++ b/Example Apps/Example Swift/MenuManager.swift @@ -19,6 +19,8 @@ class MenuManager: NSObject { return [menuCellSpeakName(with: manager), menuCellGetAllVehicleData(with: manager), menuCellShowPerformInteraction(with: manager, choiceSetManager: choiceSetManager), + sliderMenuCell(with: manager), + scrollableMessageMenuCell(with: manager), menuCellRecordInCarMicrophoneAudio(with: manager), menuCellDialNumber(with: manager), menuCellChangeTemplate(with: manager), @@ -174,6 +176,20 @@ private extension MenuManager { return SDLMenuCell(title: ACSubmenuMenuName, icon: SDLArtwork(image: #imageLiteral(resourceName: "choice_set").withRenderingMode(.alwaysTemplate), persistent: true, as: .PNG), subCells: submenuItems) } + + private class func sliderMenuCell(with manager: SDLManager) -> SDLMenuCell { + return SDLMenuCell(title: ACSliderMenuName, icon: nil, voiceCommands: [ACSliderMenuName], handler: { _ in + let slider = SDLSlider(numTicks: 3, position: 1, sliderHeader: "Select a letter", sliderFooters: ["A", "B", "C"], timeout: 10000) + manager.send(slider) + }) + } + + private class func scrollableMessageMenuCell(with manager: SDLManager) -> SDLMenuCell { + return SDLMenuCell(title: ACScrollableMessageMenuName, icon: nil, voiceCommands: [ACScrollableMessageMenuName], handler: { _ in + let scrollableMessage = SDLScrollableMessage(message: "This is a scrollable message\nIt can contain many lines", timeout: 10000, softButtons: nil) + manager.send(scrollableMessage) + }) + } } // MARK: - Menu Voice Commands diff --git a/Example Apps/Shared/AppConstants.h b/Example Apps/Shared/AppConstants.h index 5c7b373e0..9e7ec3d28 100644 --- a/Example Apps/Shared/AppConstants.h +++ b/Example Apps/Shared/AppConstants.h @@ -79,6 +79,8 @@ extern NSString * const ACDialPhoneNumberMenuName; extern NSString * const ACSubmenuMenuName; extern NSString * const ACSubmenuItemMenuName; extern NSString * const ACSubmenuTemplateMenuName; +extern NSString * const ACSliderMenuName; +extern NSString * const ACScrollableMessageMenuName; extern NSString * const ACAccelerationPedalPositionMenuName; extern NSString * const ACAirbagStatusMenuName; diff --git a/Example Apps/Shared/AppConstants.m b/Example Apps/Shared/AppConstants.m index d6edd60c1..1760ecb42 100644 --- a/Example Apps/Shared/AppConstants.m +++ b/Example Apps/Shared/AppConstants.m @@ -76,6 +76,8 @@ NSString * const ACSubmenuMenuName = @"Submenu"; NSString * const ACSubmenuItemMenuName = @"Item"; NSString * const ACSubmenuTemplateMenuName = @"Change Template"; +NSString * const ACSliderMenuName = @"Show Slider"; +NSString * const ACScrollableMessageMenuName = @"Show Scrollable Message"; NSString * const ACAccelerationPedalPositionMenuName = @"Acceleration Pedal Position"; NSString * const ACAirbagStatusMenuName = @"Airbag Status"; From 1d825598edd4799da854a23721e8e8d904064183 Mon Sep 17 00:00:00 2001 From: justingluck93 <47197545+justingluck93@users.noreply.github.com> Date: Tue, 13 Aug 2019 09:45:14 -0400 Subject: [PATCH 18/22] Update SmartDeviceLink/SDLLockScreenConfiguration.h Co-Authored-By: Joel Fischer --- SmartDeviceLink/SDLLockScreenConfiguration.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SmartDeviceLink/SDLLockScreenConfiguration.h b/SmartDeviceLink/SDLLockScreenConfiguration.h index 91e4bfabf..ba0bd2d5a 100644 --- a/SmartDeviceLink/SDLLockScreenConfiguration.h +++ b/SmartDeviceLink/SDLLockScreenConfiguration.h @@ -30,7 +30,7 @@ NS_ASSUME_NONNULL_BEGIN @property (assign, nonatomic) BOOL enableDismissGesture; /** -* If YES, then the lockscreen will show the vehicle logo. If NO, then the lockscreen will not show the vehicle logo. +* If YES, then the lockscreen will show the vehicle's logo if the vehicle has made it available. If NO, then the lockscreen will not show the vehicle logo. Defaults to YES. */ @property (assign, nonatomic) BOOL showDeviceLogo; From ead52e30500855ddcba0db43ec6e20c46ad6adbe Mon Sep 17 00:00:00 2001 From: justingluck93 <47197545+justingluck93@users.noreply.github.com> Date: Tue, 13 Aug 2019 09:45:24 -0400 Subject: [PATCH 19/22] Update SmartDeviceLinkTests/DevAPISpecs/SDLLockScreenManagerSpec.m Co-Authored-By: Joel Fischer --- SmartDeviceLinkTests/DevAPISpecs/SDLLockScreenManagerSpec.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLLockScreenManagerSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLLockScreenManagerSpec.m index 912fe9161..05f88b769 100644 --- a/SmartDeviceLinkTests/DevAPISpecs/SDLLockScreenManagerSpec.m +++ b/SmartDeviceLinkTests/DevAPISpecs/SDLLockScreenManagerSpec.m @@ -234,7 +234,7 @@ @interface SDLLockScreenManager () }); }); - context(@"with showDeiveLogo as false", ^{ + context(@"with showDeviceLogo as false", ^{ beforeEach(^{ SDLLockScreenConfiguration *config = [SDLLockScreenConfiguration enabledConfiguration]; config.showDeviceLogo = NO; From 3a4986a2f35ec3a9071cf3196d2849309666ef4d Mon Sep 17 00:00:00 2001 From: Justin Gluck Date: Tue, 13 Aug 2019 13:19:48 -0400 Subject: [PATCH 20/22] fixed description --- Example Apps/Example ObjC/ProxyManager.m | 4 +++- SmartDeviceLinkTests/DevAPISpecs/SDLLockScreenManagerSpec.m | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Example Apps/Example ObjC/ProxyManager.m b/Example Apps/Example ObjC/ProxyManager.m index 980c5b137..ad2472b3f 100644 --- a/Example Apps/Example ObjC/ProxyManager.m +++ b/Example Apps/Example ObjC/ProxyManager.m @@ -114,7 +114,9 @@ - (void)sdlex_setupConfigurationWithLifecycleConfiguration:(SDLLifecycleConfigur [self sdlex_startManager]; return; } - SDLConfiguration *config = [SDLConfiguration configurationWithLifecycle:lifecycleConfiguration lockScreen:[SDLLockScreenConfiguration enabledConfigurationWithAppIcon:[UIImage imageNamed:ExampleAppLogoName] backgroundColor:nil] logging:[self.class sdlex_logConfiguration] fileManager:[SDLFileManagerConfiguration defaultConfiguration]]; + SDLLockScreenConfiguration *lockScreen = [SDLLockScreenConfiguration enabledConfigurationWithAppIcon:[UIImage imageNamed:ExampleAppLogoName] backgroundColor:nil]; + + SDLConfiguration *config = [SDLConfiguration configurationWithLifecycle:lifecycleConfiguration lockScreen:lockScreen logging:[self.class sdlex_logConfiguration] fileManager:[SDLFileManagerConfiguration defaultConfiguration]]; self.sdlManager = [[SDLManager alloc] initWithConfiguration:config delegate:self]; [self sdlex_startManager]; } diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLLockScreenManagerSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLLockScreenManagerSpec.m index 05f88b769..5455aae8a 100644 --- a/SmartDeviceLinkTests/DevAPISpecs/SDLLockScreenManagerSpec.m +++ b/SmartDeviceLinkTests/DevAPISpecs/SDLLockScreenManagerSpec.m @@ -234,7 +234,7 @@ @interface SDLLockScreenManager () }); }); - context(@"with showDeviceLogo as false", ^{ + fcontext(@"with showDeviceLogo as NO", ^{ beforeEach(^{ SDLLockScreenConfiguration *config = [SDLLockScreenConfiguration enabledConfiguration]; config.showDeviceLogo = NO; @@ -251,7 +251,7 @@ @interface SDLLockScreenManager () [[NSNotificationCenter defaultCenter] postNotificationName:SDLDidReceiveLockScreenIcon object:nil userInfo:@{ SDLNotificationUserInfoObject: testIcon }]; }); - it(@"should have a vehicle icon if showDeviceLogo is set to true", ^{ + it(@"should not have a vehicle icon if showDeviceLogo is set to NO", ^{ expect(((SDLLockScreenViewController *)testManager.lockScreenViewController).vehicleIcon).to(beNil()); }); }); From f6967a3b14fee750af1116d7efee0705cf31f416 Mon Sep 17 00:00:00 2001 From: Justin Gluck Date: Tue, 13 Aug 2019 13:20:30 -0400 Subject: [PATCH 21/22] undo commit --- Example Apps/Example ObjC/ProxyManager.m | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Example Apps/Example ObjC/ProxyManager.m b/Example Apps/Example ObjC/ProxyManager.m index ad2472b3f..980c5b137 100644 --- a/Example Apps/Example ObjC/ProxyManager.m +++ b/Example Apps/Example ObjC/ProxyManager.m @@ -114,9 +114,7 @@ - (void)sdlex_setupConfigurationWithLifecycleConfiguration:(SDLLifecycleConfigur [self sdlex_startManager]; return; } - SDLLockScreenConfiguration *lockScreen = [SDLLockScreenConfiguration enabledConfigurationWithAppIcon:[UIImage imageNamed:ExampleAppLogoName] backgroundColor:nil]; - - SDLConfiguration *config = [SDLConfiguration configurationWithLifecycle:lifecycleConfiguration lockScreen:lockScreen logging:[self.class sdlex_logConfiguration] fileManager:[SDLFileManagerConfiguration defaultConfiguration]]; + SDLConfiguration *config = [SDLConfiguration configurationWithLifecycle:lifecycleConfiguration lockScreen:[SDLLockScreenConfiguration enabledConfigurationWithAppIcon:[UIImage imageNamed:ExampleAppLogoName] backgroundColor:nil] logging:[self.class sdlex_logConfiguration] fileManager:[SDLFileManagerConfiguration defaultConfiguration]]; self.sdlManager = [[SDLManager alloc] initWithConfiguration:config delegate:self]; [self sdlex_startManager]; } From 763174ce11cda3c26b21d434b58d5a0f1fd54e86 Mon Sep 17 00:00:00 2001 From: justingluck93 <47197545+justingluck93@users.noreply.github.com> Date: Tue, 13 Aug 2019 14:49:51 -0400 Subject: [PATCH 22/22] Update SmartDeviceLinkTests/DevAPISpecs/SDLLockScreenManagerSpec.m Co-Authored-By: Joel Fischer --- SmartDeviceLinkTests/DevAPISpecs/SDLLockScreenManagerSpec.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLLockScreenManagerSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLLockScreenManagerSpec.m index 5455aae8a..4f808bd3a 100644 --- a/SmartDeviceLinkTests/DevAPISpecs/SDLLockScreenManagerSpec.m +++ b/SmartDeviceLinkTests/DevAPISpecs/SDLLockScreenManagerSpec.m @@ -234,7 +234,7 @@ @interface SDLLockScreenManager () }); }); - fcontext(@"with showDeviceLogo as NO", ^{ + context(@"with showDeviceLogo as NO", ^{ beforeEach(^{ SDLLockScreenConfiguration *config = [SDLLockScreenConfiguration enabledConfiguration]; config.showDeviceLogo = NO;