Loading packages/SystemUI/src/com/android/keyguard/KeyguardPasswordView.java +1 −1 Original line number Diff line number Diff line Loading @@ -104,7 +104,7 @@ public class KeyguardPasswordView extends KeyguardAbsKeyInputView { case PROMPT_REASON_DEVICE_ADMIN: return R.string.kg_prompt_reason_device_admin; case PROMPT_REASON_USER_REQUEST: return R.string.kg_prompt_reason_user_request; return R.string.kg_prompt_after_user_lockdown_password; case PROMPT_REASON_PREPARE_FOR_UPDATE: return R.string.kg_prompt_reason_timeout_password; case PROMPT_REASON_NON_STRONG_BIOMETRIC_TIMEOUT: Loading packages/SystemUI/src/com/android/keyguard/KeyguardPatternViewController.java +1 −1 Original line number Diff line number Diff line Loading @@ -311,7 +311,7 @@ public class KeyguardPatternViewController resId = R.string.kg_prompt_reason_device_admin; break; case PROMPT_REASON_USER_REQUEST: resId = R.string.kg_prompt_reason_user_request; resId = R.string.kg_prompt_after_user_lockdown_pattern; break; case PROMPT_REASON_PREPARE_FOR_UPDATE: resId = R.string.kg_prompt_reason_timeout_pattern; Loading packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputView.java +1 −1 Original line number Diff line number Diff line Loading @@ -118,7 +118,7 @@ public abstract class KeyguardPinBasedInputView extends KeyguardAbsKeyInputView case PROMPT_REASON_DEVICE_ADMIN: return R.string.kg_prompt_reason_device_admin; case PROMPT_REASON_USER_REQUEST: return R.string.kg_prompt_reason_user_request; return R.string.kg_prompt_after_user_lockdown_pin; case PROMPT_REASON_PREPARE_FOR_UPDATE: return R.string.kg_prompt_reason_timeout_pin; case PROMPT_REASON_NON_STRONG_BIOMETRIC_TIMEOUT: Loading packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +3 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STR import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_LOCKOUT; import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_NON_STRONG_BIOMETRICS_TIMEOUT; import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_TIMEOUT; import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN; import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_FOR_UNATTENDED_UPDATE; import static com.android.systemui.DejankUtils.whitelistIpcs; import static com.android.systemui.keyguard.ui.viewmodel.LockscreenToDreamingTransitionViewModel.DREAMING_ANIMATION_DURATION_MS; Loading Loading @@ -848,6 +849,8 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, return KeyguardSecurityView.PROMPT_REASON_RESTART; } else if (any && (strongAuth & STRONG_AUTH_REQUIRED_AFTER_TIMEOUT) != 0) { return KeyguardSecurityView.PROMPT_REASON_TIMEOUT; } else if (any && (strongAuth & STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN) != 0) { return KeyguardSecurityView.PROMPT_REASON_USER_REQUEST; } else if ((strongAuth & STRONG_AUTH_REQUIRED_AFTER_DPM_LOCK_NOW) != 0) { return KeyguardSecurityView.PROMPT_REASON_DEVICE_ADMIN; } else if (trustAgentsEnabled Loading packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardViewMediatorTest.java +37 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import static android.view.WindowManagerPolicyConstants.OFF_BECAUSE_OF_USER; import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_DPM_LOCK_NOW; import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_NON_STRONG_BIOMETRICS_TIMEOUT; import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; Loading Loading @@ -355,6 +356,42 @@ public class KeyguardViewMediatorTest extends SysuiTestCase { mViewMediator.mViewMediatorCallback.getBouncerPromptReason()); } @Test public void testBouncerPrompt_afterUserLockDown() { // GIVEN biometrics enrolled when(mUpdateMonitor.isUnlockingWithBiometricsPossible(anyInt())).thenReturn(true); // WHEN user has locked down the device KeyguardUpdateMonitor.StrongAuthTracker strongAuthTracker = mock(KeyguardUpdateMonitor.StrongAuthTracker.class); when(mUpdateMonitor.getStrongAuthTracker()).thenReturn(strongAuthTracker); when(strongAuthTracker.hasUserAuthenticatedSinceBoot()).thenReturn(true); when(strongAuthTracker.getStrongAuthForUser(anyInt())) .thenReturn(STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN); // THEN the bouncer prompt reason should return PROMPT_REASON_USER_REQUEST assertEquals(KeyguardSecurityView.PROMPT_REASON_USER_REQUEST, mViewMediator.mViewMediatorCallback.getBouncerPromptReason()); } @Test public void testBouncerPrompt_afterUserLockDown_noBiometricsEnrolled() { // GIVEN biometrics not enrolled when(mUpdateMonitor.isUnlockingWithBiometricsPossible(anyInt())).thenReturn(false); // WHEN user has locked down the device KeyguardUpdateMonitor.StrongAuthTracker strongAuthTracker = mock(KeyguardUpdateMonitor.StrongAuthTracker.class); when(mUpdateMonitor.getStrongAuthTracker()).thenReturn(strongAuthTracker); when(strongAuthTracker.hasUserAuthenticatedSinceBoot()).thenReturn(true); when(strongAuthTracker.getStrongAuthForUser(anyInt())) .thenReturn(STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN); // THEN the bouncer prompt reason should return the default prompt assertEquals(KeyguardSecurityView.PROMPT_REASON_NONE, mViewMediator.mViewMediatorCallback.getBouncerPromptReason()); } @Test public void testBouncerPrompt_nonStrongIdleTimeout() { // GIVEN trust agents enabled and biometrics are enrolled Loading Loading
packages/SystemUI/src/com/android/keyguard/KeyguardPasswordView.java +1 −1 Original line number Diff line number Diff line Loading @@ -104,7 +104,7 @@ public class KeyguardPasswordView extends KeyguardAbsKeyInputView { case PROMPT_REASON_DEVICE_ADMIN: return R.string.kg_prompt_reason_device_admin; case PROMPT_REASON_USER_REQUEST: return R.string.kg_prompt_reason_user_request; return R.string.kg_prompt_after_user_lockdown_password; case PROMPT_REASON_PREPARE_FOR_UPDATE: return R.string.kg_prompt_reason_timeout_password; case PROMPT_REASON_NON_STRONG_BIOMETRIC_TIMEOUT: Loading
packages/SystemUI/src/com/android/keyguard/KeyguardPatternViewController.java +1 −1 Original line number Diff line number Diff line Loading @@ -311,7 +311,7 @@ public class KeyguardPatternViewController resId = R.string.kg_prompt_reason_device_admin; break; case PROMPT_REASON_USER_REQUEST: resId = R.string.kg_prompt_reason_user_request; resId = R.string.kg_prompt_after_user_lockdown_pattern; break; case PROMPT_REASON_PREPARE_FOR_UPDATE: resId = R.string.kg_prompt_reason_timeout_pattern; Loading
packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputView.java +1 −1 Original line number Diff line number Diff line Loading @@ -118,7 +118,7 @@ public abstract class KeyguardPinBasedInputView extends KeyguardAbsKeyInputView case PROMPT_REASON_DEVICE_ADMIN: return R.string.kg_prompt_reason_device_admin; case PROMPT_REASON_USER_REQUEST: return R.string.kg_prompt_reason_user_request; return R.string.kg_prompt_after_user_lockdown_pin; case PROMPT_REASON_PREPARE_FOR_UPDATE: return R.string.kg_prompt_reason_timeout_pin; case PROMPT_REASON_NON_STRONG_BIOMETRIC_TIMEOUT: Loading
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +3 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STR import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_LOCKOUT; import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_NON_STRONG_BIOMETRICS_TIMEOUT; import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_TIMEOUT; import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN; import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_FOR_UNATTENDED_UPDATE; import static com.android.systemui.DejankUtils.whitelistIpcs; import static com.android.systemui.keyguard.ui.viewmodel.LockscreenToDreamingTransitionViewModel.DREAMING_ANIMATION_DURATION_MS; Loading Loading @@ -848,6 +849,8 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, return KeyguardSecurityView.PROMPT_REASON_RESTART; } else if (any && (strongAuth & STRONG_AUTH_REQUIRED_AFTER_TIMEOUT) != 0) { return KeyguardSecurityView.PROMPT_REASON_TIMEOUT; } else if (any && (strongAuth & STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN) != 0) { return KeyguardSecurityView.PROMPT_REASON_USER_REQUEST; } else if ((strongAuth & STRONG_AUTH_REQUIRED_AFTER_DPM_LOCK_NOW) != 0) { return KeyguardSecurityView.PROMPT_REASON_DEVICE_ADMIN; } else if (trustAgentsEnabled Loading
packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardViewMediatorTest.java +37 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import static android.view.WindowManagerPolicyConstants.OFF_BECAUSE_OF_USER; import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_DPM_LOCK_NOW; import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_NON_STRONG_BIOMETRICS_TIMEOUT; import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; Loading Loading @@ -355,6 +356,42 @@ public class KeyguardViewMediatorTest extends SysuiTestCase { mViewMediator.mViewMediatorCallback.getBouncerPromptReason()); } @Test public void testBouncerPrompt_afterUserLockDown() { // GIVEN biometrics enrolled when(mUpdateMonitor.isUnlockingWithBiometricsPossible(anyInt())).thenReturn(true); // WHEN user has locked down the device KeyguardUpdateMonitor.StrongAuthTracker strongAuthTracker = mock(KeyguardUpdateMonitor.StrongAuthTracker.class); when(mUpdateMonitor.getStrongAuthTracker()).thenReturn(strongAuthTracker); when(strongAuthTracker.hasUserAuthenticatedSinceBoot()).thenReturn(true); when(strongAuthTracker.getStrongAuthForUser(anyInt())) .thenReturn(STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN); // THEN the bouncer prompt reason should return PROMPT_REASON_USER_REQUEST assertEquals(KeyguardSecurityView.PROMPT_REASON_USER_REQUEST, mViewMediator.mViewMediatorCallback.getBouncerPromptReason()); } @Test public void testBouncerPrompt_afterUserLockDown_noBiometricsEnrolled() { // GIVEN biometrics not enrolled when(mUpdateMonitor.isUnlockingWithBiometricsPossible(anyInt())).thenReturn(false); // WHEN user has locked down the device KeyguardUpdateMonitor.StrongAuthTracker strongAuthTracker = mock(KeyguardUpdateMonitor.StrongAuthTracker.class); when(mUpdateMonitor.getStrongAuthTracker()).thenReturn(strongAuthTracker); when(strongAuthTracker.hasUserAuthenticatedSinceBoot()).thenReturn(true); when(strongAuthTracker.getStrongAuthForUser(anyInt())) .thenReturn(STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN); // THEN the bouncer prompt reason should return the default prompt assertEquals(KeyguardSecurityView.PROMPT_REASON_NONE, mViewMediator.mViewMediatorCallback.getBouncerPromptReason()); } @Test public void testBouncerPrompt_nonStrongIdleTimeout() { // GIVEN trust agents enabled and biometrics are enrolled Loading