Loading packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +7 −2 Original line number Diff line number Diff line Loading @@ -1536,6 +1536,10 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab @Override public void onUdfpsPointerDown(int sensorId) { Log.d(TAG, "onUdfpsPointerDown, sensorId: " + sensorId); requestFaceAuth(true); if (isFaceDetectionRunning()) { mKeyguardBypassController.setUserHasDeviceEntryIntent(true); } } @Override Loading Loading @@ -2237,7 +2241,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab public void requestFaceAuth(boolean userInitiatedRequest) { if (DEBUG) Log.d(TAG, "requestFaceAuth() userInitiated=" + userInitiatedRequest); mIsFaceAuthUserRequested |= userInitiatedRequest; updateFaceListeningState(BIOMETRIC_ACTION_UPDATE); updateFaceListeningState(BIOMETRIC_ACTION_START); } public boolean isFaceAuthUserRequested() { Loading Loading @@ -2487,7 +2491,8 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab // instance of KeyguardUpdateMonitor for each user but KeyguardUpdateMonitor is user-aware. final boolean shouldListen = (mBouncerFullyShown || mAuthInterruptActive || mOccludingAppRequestingFace || awakeKeyguard || shouldListenForFaceAssistant) || awakeKeyguard || shouldListenForFaceAssistant || mAuthController.isUdfpsFingerDown()) && !mSwitchingUser && !faceDisabledForUser && becauseCannotSkipBouncer && !mKeyguardGoingAway && biometricEnabledForUser && !mLockIconPressed && strongAuthAllowsScanning && mIsPrimaryUser Loading packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java +0 −9 Original line number Diff line number Diff line Loading @@ -65,7 +65,6 @@ import com.android.systemui.plugins.FalsingManager; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.statusbar.LockscreenShadeTransitionController; import com.android.systemui.statusbar.VibratorHelper; import com.android.systemui.statusbar.phone.KeyguardBypassController; import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager; import com.android.systemui.statusbar.phone.SystemUIDialogManager; import com.android.systemui.statusbar.phone.UnlockedScreenOffAnimationController; Loading Loading @@ -124,7 +123,6 @@ public class UdfpsController implements DozeReceiver { @NonNull private final AccessibilityManager mAccessibilityManager; @NonNull private final LockscreenShadeTransitionController mLockscreenShadeTransitionController; @Nullable private final UdfpsHbmProvider mHbmProvider; @NonNull private final KeyguardBypassController mKeyguardBypassController; @NonNull private final ConfigurationController mConfigurationController; @NonNull private final SystemClock mSystemClock; @NonNull private final UnlockedScreenOffAnimationController Loading Loading @@ -533,7 +531,6 @@ public class UdfpsController implements DozeReceiver { @NonNull UdfpsHapticsSimulator udfpsHapticsSimulator, @NonNull Optional<UdfpsHbmProvider> hbmProvider, @NonNull KeyguardStateController keyguardStateController, @NonNull KeyguardBypassController keyguardBypassController, @NonNull DisplayManager displayManager, @Main Handler mainHandler, @NonNull ConfigurationController configurationController, Loading Loading @@ -565,7 +562,6 @@ public class UdfpsController implements DozeReceiver { mHbmProvider = hbmProvider.orElse(null); screenLifecycle.addObserver(mScreenObserver); mScreenOn = screenLifecycle.getScreenState() == ScreenLifecycle.SCREEN_ON; mKeyguardBypassController = keyguardBypassController; mConfigurationController = configurationController; mSystemClock = systemClock; mUnlockedScreenOffAnimationController = unlockedScreenOffAnimationController; Loading Loading @@ -797,11 +793,6 @@ public class UdfpsController implements DozeReceiver { return; } if (mOverlay.getAnimationViewController() instanceof UdfpsKeyguardViewController && !mStatusBarStateController.isDozing()) { mKeyguardBypassController.setUserHasDeviceEntryIntent(true); } if (!mOnFingerDown) { playStartHaptic(); Loading packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsControllerTest.java +0 −73 Original line number Diff line number Diff line Loading @@ -67,7 +67,6 @@ import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.statusbar.LockscreenShadeTransitionController; import com.android.systemui.statusbar.VibratorHelper; import com.android.systemui.statusbar.phone.CentralSurfaces; import com.android.systemui.statusbar.phone.KeyguardBypassController; import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager; import com.android.systemui.statusbar.phone.SystemUIDialogManager; import com.android.systemui.statusbar.phone.UnlockedScreenOffAnimationController; Loading Loading @@ -150,8 +149,6 @@ public class UdfpsControllerTest extends SysuiTestCase { @Mock private KeyguardStateController mKeyguardStateController; @Mock private KeyguardBypassController mKeyguardBypassController; @Mock private DisplayManager mDisplayManager; @Mock private Handler mHandler; Loading Loading @@ -252,7 +249,6 @@ public class UdfpsControllerTest extends SysuiTestCase { mUdfpsHapticsSimulator, Optional.of(mHbmProvider), mKeyguardStateController, mKeyguardBypassController, mDisplayManager, mHandler, mConfigurationController, Loading Loading @@ -309,75 +305,6 @@ public class UdfpsControllerTest extends SysuiTestCase { verify(mStatusBarKeyguardViewManager).notifyKeyguardAuthenticated(anyBoolean()); } @Test public void onActionMove_dozing_setDeviceEntryIntent() throws RemoteException { // GIVEN the current animation is UdfpsKeyguardViewController and device IS dozing when(mKeyguardStateController.canDismissLockScreen()).thenReturn(false); when(mUdfpsView.isWithinSensorArea(anyFloat(), anyFloat())).thenReturn(true); when(mUdfpsView.getAnimationViewController()).thenReturn(mUdfpsKeyguardViewController); when(mStatusBarStateController.isDozing()).thenReturn(true); // GIVEN that the overlay is showing mOverlayController.showUdfpsOverlay(TEST_REQUEST_ID, TEST_UDFPS_SENSOR_ID, BiometricOverlayConstants.REASON_AUTH_KEYGUARD, mUdfpsOverlayControllerCallback); mFgExecutor.runAllReady(); // WHEN ACTION_DOWN is received verify(mUdfpsView).setOnTouchListener(mTouchListenerCaptor.capture()); MotionEvent moveEvent = MotionEvent.obtain(0, 0, MotionEvent.ACTION_MOVE, 0, 0, 0); mTouchListenerCaptor.getValue().onTouch(mUdfpsView, moveEvent); moveEvent.recycle(); // THEN device entry intent is never to true b/c device was dozing on touch verify(mKeyguardBypassController, never()).setUserHasDeviceEntryIntent(true); } @Test public void onActionMove_onKeyguard_setDeviceEntryIntent() throws RemoteException { // GIVEN the current animation is UdfpsKeyguardViewController and device isn't dozing when(mKeyguardStateController.canDismissLockScreen()).thenReturn(false); when(mUdfpsView.isWithinSensorArea(anyFloat(), anyFloat())).thenReturn(true); when(mUdfpsView.getAnimationViewController()).thenReturn(mUdfpsKeyguardViewController); when(mStatusBarStateController.isDozing()).thenReturn(false); // GIVEN that the overlay is showing mOverlayController.showUdfpsOverlay(TEST_REQUEST_ID, TEST_UDFPS_SENSOR_ID, BiometricOverlayConstants.REASON_AUTH_KEYGUARD, mUdfpsOverlayControllerCallback); mFgExecutor.runAllReady(); // WHEN ACTION_DOWN is received verify(mUdfpsView).setOnTouchListener(mTouchListenerCaptor.capture()); MotionEvent moveEvent = MotionEvent.obtain(0, 0, MotionEvent.ACTION_MOVE, 0, 0, 0); mTouchListenerCaptor.getValue().onTouch(mUdfpsView, moveEvent); moveEvent.recycle(); // THEN device entry intent is set to true verify(mKeyguardBypassController).setUserHasDeviceEntryIntent(true); } @Test public void onActionMove_onEnrollment_neverSetDeviceEntryIntent() throws RemoteException { // GIVEN the current animation is UdfpsEnrollViewController when(mKeyguardStateController.canDismissLockScreen()).thenReturn(false); when(mUdfpsView.isWithinSensorArea(anyFloat(), anyFloat())).thenReturn(true); when(mUdfpsView.getAnimationViewController()).thenReturn( (UdfpsAnimationViewController) mock(UdfpsEnrollViewController.class)); // GIVEN that the overlay is showing mOverlayController.showUdfpsOverlay(TEST_REQUEST_ID, TEST_UDFPS_SENSOR_ID, BiometricOverlayConstants.REASON_ENROLL_ENROLLING, mUdfpsOverlayControllerCallback); mFgExecutor.runAllReady(); // WHEN ACTION_DOWN is received verify(mUdfpsView).setOnTouchListener(mTouchListenerCaptor.capture()); MotionEvent moveEvent = MotionEvent.obtain(0, 0, MotionEvent.ACTION_MOVE, 0, 0, 0); mTouchListenerCaptor.getValue().onTouch(mUdfpsView, moveEvent); moveEvent.recycle(); // THEN device entry intent is never set verify(mKeyguardBypassController, never()).setUserHasDeviceEntryIntent(anyBoolean()); } @Test public void onActionMoveTouch_whenCanDismissLockScreen_entersDevice() throws RemoteException { Loading Loading
packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +7 −2 Original line number Diff line number Diff line Loading @@ -1536,6 +1536,10 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab @Override public void onUdfpsPointerDown(int sensorId) { Log.d(TAG, "onUdfpsPointerDown, sensorId: " + sensorId); requestFaceAuth(true); if (isFaceDetectionRunning()) { mKeyguardBypassController.setUserHasDeviceEntryIntent(true); } } @Override Loading Loading @@ -2237,7 +2241,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab public void requestFaceAuth(boolean userInitiatedRequest) { if (DEBUG) Log.d(TAG, "requestFaceAuth() userInitiated=" + userInitiatedRequest); mIsFaceAuthUserRequested |= userInitiatedRequest; updateFaceListeningState(BIOMETRIC_ACTION_UPDATE); updateFaceListeningState(BIOMETRIC_ACTION_START); } public boolean isFaceAuthUserRequested() { Loading Loading @@ -2487,7 +2491,8 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab // instance of KeyguardUpdateMonitor for each user but KeyguardUpdateMonitor is user-aware. final boolean shouldListen = (mBouncerFullyShown || mAuthInterruptActive || mOccludingAppRequestingFace || awakeKeyguard || shouldListenForFaceAssistant) || awakeKeyguard || shouldListenForFaceAssistant || mAuthController.isUdfpsFingerDown()) && !mSwitchingUser && !faceDisabledForUser && becauseCannotSkipBouncer && !mKeyguardGoingAway && biometricEnabledForUser && !mLockIconPressed && strongAuthAllowsScanning && mIsPrimaryUser Loading
packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java +0 −9 Original line number Diff line number Diff line Loading @@ -65,7 +65,6 @@ import com.android.systemui.plugins.FalsingManager; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.statusbar.LockscreenShadeTransitionController; import com.android.systemui.statusbar.VibratorHelper; import com.android.systemui.statusbar.phone.KeyguardBypassController; import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager; import com.android.systemui.statusbar.phone.SystemUIDialogManager; import com.android.systemui.statusbar.phone.UnlockedScreenOffAnimationController; Loading Loading @@ -124,7 +123,6 @@ public class UdfpsController implements DozeReceiver { @NonNull private final AccessibilityManager mAccessibilityManager; @NonNull private final LockscreenShadeTransitionController mLockscreenShadeTransitionController; @Nullable private final UdfpsHbmProvider mHbmProvider; @NonNull private final KeyguardBypassController mKeyguardBypassController; @NonNull private final ConfigurationController mConfigurationController; @NonNull private final SystemClock mSystemClock; @NonNull private final UnlockedScreenOffAnimationController Loading Loading @@ -533,7 +531,6 @@ public class UdfpsController implements DozeReceiver { @NonNull UdfpsHapticsSimulator udfpsHapticsSimulator, @NonNull Optional<UdfpsHbmProvider> hbmProvider, @NonNull KeyguardStateController keyguardStateController, @NonNull KeyguardBypassController keyguardBypassController, @NonNull DisplayManager displayManager, @Main Handler mainHandler, @NonNull ConfigurationController configurationController, Loading Loading @@ -565,7 +562,6 @@ public class UdfpsController implements DozeReceiver { mHbmProvider = hbmProvider.orElse(null); screenLifecycle.addObserver(mScreenObserver); mScreenOn = screenLifecycle.getScreenState() == ScreenLifecycle.SCREEN_ON; mKeyguardBypassController = keyguardBypassController; mConfigurationController = configurationController; mSystemClock = systemClock; mUnlockedScreenOffAnimationController = unlockedScreenOffAnimationController; Loading Loading @@ -797,11 +793,6 @@ public class UdfpsController implements DozeReceiver { return; } if (mOverlay.getAnimationViewController() instanceof UdfpsKeyguardViewController && !mStatusBarStateController.isDozing()) { mKeyguardBypassController.setUserHasDeviceEntryIntent(true); } if (!mOnFingerDown) { playStartHaptic(); Loading
packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsControllerTest.java +0 −73 Original line number Diff line number Diff line Loading @@ -67,7 +67,6 @@ import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.statusbar.LockscreenShadeTransitionController; import com.android.systemui.statusbar.VibratorHelper; import com.android.systemui.statusbar.phone.CentralSurfaces; import com.android.systemui.statusbar.phone.KeyguardBypassController; import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager; import com.android.systemui.statusbar.phone.SystemUIDialogManager; import com.android.systemui.statusbar.phone.UnlockedScreenOffAnimationController; Loading Loading @@ -150,8 +149,6 @@ public class UdfpsControllerTest extends SysuiTestCase { @Mock private KeyguardStateController mKeyguardStateController; @Mock private KeyguardBypassController mKeyguardBypassController; @Mock private DisplayManager mDisplayManager; @Mock private Handler mHandler; Loading Loading @@ -252,7 +249,6 @@ public class UdfpsControllerTest extends SysuiTestCase { mUdfpsHapticsSimulator, Optional.of(mHbmProvider), mKeyguardStateController, mKeyguardBypassController, mDisplayManager, mHandler, mConfigurationController, Loading Loading @@ -309,75 +305,6 @@ public class UdfpsControllerTest extends SysuiTestCase { verify(mStatusBarKeyguardViewManager).notifyKeyguardAuthenticated(anyBoolean()); } @Test public void onActionMove_dozing_setDeviceEntryIntent() throws RemoteException { // GIVEN the current animation is UdfpsKeyguardViewController and device IS dozing when(mKeyguardStateController.canDismissLockScreen()).thenReturn(false); when(mUdfpsView.isWithinSensorArea(anyFloat(), anyFloat())).thenReturn(true); when(mUdfpsView.getAnimationViewController()).thenReturn(mUdfpsKeyguardViewController); when(mStatusBarStateController.isDozing()).thenReturn(true); // GIVEN that the overlay is showing mOverlayController.showUdfpsOverlay(TEST_REQUEST_ID, TEST_UDFPS_SENSOR_ID, BiometricOverlayConstants.REASON_AUTH_KEYGUARD, mUdfpsOverlayControllerCallback); mFgExecutor.runAllReady(); // WHEN ACTION_DOWN is received verify(mUdfpsView).setOnTouchListener(mTouchListenerCaptor.capture()); MotionEvent moveEvent = MotionEvent.obtain(0, 0, MotionEvent.ACTION_MOVE, 0, 0, 0); mTouchListenerCaptor.getValue().onTouch(mUdfpsView, moveEvent); moveEvent.recycle(); // THEN device entry intent is never to true b/c device was dozing on touch verify(mKeyguardBypassController, never()).setUserHasDeviceEntryIntent(true); } @Test public void onActionMove_onKeyguard_setDeviceEntryIntent() throws RemoteException { // GIVEN the current animation is UdfpsKeyguardViewController and device isn't dozing when(mKeyguardStateController.canDismissLockScreen()).thenReturn(false); when(mUdfpsView.isWithinSensorArea(anyFloat(), anyFloat())).thenReturn(true); when(mUdfpsView.getAnimationViewController()).thenReturn(mUdfpsKeyguardViewController); when(mStatusBarStateController.isDozing()).thenReturn(false); // GIVEN that the overlay is showing mOverlayController.showUdfpsOverlay(TEST_REQUEST_ID, TEST_UDFPS_SENSOR_ID, BiometricOverlayConstants.REASON_AUTH_KEYGUARD, mUdfpsOverlayControllerCallback); mFgExecutor.runAllReady(); // WHEN ACTION_DOWN is received verify(mUdfpsView).setOnTouchListener(mTouchListenerCaptor.capture()); MotionEvent moveEvent = MotionEvent.obtain(0, 0, MotionEvent.ACTION_MOVE, 0, 0, 0); mTouchListenerCaptor.getValue().onTouch(mUdfpsView, moveEvent); moveEvent.recycle(); // THEN device entry intent is set to true verify(mKeyguardBypassController).setUserHasDeviceEntryIntent(true); } @Test public void onActionMove_onEnrollment_neverSetDeviceEntryIntent() throws RemoteException { // GIVEN the current animation is UdfpsEnrollViewController when(mKeyguardStateController.canDismissLockScreen()).thenReturn(false); when(mUdfpsView.isWithinSensorArea(anyFloat(), anyFloat())).thenReturn(true); when(mUdfpsView.getAnimationViewController()).thenReturn( (UdfpsAnimationViewController) mock(UdfpsEnrollViewController.class)); // GIVEN that the overlay is showing mOverlayController.showUdfpsOverlay(TEST_REQUEST_ID, TEST_UDFPS_SENSOR_ID, BiometricOverlayConstants.REASON_ENROLL_ENROLLING, mUdfpsOverlayControllerCallback); mFgExecutor.runAllReady(); // WHEN ACTION_DOWN is received verify(mUdfpsView).setOnTouchListener(mTouchListenerCaptor.capture()); MotionEvent moveEvent = MotionEvent.obtain(0, 0, MotionEvent.ACTION_MOVE, 0, 0, 0); mTouchListenerCaptor.getValue().onTouch(mUdfpsView, moveEvent); moveEvent.recycle(); // THEN device entry intent is never set verify(mKeyguardBypassController, never()).setUserHasDeviceEntryIntent(anyBoolean()); } @Test public void onActionMoveTouch_whenCanDismissLockScreen_entersDevice() throws RemoteException { Loading