From 2b210c7557c2f9b9750e8f2318418f6d2ced54dd Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Fri, 6 Apr 2018 12:12:49 -0400 Subject: [PATCH] Fix screen lock edge cases. --- Signal/src/util/OWSScreenLockUI.m | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Signal/src/util/OWSScreenLockUI.m b/Signal/src/util/OWSScreenLockUI.m index 9692e9a6f..2d5d3232a 100644 --- a/Signal/src/util/OWSScreenLockUI.m +++ b/Signal/src/util/OWSScreenLockUI.m @@ -31,10 +31,22 @@ NS_ASSUME_NONNULL_BEGIN // UI is dismissing. @property (nonatomic) BOOL shouldClearAuthUIWhenActive; -@property (nonatomic, nullable) NSTimer *inactiveTimer; +// Indicates whether or not the user is currently locked out of +// the app. Only applies if OWSScreenLock.isScreenLockEnabled. +// +// * The user is locked out out by default on app launch. +// * The user is also locked out if they spend more than +// "timeout" seconds outside the app. When the user leaves +// the app, a "countdown" begins. +@property (nonatomic) BOOL isScreenLockUnlocked; @property (nonatomic, nullable) NSDate *screenLockCountdownDate; -@property (nonatomic) BOOL isScreenLockUnlocked; + +// We normally start the "countdown" when the app enters the background, +// But we also want to start the "countdown" if the app is inactive for +// more than N seconds. +@property (nonatomic, nullable) NSTimer *inactiveTimer; + @end