Fix jank: Don't write lockout deadline if not needed
In the longterm, we should move these synchronous writes off the main thread, but in the short term, avoiding an unnecessary write is good enough for the main case. Bug: 24471234 Change-Id: Id996ff29e61410cd077760a06d7868a413ae88da
This commit is contained in:
@@ -1074,7 +1074,7 @@ public class LockPatternUtils {
|
||||
long deadline = getLong(LOCKOUT_ATTEMPT_DEADLINE, 0L, userId);
|
||||
final long timeoutMs = getLong(LOCKOUT_ATTEMPT_TIMEOUT_MS, 0L, userId);
|
||||
final long now = SystemClock.elapsedRealtime();
|
||||
if (deadline < now) {
|
||||
if (deadline < now && deadline != 0) {
|
||||
// timeout expired
|
||||
setLong(LOCKOUT_ATTEMPT_DEADLINE, 0, userId);
|
||||
setLong(LOCKOUT_ATTEMPT_TIMEOUT_MS, 0, userId);
|
||||
|
||||
Reference in New Issue
Block a user