From 930d89242d9e838b157447737063a110426d52bd Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Tue, 27 Mar 2018 16:16:35 -0400 Subject: [PATCH] Clean up ahead of PR. --- Signal/src/util/OWSScreenLockUI.m | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/Signal/src/util/OWSScreenLockUI.m b/Signal/src/util/OWSScreenLockUI.m index efb94fc4b0..eec61e9723 100644 --- a/Signal/src/util/OWSScreenLockUI.m +++ b/Signal/src/util/OWSScreenLockUI.m @@ -27,8 +27,6 @@ NS_ASSUME_NONNULL_BEGIN // UI is dismissing. @property (nonatomic) BOOL shouldClearAuthUIWhenActive; -@property (nonatomic, nullable) NSTimer *screenLockUITimer; - @property (nonatomic, nullable) NSDate *appEnteredBackgroundDate; @property (nonatomic, nullable) NSDate *appEnteredForegroundDate; @property (nonatomic, nullable) NSDate *lastUnlockAttemptDate; @@ -160,9 +158,6 @@ NS_ASSUME_NONNULL_BEGIN } [self updateScreenBlockingWindow:shouldShowBlockWindow shouldHaveScreenLock:shouldHaveScreenLock]; - [self.screenLockUITimer invalidate]; - self.screenLockUITimer = nil; - if (shouldHaveScreenLock && !self.didLastUnlockAttemptFail) { [self tryToPresentScreenLockUI]; } @@ -172,9 +167,6 @@ NS_ASSUME_NONNULL_BEGIN { OWSAssertIsOnMainThread(); - [self.screenLockUITimer invalidate]; - self.screenLockUITimer = nil; - // If we no longer want to present the screen lock UI, abort. if (!self.shouldHaveScreenLock) { return; @@ -334,6 +326,13 @@ NS_ASSUME_NONNULL_BEGIN [self updateScreenBlockingWindow:YES shouldHaveScreenLock:NO]; } +// The "screen blocking" window has three possible states: +// +// * "Just a logo". Used when app is launching and in app switcher. Must match the "Launch Screen" +// storyboard pixel-for-pixel. +// * "Screen Lock, local auth UI presented". Move the Signal logo so that it is visible. +// * "Screen Lock, local auth UI not presented". Move the Signal logo so that it is visible, +// show "unlock" button. - (void)updateScreenBlockingWindow:(BOOL)shouldShowBlockWindow shouldHaveScreenLock:(BOOL)shouldHaveScreenLock { OWSAssertIsOnMainThread(); @@ -429,6 +428,8 @@ NS_ASSUME_NONNULL_BEGIN - (void)clearAuthUIWhenActive { + // For continuity, continue to present blocking screen in "screen lock" mode while + // dismissing the "local auth UI". if (self.appIsInactive) { self.shouldClearAuthUIWhenActive = YES; } else { @@ -456,8 +457,6 @@ NS_ASSUME_NONNULL_BEGIN // Clear the "delay Screen Lock UI" state; we don't want any // delays when presenting the "unlock screen lock UI" after // returning from background. - [self.screenLockUITimer invalidate]; - self.screenLockUITimer = nil; self.lastUnlockAttemptDate = nil; self.lastUnlockSuccessDate = nil;