Set lockout in onResume.
If bouncer is locked out, make sure that we check in onresume for all security types. Fixes: 275079518 Test: lock out in pin and pattern. Test: sim pin and sim puk are good to go Change-Id: I9fce3bb8087cd3b47ed57ae0f114b823de980356
This commit is contained in:
@@ -107,14 +107,7 @@ public abstract class KeyguardAbsKeyInputViewController<T extends KeyguardAbsKey
|
||||
// start fresh
|
||||
mDismissing = false;
|
||||
mView.resetPasswordText(false /* animate */, false /* announce */);
|
||||
// if the user is currently locked out, enforce it.
|
||||
long deadline = mLockPatternUtils.getLockoutAttemptDeadline(
|
||||
KeyguardUpdateMonitor.getCurrentUser());
|
||||
if (shouldLockout(deadline)) {
|
||||
handleAttemptLockout(deadline);
|
||||
} else {
|
||||
resetState();
|
||||
}
|
||||
resetState();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -277,6 +270,12 @@ public abstract class KeyguardAbsKeyInputViewController<T extends KeyguardAbsKey
|
||||
@Override
|
||||
public void onResume(int reason) {
|
||||
mResumed = true;
|
||||
// if the user is currently locked out, enforce it.
|
||||
long deadline = mLockPatternUtils.getLockoutAttemptDeadline(
|
||||
KeyguardUpdateMonitor.getCurrentUser());
|
||||
if (shouldLockout(deadline)) {
|
||||
handleAttemptLockout(deadline);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -260,13 +260,17 @@ public class KeyguardPatternViewController
|
||||
mLockPatternView.setEnabled(true);
|
||||
mLockPatternView.clearPattern();
|
||||
|
||||
displayDefaultSecurityMessage();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume(int reason) {
|
||||
super.onResume(reason);
|
||||
// if the user is currently locked out, enforce it.
|
||||
long deadline = mLockPatternUtils.getLockoutAttemptDeadline(
|
||||
KeyguardUpdateMonitor.getCurrentUser());
|
||||
if (deadline != 0) {
|
||||
handleAttemptLockout(deadline);
|
||||
} else {
|
||||
displayDefaultSecurityMessage();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package com.android.keyguard;
|
||||
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.ArgumentMatchers.anyInt;
|
||||
import static org.mockito.ArgumentMatchers.eq;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.never;
|
||||
@@ -157,4 +158,10 @@ public class KeyguardAbsKeyInputViewControllerTest extends SysuiTestCase {
|
||||
mKeyguardAbsKeyInputViewController.reset();
|
||||
verify(mKeyguardMessageAreaController).setMessage("", false);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testResume() {
|
||||
mKeyguardAbsKeyInputViewController.onResume(KeyguardSecurityView.VIEW_REVEALED);
|
||||
verify(mLockPatternUtils).getLockoutAttemptDeadline(anyInt());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.mockito.ArgumentMatchers.anyBoolean
|
||||
import org.mockito.ArgumentMatchers.anyInt
|
||||
import org.mockito.ArgumentMatchers.anyString
|
||||
import org.mockito.Mock
|
||||
import org.mockito.Mockito.never
|
||||
@@ -119,4 +120,10 @@ class KeyguardPatternViewControllerTest : SysuiTestCase() {
|
||||
mKeyguardPatternViewController.startAppearAnimation()
|
||||
verify(mKeyguardMessageAreaController, never()).setMessage(anyString(), anyBoolean())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun resume() {
|
||||
mKeyguardPatternViewController.onResume(KeyguardSecurityView.VIEW_REVEALED)
|
||||
verify(mLockPatternUtils).getLockoutAttemptDeadline(anyInt())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user