Loading packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java +2 −1 Original line number Diff line number Diff line Loading @@ -888,7 +888,8 @@ public class UdfpsController implements DozeReceiver { return; } if (mView.getAnimationViewController() instanceof UdfpsKeyguardViewController) { if (mView.getAnimationViewController() instanceof UdfpsKeyguardViewController && !mStatusBarStateController.isDozing()) { mKeyguardBypassController.setUserHasDeviceEntryIntent(true); } Loading packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsControllerTest.java +25 −1 Original line number Diff line number Diff line Loading @@ -274,12 +274,36 @@ 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_UDFPS_SENSOR_ID, IUdfpsOverlayController.REASON_AUTH_FPM_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 // 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_UDFPS_SENSOR_ID, Loading Loading
packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java +2 −1 Original line number Diff line number Diff line Loading @@ -888,7 +888,8 @@ public class UdfpsController implements DozeReceiver { return; } if (mView.getAnimationViewController() instanceof UdfpsKeyguardViewController) { if (mView.getAnimationViewController() instanceof UdfpsKeyguardViewController && !mStatusBarStateController.isDozing()) { mKeyguardBypassController.setUserHasDeviceEntryIntent(true); } Loading
packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsControllerTest.java +25 −1 Original line number Diff line number Diff line Loading @@ -274,12 +274,36 @@ 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_UDFPS_SENSOR_ID, IUdfpsOverlayController.REASON_AUTH_FPM_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 // 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_UDFPS_SENSOR_ID, Loading