Loading packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +3 −2 Original line number Diff line number Diff line Loading @@ -2589,7 +2589,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab } final boolean statusBarShadeLocked = mStatusBarState == StatusBarState.SHADE_LOCKED; final boolean awakeKeyguard = mKeyguardIsVisible && mDeviceInteractive && !mGoingToSleep final boolean awakeKeyguard = mKeyguardIsVisible && mDeviceInteractive && !statusBarShadeLocked; final int user = getCurrentUser(); final int strongAuth = mStrongAuthTracker.getStrongAuthForUser(user); Loading Loading @@ -2635,7 +2635,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab // Only listen if this KeyguardUpdateMonitor belongs to the primary user. There is an // instance of KeyguardUpdateMonitor for each user but KeyguardUpdateMonitor is user-aware. final boolean shouldListen = (mBouncerFullyShown && !mGoingToSleep (mBouncerFullyShown || mAuthInterruptActive || mOccludingAppRequestingFace || awakeKeyguard Loading @@ -2647,6 +2647,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab && strongAuthAllowsScanning && mIsPrimaryUser && (!mSecureCameraLaunched || mOccludingAppRequestingFace) && !faceAuthenticated && !mGoingToSleep && !fpOrFaceIsLockedOut; // Aggregate relevant fields for debug logging. Loading packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java +25 −0 Original line number Diff line number Diff line Loading @@ -1474,6 +1474,27 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase { assertThat(mKeyguardUpdateMonitor.shouldListenForFace()).isTrue(); } @Test public void testShouldListenForFace_udfpsBouncerIsShowingButDeviceGoingToSleep_returnsFalse() throws RemoteException { // Preconditions for face auth to run keyguardNotGoingAway(); currentUserIsPrimary(); currentUserDoesNotHaveTrust(); biometricsNotDisabledThroughDevicePolicyManager(); biometricsEnabledForCurrentUser(); userNotCurrentlySwitching(); deviceNotGoingToSleep(); mKeyguardUpdateMonitor.setUdfpsBouncerShowing(true); mTestableLooper.processAllMessages(); assertThat(mKeyguardUpdateMonitor.shouldListenForFace()).isTrue(); deviceGoingToSleep(); mTestableLooper.processAllMessages(); assertThat(mKeyguardUpdateMonitor.shouldListenForFace()).isFalse(); } @Test public void testShouldListenForFace_whenFaceIsLockedOut_returnsFalse() throws RemoteException { Loading Loading @@ -1661,6 +1682,10 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase { mKeyguardUpdateMonitor.dispatchFinishedGoingToSleep(/* value doesn't matter */1); } private void deviceGoingToSleep() { mKeyguardUpdateMonitor.dispatchStartedGoingToSleep(/* value doesn't matter */1); } private void deviceIsInteractive() { mKeyguardUpdateMonitor.dispatchStartedWakingUp(); } Loading Loading
packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +3 −2 Original line number Diff line number Diff line Loading @@ -2589,7 +2589,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab } final boolean statusBarShadeLocked = mStatusBarState == StatusBarState.SHADE_LOCKED; final boolean awakeKeyguard = mKeyguardIsVisible && mDeviceInteractive && !mGoingToSleep final boolean awakeKeyguard = mKeyguardIsVisible && mDeviceInteractive && !statusBarShadeLocked; final int user = getCurrentUser(); final int strongAuth = mStrongAuthTracker.getStrongAuthForUser(user); Loading Loading @@ -2635,7 +2635,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab // Only listen if this KeyguardUpdateMonitor belongs to the primary user. There is an // instance of KeyguardUpdateMonitor for each user but KeyguardUpdateMonitor is user-aware. final boolean shouldListen = (mBouncerFullyShown && !mGoingToSleep (mBouncerFullyShown || mAuthInterruptActive || mOccludingAppRequestingFace || awakeKeyguard Loading @@ -2647,6 +2647,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab && strongAuthAllowsScanning && mIsPrimaryUser && (!mSecureCameraLaunched || mOccludingAppRequestingFace) && !faceAuthenticated && !mGoingToSleep && !fpOrFaceIsLockedOut; // Aggregate relevant fields for debug logging. Loading
packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java +25 −0 Original line number Diff line number Diff line Loading @@ -1474,6 +1474,27 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase { assertThat(mKeyguardUpdateMonitor.shouldListenForFace()).isTrue(); } @Test public void testShouldListenForFace_udfpsBouncerIsShowingButDeviceGoingToSleep_returnsFalse() throws RemoteException { // Preconditions for face auth to run keyguardNotGoingAway(); currentUserIsPrimary(); currentUserDoesNotHaveTrust(); biometricsNotDisabledThroughDevicePolicyManager(); biometricsEnabledForCurrentUser(); userNotCurrentlySwitching(); deviceNotGoingToSleep(); mKeyguardUpdateMonitor.setUdfpsBouncerShowing(true); mTestableLooper.processAllMessages(); assertThat(mKeyguardUpdateMonitor.shouldListenForFace()).isTrue(); deviceGoingToSleep(); mTestableLooper.processAllMessages(); assertThat(mKeyguardUpdateMonitor.shouldListenForFace()).isFalse(); } @Test public void testShouldListenForFace_whenFaceIsLockedOut_returnsFalse() throws RemoteException { Loading Loading @@ -1661,6 +1682,10 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase { mKeyguardUpdateMonitor.dispatchFinishedGoingToSleep(/* value doesn't matter */1); } private void deviceGoingToSleep() { mKeyguardUpdateMonitor.dispatchStartedGoingToSleep(/* value doesn't matter */1); } private void deviceIsInteractive() { mKeyguardUpdateMonitor.dispatchStartedWakingUp(); } Loading