Loading packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +10 −4 Original line number Diff line number Diff line Loading @@ -205,6 +205,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { private boolean mKeyguardGoingAway; private boolean mGoingToSleep; private boolean mBouncer; private boolean mAuthInterruptActive; private boolean mBootCompleted; private boolean mNeedsSlowUnlockTransition; private boolean mHasLockscreenWallpaper; Loading Loading @@ -1565,10 +1566,15 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { } /** * Request passive authentication, when sensors detect that a user might be present. * Called whenever passive authentication is requested or aborted by a sensor. * @param active If the interrupt started or ended. */ public void onAuthInterruptDetected() { if (DEBUG) Log.d(TAG, "onAuthInterruptDetected()"); public void onAuthInterruptDetected(boolean active) { if (DEBUG) Log.d(TAG, "onAuthInterruptDetected(" + active + ")"); if (mAuthInterruptActive == active) { return; } mAuthInterruptActive = active; updateFaceListeningState(); } Loading Loading @@ -1612,7 +1618,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { final boolean awakeKeyguard = mKeyguardIsVisible && mDeviceInteractive && !mGoingToSleep; final int user = getCurrentUser(); return (mBouncer || awakeKeyguard || shouldListenForFaceAssistant()) return (mBouncer || mAuthInterruptActive || awakeKeyguard || shouldListenForFaceAssistant()) && !mSwitchingUser && !getUserCanSkipBouncer(user) && !isFaceDisabled(user) && !mKeyguardGoingAway && !mFaceLockedOut && mFaceSettingEnabledForUser && mUserManager.isUserUnlocked(user); Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +4 −5 Original line number Diff line number Diff line Loading @@ -3895,11 +3895,7 @@ public class StatusBar extends SystemUI implements DemoMode, return; } if (mKeyguardUpdateMonitor != null && reason == DozeLog.PULSE_REASON_SENSOR_WAKE_LOCK_SCREEN) { mKeyguardUpdateMonitor.onAuthInterruptDetected(); } boolean passiveAuthInterrupt = reason == DozeLog.PULSE_REASON_SENSOR_WAKE_LOCK_SCREEN; // Set the state to pulsing, so ScrimController will know what to do once we ask it to // execute the transition. The pulse callback will then be invoked when the scrims // are black, indicating that StatusBar is ready to present the rest of the UI. Loading @@ -3925,6 +3921,9 @@ public class StatusBar extends SystemUI implements DemoMode, mNotificationPanel.setPulsing(pulsing); mVisualStabilityManager.setPulsing(pulsing); mIgnoreTouchWhilePulsing = false; if (mKeyguardUpdateMonitor != null && passiveAuthInterrupt) { mKeyguardUpdateMonitor.onAuthInterruptDetected(pulsing /* active */); } updateScrimController(); } }, reason); Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java +8 −2 Original line number Diff line number Diff line Loading @@ -655,13 +655,19 @@ public class StatusBarTest extends SysuiTestCase { DozeLog.REASON_SENSOR_DOUBLE_TAP, DozeLog.REASON_SENSOR_TAP)); doAnswer(invocation -> { DozeHost.PulseCallback callback = invocation.getArgument(0); callback.onPulseStarted(); return null; }).when(mDozeScrimController).pulse(any(), anyInt()); for (int i = 0; i < DozeLog.REASONS; i++) { reset(mKeyguardUpdateMonitor); mStatusBar.mDozeServiceHost.pulseWhileDozing(mock(DozeHost.PulseCallback.class), i); if (reasonsWantingAuth.contains(i)) { verify(mKeyguardUpdateMonitor).onAuthInterruptDetected(); verify(mKeyguardUpdateMonitor).onAuthInterruptDetected(eq(true)); } else if (reasonsSkippingAuth.contains(i) || reasonsThatDontPulse.contains(i)) { verify(mKeyguardUpdateMonitor, never()).onAuthInterruptDetected(); verify(mKeyguardUpdateMonitor, never()).onAuthInterruptDetected(eq(true)); } else { throw new AssertionError("Reason " + i + " isn't specified as wanting or skipping" + " passive auth. Please consider how this pulse reason should behave."); Loading Loading
packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +10 −4 Original line number Diff line number Diff line Loading @@ -205,6 +205,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { private boolean mKeyguardGoingAway; private boolean mGoingToSleep; private boolean mBouncer; private boolean mAuthInterruptActive; private boolean mBootCompleted; private boolean mNeedsSlowUnlockTransition; private boolean mHasLockscreenWallpaper; Loading Loading @@ -1565,10 +1566,15 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { } /** * Request passive authentication, when sensors detect that a user might be present. * Called whenever passive authentication is requested or aborted by a sensor. * @param active If the interrupt started or ended. */ public void onAuthInterruptDetected() { if (DEBUG) Log.d(TAG, "onAuthInterruptDetected()"); public void onAuthInterruptDetected(boolean active) { if (DEBUG) Log.d(TAG, "onAuthInterruptDetected(" + active + ")"); if (mAuthInterruptActive == active) { return; } mAuthInterruptActive = active; updateFaceListeningState(); } Loading Loading @@ -1612,7 +1618,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { final boolean awakeKeyguard = mKeyguardIsVisible && mDeviceInteractive && !mGoingToSleep; final int user = getCurrentUser(); return (mBouncer || awakeKeyguard || shouldListenForFaceAssistant()) return (mBouncer || mAuthInterruptActive || awakeKeyguard || shouldListenForFaceAssistant()) && !mSwitchingUser && !getUserCanSkipBouncer(user) && !isFaceDisabled(user) && !mKeyguardGoingAway && !mFaceLockedOut && mFaceSettingEnabledForUser && mUserManager.isUserUnlocked(user); Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +4 −5 Original line number Diff line number Diff line Loading @@ -3895,11 +3895,7 @@ public class StatusBar extends SystemUI implements DemoMode, return; } if (mKeyguardUpdateMonitor != null && reason == DozeLog.PULSE_REASON_SENSOR_WAKE_LOCK_SCREEN) { mKeyguardUpdateMonitor.onAuthInterruptDetected(); } boolean passiveAuthInterrupt = reason == DozeLog.PULSE_REASON_SENSOR_WAKE_LOCK_SCREEN; // Set the state to pulsing, so ScrimController will know what to do once we ask it to // execute the transition. The pulse callback will then be invoked when the scrims // are black, indicating that StatusBar is ready to present the rest of the UI. Loading @@ -3925,6 +3921,9 @@ public class StatusBar extends SystemUI implements DemoMode, mNotificationPanel.setPulsing(pulsing); mVisualStabilityManager.setPulsing(pulsing); mIgnoreTouchWhilePulsing = false; if (mKeyguardUpdateMonitor != null && passiveAuthInterrupt) { mKeyguardUpdateMonitor.onAuthInterruptDetected(pulsing /* active */); } updateScrimController(); } }, reason); Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java +8 −2 Original line number Diff line number Diff line Loading @@ -655,13 +655,19 @@ public class StatusBarTest extends SysuiTestCase { DozeLog.REASON_SENSOR_DOUBLE_TAP, DozeLog.REASON_SENSOR_TAP)); doAnswer(invocation -> { DozeHost.PulseCallback callback = invocation.getArgument(0); callback.onPulseStarted(); return null; }).when(mDozeScrimController).pulse(any(), anyInt()); for (int i = 0; i < DozeLog.REASONS; i++) { reset(mKeyguardUpdateMonitor); mStatusBar.mDozeServiceHost.pulseWhileDozing(mock(DozeHost.PulseCallback.class), i); if (reasonsWantingAuth.contains(i)) { verify(mKeyguardUpdateMonitor).onAuthInterruptDetected(); verify(mKeyguardUpdateMonitor).onAuthInterruptDetected(eq(true)); } else if (reasonsSkippingAuth.contains(i) || reasonsThatDontPulse.contains(i)) { verify(mKeyguardUpdateMonitor, never()).onAuthInterruptDetected(); verify(mKeyguardUpdateMonitor, never()).onAuthInterruptDetected(eq(true)); } else { throw new AssertionError("Reason " + i + " isn't specified as wanting or skipping" + " passive auth. Please consider how this pulse reason should behave."); Loading