summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Fischer <joeljfischer@gmail.com>2017-12-18 11:31:43 -0500
committerJoel Fischer <joeljfischer@gmail.com>2017-12-18 11:31:43 -0500
commitb1fcd4fbb51e19f1f7f4fc458016415c6d41b95c (patch)
tree03407b2d0e1e90afdc92f82e700a3ce030d6b9f8
parent2a17cd16d0a057999d650babb5d5b5b211a88c02 (diff)
downloadsdl_ios-b1fcd4fbb51e19f1f7f4fc458016415c6d41b95c.tar.gz
Fix lock screen presentation in CarWindow
-rwxr-xr-xSmartDeviceLink/SDLCarWindow.m29
1 files changed, 19 insertions, 10 deletions
diff --git a/SmartDeviceLink/SDLCarWindow.m b/SmartDeviceLink/SDLCarWindow.m
index 3af046876..3d995f0e0 100755
--- a/SmartDeviceLink/SDLCarWindow.m
+++ b/SmartDeviceLink/SDLCarWindow.m
@@ -30,7 +30,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (weak, nonatomic, nullable) SDLStreamingMediaLifecycleManager *streamManager;
-@property (assign, nonatomic, getter=isLockScreenMoving) BOOL lockScreenMoving;
+@property (assign, nonatomic, getter=isLockScreenPresenting) BOOL lockScreenPresenting;
+@property (assign, nonatomic, getter=isLockScreenDismissing) BOOL lockScreenBeingDismissed;
@end
@@ -46,11 +47,11 @@ NS_ASSUME_NONNULL_BEGIN
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(sdl_didReceiveVideoStreamStarted:) name:SDLVideoStreamDidStartNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(sdl_didReceiveVideoStreamStopped:) name:SDLVideoStreamDidStopNotification object:nil];
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(sdl_lockScreenMoving:) name:SDLLockScreenManagerWillPresentLockScreenViewController object:nil];
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(sdl_lockScreenMoving:) name:SDLLockScreenManagerWillDismissLockScreenViewController object:nil];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(sdl_willPresentLockScreenViewController:) name:SDLLockScreenManagerWillPresentLockScreenViewController object:nil];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(sdl_willDismissLockScreenViewController:) name:SDLLockScreenManagerWillDismissLockScreenViewController object:nil];
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(sdl_lockScreenStoppedMoving:) name:SDLLockScreenManagerDidPresentLockScreenViewController object:nil];
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(sdl_lockScreenStoppedMoving:) name:SDLLockScreenManagerDidDismissLockScreenViewController object:nil];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(sdl_willPresentLockScreenViewController:) name:SDLLockScreenManagerDidPresentLockScreenViewController object:nil];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(sdl_willDismissLockScreenViewController:) name:SDLLockScreenManagerDidDismissLockScreenViewController object:nil];
return self;
}
@@ -60,7 +61,7 @@ NS_ASSUME_NONNULL_BEGIN
return;
}
- if (self.isLockScreenMoving) {
+ if (self.isLockScreenPresenting || self.isLockScreenDismissing) {
SDLLogD(@"Paused CarWindow, lock screen moving");
return;
}
@@ -79,12 +80,20 @@ NS_ASSUME_NONNULL_BEGIN
}
#pragma mark - SDLNavigationLockScreenManager Notifications
-- (void)sdl_lockScreenMoving:(NSNotification *)notification {
- self.lockScreenMoving = YES;
+- (void)sdl_willPresentLockScreenViewController:(NSNotification *)notification {
+ self.lockScreenPresenting = YES;
}
-- (void)sdl_lockScreenStoppedMoving:(NSNotification *)notification {
- self.lockScreenMoving = NO;
+- (void)sdl_didPresentLockScreenViewController:(NSNotification *)notification {
+ self.lockScreenPresenting = NO;
+}
+
+- (void)sdl_willDismissLockScreenViewController:(NSNotification *)notification {
+ self.lockScreenBeingDismissed = YES;
+}
+
+- (void)sdl_didDismissLockScreenViewController:(NSNotification *)notification {
+ self.lockScreenBeingDismissed = NO;
}
#pragma mark - SDLNavigationLifecycleManager Notifications