Make sure aodInterrupts are cancelled am: b681e2f5a8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20670987 Change-Id: I295d55b643392373f059a46cfc54c71c6826c5e5 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -115,7 +115,7 @@ import kotlin.Unit;
|
|||||||
@SysUISingleton
|
@SysUISingleton
|
||||||
public class UdfpsController implements DozeReceiver, Dumpable {
|
public class UdfpsController implements DozeReceiver, Dumpable {
|
||||||
private static final String TAG = "UdfpsController";
|
private static final String TAG = "UdfpsController";
|
||||||
private static final long AOD_INTERRUPT_TIMEOUT_MILLIS = 1000;
|
private static final long AOD_SEND_FINGER_UP_DELAY_MILLIS = 1000;
|
||||||
|
|
||||||
// Minimum required delay between consecutive touch logs in milliseconds.
|
// Minimum required delay between consecutive touch logs in milliseconds.
|
||||||
private static final long MIN_TOUCH_LOG_INTERVAL = 50;
|
private static final long MIN_TOUCH_LOG_INTERVAL = 50;
|
||||||
@@ -178,7 +178,7 @@ public class UdfpsController implements DozeReceiver, Dumpable {
|
|||||||
// interrupt is being tracked and a timeout is used as a last resort to turn off high brightness
|
// interrupt is being tracked and a timeout is used as a last resort to turn off high brightness
|
||||||
// mode.
|
// mode.
|
||||||
private boolean mIsAodInterruptActive;
|
private boolean mIsAodInterruptActive;
|
||||||
@Nullable private Runnable mCancelAodTimeoutAction;
|
@Nullable private Runnable mCancelAodFingerUpAction;
|
||||||
private boolean mScreenOn;
|
private boolean mScreenOn;
|
||||||
private Runnable mAodInterruptRunnable;
|
private Runnable mAodInterruptRunnable;
|
||||||
private boolean mOnFingerDown;
|
private boolean mOnFingerDown;
|
||||||
@@ -272,6 +272,7 @@ public class UdfpsController implements DozeReceiver, Dumpable {
|
|||||||
if (view != null && isOptical()) {
|
if (view != null && isOptical()) {
|
||||||
unconfigureDisplay(view);
|
unconfigureDisplay(view);
|
||||||
}
|
}
|
||||||
|
tryAodSendFingerUp();
|
||||||
if (acquiredGood) {
|
if (acquiredGood) {
|
||||||
mOverlay.onAcquiredGood();
|
mOverlay.onAcquiredGood();
|
||||||
}
|
}
|
||||||
@@ -868,12 +869,6 @@ public class UdfpsController implements DozeReceiver, Dumpable {
|
|||||||
private void unconfigureDisplay(@NonNull UdfpsView view) {
|
private void unconfigureDisplay(@NonNull UdfpsView view) {
|
||||||
if (view.isDisplayConfigured()) {
|
if (view.isDisplayConfigured()) {
|
||||||
view.unconfigureDisplay();
|
view.unconfigureDisplay();
|
||||||
|
|
||||||
if (mCancelAodTimeoutAction != null) {
|
|
||||||
mCancelAodTimeoutAction.run();
|
|
||||||
mCancelAodTimeoutAction = null;
|
|
||||||
}
|
|
||||||
mIsAodInterruptActive = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -913,8 +908,8 @@ public class UdfpsController implements DozeReceiver, Dumpable {
|
|||||||
// ACTION_UP/ACTION_CANCEL, we need to be careful about not letting the screen
|
// ACTION_UP/ACTION_CANCEL, we need to be careful about not letting the screen
|
||||||
// accidentally remain in high brightness mode. As a mitigation, queue a call to
|
// accidentally remain in high brightness mode. As a mitigation, queue a call to
|
||||||
// cancel the fingerprint scan.
|
// cancel the fingerprint scan.
|
||||||
mCancelAodTimeoutAction = mFgExecutor.executeDelayed(this::cancelAodInterrupt,
|
mCancelAodFingerUpAction = mFgExecutor.executeDelayed(this::tryAodSendFingerUp,
|
||||||
AOD_INTERRUPT_TIMEOUT_MILLIS);
|
AOD_SEND_FINGER_UP_DELAY_MILLIS);
|
||||||
// using a hard-coded value for major and minor until it is available from the sensor
|
// using a hard-coded value for major and minor until it is available from the sensor
|
||||||
onFingerDown(requestId, screenX, screenY, minor, major);
|
onFingerDown(requestId, screenX, screenY, minor, major);
|
||||||
};
|
};
|
||||||
@@ -948,15 +943,27 @@ public class UdfpsController implements DozeReceiver, Dumpable {
|
|||||||
* sensors, this can result in illumination persisting for longer than necessary.
|
* sensors, this can result in illumination persisting for longer than necessary.
|
||||||
*/
|
*/
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
void cancelAodInterrupt() {
|
void tryAodSendFingerUp() {
|
||||||
if (!mIsAodInterruptActive) {
|
if (!mIsAodInterruptActive) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
cancelAodSendFingerUpAction();
|
||||||
if (mOverlay != null && mOverlay.getOverlayView() != null) {
|
if (mOverlay != null && mOverlay.getOverlayView() != null) {
|
||||||
onFingerUp(mOverlay.getRequestId(), mOverlay.getOverlayView());
|
onFingerUp(mOverlay.getRequestId(), mOverlay.getOverlayView());
|
||||||
}
|
}
|
||||||
mCancelAodTimeoutAction = null;
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Cancels any scheduled AoD finger-up actions without triggered the finger-up action. Only
|
||||||
|
* call this method if the finger-up event has been guaranteed to have already occurred.
|
||||||
|
*/
|
||||||
|
@VisibleForTesting
|
||||||
|
void cancelAodSendFingerUpAction() {
|
||||||
mIsAodInterruptActive = false;
|
mIsAodInterruptActive = false;
|
||||||
|
if (mCancelAodFingerUpAction != null) {
|
||||||
|
mCancelAodFingerUpAction.run();
|
||||||
|
mCancelAodFingerUpAction = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isOptical() {
|
private boolean isOptical() {
|
||||||
@@ -1118,6 +1125,7 @@ public class UdfpsController implements DozeReceiver, Dumpable {
|
|||||||
if (isOptical()) {
|
if (isOptical()) {
|
||||||
unconfigureDisplay(view);
|
unconfigureDisplay(view);
|
||||||
}
|
}
|
||||||
|
cancelAodSendFingerUpAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
package com.android.systemui.biometrics;
|
package com.android.systemui.biometrics;
|
||||||
|
|
||||||
|
import static android.hardware.biometrics.BiometricFingerprintConstants.FINGERPRINT_ACQUIRED_GOOD;
|
||||||
import static android.view.MotionEvent.ACTION_DOWN;
|
import static android.view.MotionEvent.ACTION_DOWN;
|
||||||
import static android.view.MotionEvent.ACTION_MOVE;
|
import static android.view.MotionEvent.ACTION_MOVE;
|
||||||
import static android.view.MotionEvent.ACTION_UP;
|
import static android.view.MotionEvent.ACTION_UP;
|
||||||
@@ -23,6 +24,8 @@ import static android.view.MotionEvent.ACTION_UP;
|
|||||||
import static com.android.internal.util.FunctionalUtils.ThrowingConsumer;
|
import static com.android.internal.util.FunctionalUtils.ThrowingConsumer;
|
||||||
|
|
||||||
import static junit.framework.Assert.assertEquals;
|
import static junit.framework.Assert.assertEquals;
|
||||||
|
import static junit.framework.Assert.assertFalse;
|
||||||
|
import static junit.framework.Assert.assertTrue;
|
||||||
|
|
||||||
import static org.mockito.ArgumentMatchers.any;
|
import static org.mockito.ArgumentMatchers.any;
|
||||||
import static org.mockito.ArgumentMatchers.anyBoolean;
|
import static org.mockito.ArgumentMatchers.anyBoolean;
|
||||||
@@ -124,7 +127,7 @@ public class UdfpsControllerTest extends SysuiTestCase {
|
|||||||
// Unit under test
|
// Unit under test
|
||||||
private UdfpsController mUdfpsController;
|
private UdfpsController mUdfpsController;
|
||||||
// Dependencies
|
// Dependencies
|
||||||
private FakeExecutor mBiometricsExecutor;
|
private FakeExecutor mBiometricExecutor;
|
||||||
@Mock
|
@Mock
|
||||||
private LayoutInflater mLayoutInflater;
|
private LayoutInflater mLayoutInflater;
|
||||||
@Mock
|
@Mock
|
||||||
@@ -212,6 +215,8 @@ public class UdfpsControllerTest extends SysuiTestCase {
|
|||||||
private ArgumentCaptor<Runnable> mOnDisplayConfiguredCaptor;
|
private ArgumentCaptor<Runnable> mOnDisplayConfiguredCaptor;
|
||||||
@Captor
|
@Captor
|
||||||
private ArgumentCaptor<ScreenLifecycle.Observer> mScreenObserverCaptor;
|
private ArgumentCaptor<ScreenLifecycle.Observer> mScreenObserverCaptor;
|
||||||
|
@Captor
|
||||||
|
private ArgumentCaptor<UdfpsController.UdfpsOverlayController> mUdfpsOverlayControllerCaptor;
|
||||||
private ScreenLifecycle.Observer mScreenObserver;
|
private ScreenLifecycle.Observer mScreenObserver;
|
||||||
private FingerprintSensorPropertiesInternal mOpticalProps;
|
private FingerprintSensorPropertiesInternal mOpticalProps;
|
||||||
private FingerprintSensorPropertiesInternal mUltrasonicProps;
|
private FingerprintSensorPropertiesInternal mUltrasonicProps;
|
||||||
@@ -258,7 +263,7 @@ public class UdfpsControllerTest extends SysuiTestCase {
|
|||||||
mFgExecutor = new FakeExecutor(new FakeSystemClock());
|
mFgExecutor = new FakeExecutor(new FakeSystemClock());
|
||||||
|
|
||||||
// Create a fake background executor.
|
// Create a fake background executor.
|
||||||
mBiometricsExecutor = new FakeExecutor(new FakeSystemClock());
|
mBiometricExecutor = new FakeExecutor(new FakeSystemClock());
|
||||||
|
|
||||||
initUdfpsController(true /* hasAlternateTouchProvider */);
|
initUdfpsController(true /* hasAlternateTouchProvider */);
|
||||||
}
|
}
|
||||||
@@ -286,7 +291,7 @@ public class UdfpsControllerTest extends SysuiTestCase {
|
|||||||
mVibrator, mUdfpsHapticsSimulator, mUdfpsShell, mKeyguardStateController,
|
mVibrator, mUdfpsHapticsSimulator, mUdfpsShell, mKeyguardStateController,
|
||||||
mDisplayManager, mHandler, mConfigurationController, mSystemClock,
|
mDisplayManager, mHandler, mConfigurationController, mSystemClock,
|
||||||
mUnlockedScreenOffAnimationController, mSystemUIDialogManager, mLatencyTracker,
|
mUnlockedScreenOffAnimationController, mSystemUIDialogManager, mLatencyTracker,
|
||||||
mActivityLaunchAnimator, alternateTouchProvider, mBiometricsExecutor,
|
mActivityLaunchAnimator, alternateTouchProvider, mBiometricExecutor,
|
||||||
mPrimaryBouncerInteractor, mSinglePointerTouchProcessor);
|
mPrimaryBouncerInteractor, mSinglePointerTouchProcessor);
|
||||||
verify(mFingerprintManager).setUdfpsOverlayController(mOverlayCaptor.capture());
|
verify(mFingerprintManager).setUdfpsOverlayController(mOverlayCaptor.capture());
|
||||||
mOverlayController = mOverlayCaptor.getValue();
|
mOverlayController = mOverlayCaptor.getValue();
|
||||||
@@ -322,7 +327,7 @@ public class UdfpsControllerTest extends SysuiTestCase {
|
|||||||
verify(mUdfpsView).setOnTouchListener(mTouchListenerCaptor.capture());
|
verify(mUdfpsView).setOnTouchListener(mTouchListenerCaptor.capture());
|
||||||
MotionEvent downEvent = MotionEvent.obtain(0, 0, ACTION_DOWN, 0, 0, 0);
|
MotionEvent downEvent = MotionEvent.obtain(0, 0, ACTION_DOWN, 0, 0, 0);
|
||||||
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, downEvent);
|
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, downEvent);
|
||||||
mBiometricsExecutor.runAllReady();
|
mBiometricExecutor.runAllReady();
|
||||||
downEvent.recycle();
|
downEvent.recycle();
|
||||||
|
|
||||||
// THEN notify keyguard authenticate to dismiss the keyguard
|
// THEN notify keyguard authenticate to dismiss the keyguard
|
||||||
@@ -360,7 +365,7 @@ public class UdfpsControllerTest extends SysuiTestCase {
|
|||||||
mFgExecutor.runAllReady();
|
mFgExecutor.runAllReady();
|
||||||
}
|
}
|
||||||
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, moveEvent);
|
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, moveEvent);
|
||||||
mBiometricsExecutor.runAllReady();
|
mBiometricExecutor.runAllReady();
|
||||||
moveEvent.recycle();
|
moveEvent.recycle();
|
||||||
|
|
||||||
// THEN notify keyguard authenticate to dismiss the keyguard
|
// THEN notify keyguard authenticate to dismiss the keyguard
|
||||||
@@ -384,12 +389,12 @@ public class UdfpsControllerTest extends SysuiTestCase {
|
|||||||
verify(mUdfpsView).setOnTouchListener(mTouchListenerCaptor.capture());
|
verify(mUdfpsView).setOnTouchListener(mTouchListenerCaptor.capture());
|
||||||
MotionEvent downEvent = MotionEvent.obtain(0, 0, ACTION_DOWN, 0, 0, 0);
|
MotionEvent downEvent = MotionEvent.obtain(0, 0, ACTION_DOWN, 0, 0, 0);
|
||||||
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, downEvent);
|
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, downEvent);
|
||||||
mBiometricsExecutor.runAllReady();
|
mBiometricExecutor.runAllReady();
|
||||||
downEvent.recycle();
|
downEvent.recycle();
|
||||||
MotionEvent moveEvent = MotionEvent.obtain(0, 0, MotionEvent.ACTION_MOVE, 0, 0, 0);
|
MotionEvent moveEvent = MotionEvent.obtain(0, 0, MotionEvent.ACTION_MOVE, 0, 0, 0);
|
||||||
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, moveEvent);
|
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, moveEvent);
|
||||||
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, moveEvent);
|
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, moveEvent);
|
||||||
mBiometricsExecutor.runAllReady();
|
mBiometricExecutor.runAllReady();
|
||||||
moveEvent.recycle();
|
moveEvent.recycle();
|
||||||
|
|
||||||
// THEN notify keyguard authenticate to dismiss the keyguard
|
// THEN notify keyguard authenticate to dismiss the keyguard
|
||||||
@@ -578,11 +583,11 @@ public class UdfpsControllerTest extends SysuiTestCase {
|
|||||||
MotionEvent event = obtainMotionEvent(ACTION_DOWN, displayWidth, displayHeight, touchMinor,
|
MotionEvent event = obtainMotionEvent(ACTION_DOWN, displayWidth, displayHeight, touchMinor,
|
||||||
touchMajor);
|
touchMajor);
|
||||||
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, event);
|
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, event);
|
||||||
mBiometricsExecutor.runAllReady();
|
mBiometricExecutor.runAllReady();
|
||||||
event.recycle();
|
event.recycle();
|
||||||
event = obtainMotionEvent(ACTION_MOVE, displayWidth, displayHeight, touchMinor, touchMajor);
|
event = obtainMotionEvent(ACTION_MOVE, displayWidth, displayHeight, touchMinor, touchMajor);
|
||||||
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, event);
|
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, event);
|
||||||
mBiometricsExecutor.runAllReady();
|
mBiometricExecutor.runAllReady();
|
||||||
event.recycle();
|
event.recycle();
|
||||||
if (testParams.hasAlternateTouchProvider) {
|
if (testParams.hasAlternateTouchProvider) {
|
||||||
verify(mAlternateTouchProvider).onPointerDown(eq(TEST_REQUEST_ID), eq(expectedX),
|
verify(mAlternateTouchProvider).onPointerDown(eq(TEST_REQUEST_ID), eq(expectedX),
|
||||||
@@ -601,11 +606,11 @@ public class UdfpsControllerTest extends SysuiTestCase {
|
|||||||
scaleFactor, Surface.ROTATION_90));
|
scaleFactor, Surface.ROTATION_90));
|
||||||
event = obtainMotionEvent(ACTION_DOWN, displayHeight, 0, touchMinor, touchMajor);
|
event = obtainMotionEvent(ACTION_DOWN, displayHeight, 0, touchMinor, touchMajor);
|
||||||
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, event);
|
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, event);
|
||||||
mBiometricsExecutor.runAllReady();
|
mBiometricExecutor.runAllReady();
|
||||||
event.recycle();
|
event.recycle();
|
||||||
event = obtainMotionEvent(ACTION_MOVE, displayHeight, 0, touchMinor, touchMajor);
|
event = obtainMotionEvent(ACTION_MOVE, displayHeight, 0, touchMinor, touchMajor);
|
||||||
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, event);
|
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, event);
|
||||||
mBiometricsExecutor.runAllReady();
|
mBiometricExecutor.runAllReady();
|
||||||
event.recycle();
|
event.recycle();
|
||||||
if (testParams.hasAlternateTouchProvider) {
|
if (testParams.hasAlternateTouchProvider) {
|
||||||
verify(mAlternateTouchProvider).onPointerDown(eq(TEST_REQUEST_ID), eq(expectedX),
|
verify(mAlternateTouchProvider).onPointerDown(eq(TEST_REQUEST_ID), eq(expectedX),
|
||||||
@@ -624,11 +629,11 @@ public class UdfpsControllerTest extends SysuiTestCase {
|
|||||||
scaleFactor, Surface.ROTATION_270));
|
scaleFactor, Surface.ROTATION_270));
|
||||||
event = obtainMotionEvent(ACTION_DOWN, 0, displayWidth, touchMinor, touchMajor);
|
event = obtainMotionEvent(ACTION_DOWN, 0, displayWidth, touchMinor, touchMajor);
|
||||||
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, event);
|
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, event);
|
||||||
mBiometricsExecutor.runAllReady();
|
mBiometricExecutor.runAllReady();
|
||||||
event.recycle();
|
event.recycle();
|
||||||
event = obtainMotionEvent(ACTION_MOVE, 0, displayWidth, touchMinor, touchMajor);
|
event = obtainMotionEvent(ACTION_MOVE, 0, displayWidth, touchMinor, touchMajor);
|
||||||
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, event);
|
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, event);
|
||||||
mBiometricsExecutor.runAllReady();
|
mBiometricExecutor.runAllReady();
|
||||||
event.recycle();
|
event.recycle();
|
||||||
if (testParams.hasAlternateTouchProvider) {
|
if (testParams.hasAlternateTouchProvider) {
|
||||||
verify(mAlternateTouchProvider).onPointerDown(eq(TEST_REQUEST_ID), eq(expectedX),
|
verify(mAlternateTouchProvider).onPointerDown(eq(TEST_REQUEST_ID), eq(expectedX),
|
||||||
@@ -648,11 +653,11 @@ public class UdfpsControllerTest extends SysuiTestCase {
|
|||||||
// ROTATION_180 is not supported. It should be treated like ROTATION_0.
|
// ROTATION_180 is not supported. It should be treated like ROTATION_0.
|
||||||
event = obtainMotionEvent(ACTION_DOWN, displayWidth, displayHeight, touchMinor, touchMajor);
|
event = obtainMotionEvent(ACTION_DOWN, displayWidth, displayHeight, touchMinor, touchMajor);
|
||||||
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, event);
|
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, event);
|
||||||
mBiometricsExecutor.runAllReady();
|
mBiometricExecutor.runAllReady();
|
||||||
event.recycle();
|
event.recycle();
|
||||||
event = obtainMotionEvent(ACTION_MOVE, displayWidth, displayHeight, touchMinor, touchMajor);
|
event = obtainMotionEvent(ACTION_MOVE, displayWidth, displayHeight, touchMinor, touchMajor);
|
||||||
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, event);
|
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, event);
|
||||||
mBiometricsExecutor.runAllReady();
|
mBiometricExecutor.runAllReady();
|
||||||
event.recycle();
|
event.recycle();
|
||||||
if (testParams.hasAlternateTouchProvider) {
|
if (testParams.hasAlternateTouchProvider) {
|
||||||
verify(mAlternateTouchProvider).onPointerDown(eq(TEST_REQUEST_ID), eq(expectedX),
|
verify(mAlternateTouchProvider).onPointerDown(eq(TEST_REQUEST_ID), eq(expectedX),
|
||||||
@@ -687,12 +692,12 @@ public class UdfpsControllerTest extends SysuiTestCase {
|
|||||||
// WHEN ACTION_DOWN is received
|
// WHEN ACTION_DOWN is received
|
||||||
MotionEvent downEvent = MotionEvent.obtain(0, 0, ACTION_DOWN, 0, 0, 0);
|
MotionEvent downEvent = MotionEvent.obtain(0, 0, ACTION_DOWN, 0, 0, 0);
|
||||||
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, downEvent);
|
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, downEvent);
|
||||||
mBiometricsExecutor.runAllReady();
|
mBiometricExecutor.runAllReady();
|
||||||
downEvent.recycle();
|
downEvent.recycle();
|
||||||
|
|
||||||
MotionEvent moveEvent = MotionEvent.obtain(0, 0, MotionEvent.ACTION_MOVE, 0, 0, 0);
|
MotionEvent moveEvent = MotionEvent.obtain(0, 0, MotionEvent.ACTION_MOVE, 0, 0, 0);
|
||||||
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, moveEvent);
|
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, moveEvent);
|
||||||
mBiometricsExecutor.runAllReady();
|
mBiometricExecutor.runAllReady();
|
||||||
moveEvent.recycle();
|
moveEvent.recycle();
|
||||||
|
|
||||||
mFgExecutor.runAllReady();
|
mFgExecutor.runAllReady();
|
||||||
@@ -725,7 +730,7 @@ public class UdfpsControllerTest extends SysuiTestCase {
|
|||||||
if (testParams.sensorProps.sensorType == FingerprintSensorProperties.TYPE_UDFPS_OPTICAL) {
|
if (testParams.sensorProps.sensorType == FingerprintSensorProperties.TYPE_UDFPS_OPTICAL) {
|
||||||
// AND onDisplayConfigured notifies FingerprintManager about onUiReady
|
// AND onDisplayConfigured notifies FingerprintManager about onUiReady
|
||||||
mOnDisplayConfiguredCaptor.getValue().run();
|
mOnDisplayConfiguredCaptor.getValue().run();
|
||||||
mBiometricsExecutor.runAllReady();
|
mBiometricExecutor.runAllReady();
|
||||||
if (testParams.hasAlternateTouchProvider) {
|
if (testParams.hasAlternateTouchProvider) {
|
||||||
InOrder inOrder = inOrder(mAlternateTouchProvider, mLatencyTracker);
|
InOrder inOrder = inOrder(mAlternateTouchProvider, mLatencyTracker);
|
||||||
inOrder.verify(mAlternateTouchProvider).onUiReady();
|
inOrder.verify(mAlternateTouchProvider).onUiReady();
|
||||||
@@ -748,13 +753,15 @@ public class UdfpsControllerTest extends SysuiTestCase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void aodInterrupt() {
|
public void aodInterrupt() {
|
||||||
runWithAllParams(this::aodInterruptParameterized);
|
runWithAllParams(this::aodInterruptParameterized);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void aodInterruptParameterized(TestParams testParams) throws RemoteException {
|
private void aodInterruptParameterized(TestParams testParams) throws RemoteException {
|
||||||
mUdfpsController.cancelAodInterrupt();
|
mUdfpsController.cancelAodSendFingerUpAction();
|
||||||
reset(mUdfpsView, mAlternateTouchProvider, mFingerprintManager, mKeyguardUpdateMonitor);
|
reset(mUdfpsView, mAlternateTouchProvider, mFingerprintManager, mKeyguardUpdateMonitor);
|
||||||
when(mKeyguardUpdateMonitor.isFingerprintDetectionRunning()).thenReturn(true);
|
when(mKeyguardUpdateMonitor.isFingerprintDetectionRunning()).thenReturn(true);
|
||||||
|
|
||||||
@@ -774,7 +781,7 @@ public class UdfpsControllerTest extends SysuiTestCase {
|
|||||||
} else {
|
} else {
|
||||||
verify(mUdfpsView, never()).configureDisplay(mOnDisplayConfiguredCaptor.capture());
|
verify(mUdfpsView, never()).configureDisplay(mOnDisplayConfiguredCaptor.capture());
|
||||||
}
|
}
|
||||||
mBiometricsExecutor.runAllReady();
|
mBiometricExecutor.runAllReady();
|
||||||
|
|
||||||
if (testParams.hasAlternateTouchProvider) {
|
if (testParams.hasAlternateTouchProvider) {
|
||||||
verify(mAlternateTouchProvider).onPointerDown(eq(TEST_REQUEST_ID), eq(0), eq(0),
|
verify(mAlternateTouchProvider).onPointerDown(eq(TEST_REQUEST_ID), eq(0), eq(0),
|
||||||
@@ -792,7 +799,7 @@ public class UdfpsControllerTest extends SysuiTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void cancelAodInterrupt() {
|
public void tryAodSendFingerUp_displayConfigurationChanges() {
|
||||||
runWithAllParams(this::cancelAodInterruptParameterized);
|
runWithAllParams(this::cancelAodInterruptParameterized);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -808,13 +815,89 @@ public class UdfpsControllerTest extends SysuiTestCase {
|
|||||||
if (testParams.sensorProps.sensorType == FingerprintSensorProperties.TYPE_UDFPS_OPTICAL) {
|
if (testParams.sensorProps.sensorType == FingerprintSensorProperties.TYPE_UDFPS_OPTICAL) {
|
||||||
when(mUdfpsView.isDisplayConfigured()).thenReturn(true);
|
when(mUdfpsView.isDisplayConfigured()).thenReturn(true);
|
||||||
// WHEN it is cancelled
|
// WHEN it is cancelled
|
||||||
mUdfpsController.cancelAodInterrupt();
|
mUdfpsController.tryAodSendFingerUp();
|
||||||
// THEN the display is unconfigured
|
// THEN the display is unconfigured
|
||||||
verify(mUdfpsView).unconfigureDisplay();
|
verify(mUdfpsView).unconfigureDisplay();
|
||||||
} else {
|
} else {
|
||||||
when(mUdfpsView.isDisplayConfigured()).thenReturn(false);
|
when(mUdfpsView.isDisplayConfigured()).thenReturn(false);
|
||||||
// WHEN it is cancelled
|
// WHEN it is cancelled
|
||||||
mUdfpsController.cancelAodInterrupt();
|
mUdfpsController.tryAodSendFingerUp();
|
||||||
|
// THEN the display configuration is unchanged.
|
||||||
|
verify(mUdfpsView, never()).unconfigureDisplay();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void onFingerUp_displayConfigurationChange() {
|
||||||
|
runWithAllParams(this::onFingerUp_displayConfigurationParameterized);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void onFingerUp_displayConfigurationParameterized(TestParams testParams)
|
||||||
|
throws RemoteException {
|
||||||
|
reset(mUdfpsView);
|
||||||
|
|
||||||
|
// GIVEN AOD interrupt
|
||||||
|
mOverlayController.showUdfpsOverlay(TEST_REQUEST_ID, testParams.sensorProps.sensorId,
|
||||||
|
BiometricOverlayConstants.REASON_AUTH_KEYGUARD, mUdfpsOverlayControllerCallback);
|
||||||
|
mScreenObserver.onScreenTurnedOn();
|
||||||
|
mFgExecutor.runAllReady();
|
||||||
|
mUdfpsController.onAodInterrupt(0, 0, 0f, 0f);
|
||||||
|
if (testParams.sensorProps.sensorType == FingerprintSensorProperties.TYPE_UDFPS_OPTICAL) {
|
||||||
|
when(mUdfpsView.isDisplayConfigured()).thenReturn(true);
|
||||||
|
|
||||||
|
// WHEN up-action received
|
||||||
|
verify(mUdfpsView).setOnTouchListener(mTouchListenerCaptor.capture());
|
||||||
|
MotionEvent upEvent = MotionEvent.obtain(0, 0, ACTION_UP, 0, 0, 0);
|
||||||
|
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, upEvent);
|
||||||
|
mBiometricExecutor.runAllReady();
|
||||||
|
upEvent.recycle();
|
||||||
|
mFgExecutor.runAllReady();
|
||||||
|
|
||||||
|
// THEN the display is unconfigured
|
||||||
|
verify(mUdfpsView).unconfigureDisplay();
|
||||||
|
} else {
|
||||||
|
when(mUdfpsView.isDisplayConfigured()).thenReturn(false);
|
||||||
|
|
||||||
|
// WHEN up-action received
|
||||||
|
verify(mUdfpsView).setOnTouchListener(mTouchListenerCaptor.capture());
|
||||||
|
MotionEvent upEvent = MotionEvent.obtain(0, 0, ACTION_UP, 0, 0, 0);
|
||||||
|
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, upEvent);
|
||||||
|
mBiometricExecutor.runAllReady();
|
||||||
|
upEvent.recycle();
|
||||||
|
mFgExecutor.runAllReady();
|
||||||
|
|
||||||
|
// THEN the display configuration is unchanged.
|
||||||
|
verify(mUdfpsView, never()).unconfigureDisplay();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void onAcquiredGood_displayConfigurationChange() {
|
||||||
|
runWithAllParams(this::onAcquiredGood_displayConfigurationParameterized);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void onAcquiredGood_displayConfigurationParameterized(TestParams testParams)
|
||||||
|
throws RemoteException {
|
||||||
|
reset(mUdfpsView);
|
||||||
|
|
||||||
|
// GIVEN overlay is showing
|
||||||
|
mOverlayController.showUdfpsOverlay(TEST_REQUEST_ID, testParams.sensorProps.sensorId,
|
||||||
|
BiometricOverlayConstants.REASON_AUTH_KEYGUARD, mUdfpsOverlayControllerCallback);
|
||||||
|
mFgExecutor.runAllReady();
|
||||||
|
if (testParams.sensorProps.sensorType == FingerprintSensorProperties.TYPE_UDFPS_OPTICAL) {
|
||||||
|
when(mUdfpsView.isDisplayConfigured()).thenReturn(true);
|
||||||
|
// WHEN ACQUIRED_GOOD received
|
||||||
|
mOverlayController.onAcquired(testParams.sensorProps.sensorId,
|
||||||
|
BiometricFingerprintConstants.FINGERPRINT_ACQUIRED_GOOD);
|
||||||
|
mFgExecutor.runAllReady();
|
||||||
|
// THEN the display is unconfigured
|
||||||
|
verify(mUdfpsView).unconfigureDisplay();
|
||||||
|
} else {
|
||||||
|
when(mUdfpsView.isDisplayConfigured()).thenReturn(false);
|
||||||
|
// WHEN ACQUIRED_GOOD received
|
||||||
|
mOverlayController.onAcquired(testParams.sensorProps.sensorId,
|
||||||
|
BiometricFingerprintConstants.FINGERPRINT_ACQUIRED_GOOD);
|
||||||
|
mFgExecutor.runAllReady();
|
||||||
// THEN the display configuration is unchanged.
|
// THEN the display configuration is unchanged.
|
||||||
verify(mUdfpsView, never()).unconfigureDisplay();
|
verify(mUdfpsView, never()).unconfigureDisplay();
|
||||||
}
|
}
|
||||||
@@ -881,7 +964,7 @@ public class UdfpsControllerTest extends SysuiTestCase {
|
|||||||
verify(mUdfpsView).setOnTouchListener(mTouchListenerCaptor.capture());
|
verify(mUdfpsView).setOnTouchListener(mTouchListenerCaptor.capture());
|
||||||
MotionEvent upEvent = MotionEvent.obtain(0, 0, ACTION_UP, 0, 0, 0);
|
MotionEvent upEvent = MotionEvent.obtain(0, 0, ACTION_UP, 0, 0, 0);
|
||||||
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, upEvent);
|
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, upEvent);
|
||||||
mBiometricsExecutor.runAllReady();
|
mBiometricExecutor.runAllReady();
|
||||||
upEvent.recycle();
|
upEvent.recycle();
|
||||||
|
|
||||||
// Configure UdfpsView to accept the ACTION_DOWN event
|
// Configure UdfpsView to accept the ACTION_DOWN event
|
||||||
@@ -890,80 +973,13 @@ public class UdfpsControllerTest extends SysuiTestCase {
|
|||||||
// WHEN ACTION_DOWN is received
|
// WHEN ACTION_DOWN is received
|
||||||
MotionEvent downEvent = MotionEvent.obtain(0, 0, ACTION_DOWN, 0, 0, 0);
|
MotionEvent downEvent = MotionEvent.obtain(0, 0, ACTION_DOWN, 0, 0, 0);
|
||||||
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, downEvent);
|
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, downEvent);
|
||||||
mBiometricsExecutor.runAllReady();
|
mBiometricExecutor.runAllReady();
|
||||||
downEvent.recycle();
|
downEvent.recycle();
|
||||||
|
|
||||||
// WHEN ACTION_MOVE is received
|
// WHEN ACTION_MOVE is received
|
||||||
MotionEvent moveEvent = MotionEvent.obtain(0, 0, MotionEvent.ACTION_MOVE, 0, 0, 0);
|
MotionEvent moveEvent = MotionEvent.obtain(0, 0, MotionEvent.ACTION_MOVE, 0, 0, 0);
|
||||||
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, moveEvent);
|
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, moveEvent);
|
||||||
mBiometricsExecutor.runAllReady();
|
mBiometricExecutor.runAllReady();
|
||||||
moveEvent.recycle();
|
|
||||||
mFgExecutor.runAllReady();
|
|
||||||
|
|
||||||
if (testParams.sensorProps.sensorType == FingerprintSensorProperties.TYPE_UDFPS_OPTICAL) {
|
|
||||||
// Configure UdfpsView to accept the finger up event
|
|
||||||
when(mUdfpsView.isDisplayConfigured()).thenReturn(true);
|
|
||||||
} else {
|
|
||||||
when(mUdfpsView.isDisplayConfigured()).thenReturn(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
// WHEN it times out
|
|
||||||
mFgExecutor.advanceClockToNext();
|
|
||||||
mFgExecutor.runAllReady();
|
|
||||||
|
|
||||||
if (testParams.sensorProps.sensorType == FingerprintSensorProperties.TYPE_UDFPS_OPTICAL) {
|
|
||||||
// THEN the display should be unconfigured once. If the timeout action is not
|
|
||||||
// cancelled, the display would be unconfigured twice which would cause two
|
|
||||||
// FP attempts.
|
|
||||||
verify(mUdfpsView, times(1)).unconfigureDisplay();
|
|
||||||
} else {
|
|
||||||
verify(mUdfpsView, never()).unconfigureDisplay();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void aodInterruptCancelTimeoutActionOnAcquired() {
|
|
||||||
runWithAllParams(this::aodInterruptCancelTimeoutActionOnAcquiredParameterized);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void aodInterruptCancelTimeoutActionOnAcquiredParameterized(TestParams testParams)
|
|
||||||
throws RemoteException {
|
|
||||||
reset(mUdfpsView);
|
|
||||||
when(mUdfpsView.isWithinSensorArea(anyFloat(), anyFloat())).thenReturn(true);
|
|
||||||
|
|
||||||
// GIVEN AOD interrupt
|
|
||||||
mOverlayController.showUdfpsOverlay(TEST_REQUEST_ID, testParams.sensorProps.sensorId,
|
|
||||||
BiometricOverlayConstants.REASON_AUTH_KEYGUARD, mUdfpsOverlayControllerCallback);
|
|
||||||
mScreenObserver.onScreenTurnedOn();
|
|
||||||
mFgExecutor.runAllReady();
|
|
||||||
mUdfpsController.onAodInterrupt(0, 0, 0f, 0f);
|
|
||||||
mFgExecutor.runAllReady();
|
|
||||||
|
|
||||||
if (testParams.sensorProps.sensorType == FingerprintSensorProperties.TYPE_UDFPS_OPTICAL) {
|
|
||||||
// Configure UdfpsView to accept the acquired event
|
|
||||||
when(mUdfpsView.isDisplayConfigured()).thenReturn(true);
|
|
||||||
} else {
|
|
||||||
when(mUdfpsView.isDisplayConfigured()).thenReturn(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
// WHEN acquired is received
|
|
||||||
mOverlayController.onAcquired(testParams.sensorProps.sensorId,
|
|
||||||
BiometricFingerprintConstants.FINGERPRINT_ACQUIRED_GOOD);
|
|
||||||
|
|
||||||
// Configure UdfpsView to accept the ACTION_DOWN event
|
|
||||||
when(mUdfpsView.isDisplayConfigured()).thenReturn(false);
|
|
||||||
|
|
||||||
// WHEN ACTION_DOWN is received
|
|
||||||
verify(mUdfpsView).setOnTouchListener(mTouchListenerCaptor.capture());
|
|
||||||
MotionEvent downEvent = MotionEvent.obtain(0, 0, ACTION_DOWN, 0, 0, 0);
|
|
||||||
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, downEvent);
|
|
||||||
mBiometricsExecutor.runAllReady();
|
|
||||||
downEvent.recycle();
|
|
||||||
|
|
||||||
// WHEN ACTION_MOVE is received
|
|
||||||
MotionEvent moveEvent = MotionEvent.obtain(0, 0, MotionEvent.ACTION_MOVE, 0, 0, 0);
|
|
||||||
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, moveEvent);
|
|
||||||
mBiometricsExecutor.runAllReady();
|
|
||||||
moveEvent.recycle();
|
moveEvent.recycle();
|
||||||
mFgExecutor.runAllReady();
|
mFgExecutor.runAllReady();
|
||||||
|
|
||||||
@@ -1083,11 +1099,11 @@ public class UdfpsControllerTest extends SysuiTestCase {
|
|||||||
verify(mUdfpsView).setOnTouchListener(mTouchListenerCaptor.capture());
|
verify(mUdfpsView).setOnTouchListener(mTouchListenerCaptor.capture());
|
||||||
MotionEvent downEvent = MotionEvent.obtain(0, 0, ACTION_DOWN, 0, 0, 0);
|
MotionEvent downEvent = MotionEvent.obtain(0, 0, ACTION_DOWN, 0, 0, 0);
|
||||||
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, downEvent);
|
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, downEvent);
|
||||||
mBiometricsExecutor.runAllReady();
|
mBiometricExecutor.runAllReady();
|
||||||
downEvent.recycle();
|
downEvent.recycle();
|
||||||
MotionEvent moveEvent = MotionEvent.obtain(0, 0, MotionEvent.ACTION_MOVE, 0, 0, 0);
|
MotionEvent moveEvent = MotionEvent.obtain(0, 0, MotionEvent.ACTION_MOVE, 0, 0, 0);
|
||||||
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, moveEvent);
|
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, moveEvent);
|
||||||
mBiometricsExecutor.runAllReady();
|
mBiometricExecutor.runAllReady();
|
||||||
moveEvent.recycle();
|
moveEvent.recycle();
|
||||||
|
|
||||||
// THEN NO haptic played
|
// THEN NO haptic played
|
||||||
@@ -1123,19 +1139,19 @@ public class UdfpsControllerTest extends SysuiTestCase {
|
|||||||
// WHEN ACTION_DOWN is received
|
// WHEN ACTION_DOWN is received
|
||||||
MotionEvent downEvent = MotionEvent.obtain(0, 0, ACTION_DOWN, 0, 0, 0);
|
MotionEvent downEvent = MotionEvent.obtain(0, 0, ACTION_DOWN, 0, 0, 0);
|
||||||
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, downEvent);
|
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, downEvent);
|
||||||
mBiometricsExecutor.runAllReady();
|
mBiometricExecutor.runAllReady();
|
||||||
downEvent.recycle();
|
downEvent.recycle();
|
||||||
|
|
||||||
// AND ACTION_MOVE is received
|
// AND ACTION_MOVE is received
|
||||||
MotionEvent moveEvent = MotionEvent.obtain(0, 0, MotionEvent.ACTION_MOVE, 0, 0, 0);
|
MotionEvent moveEvent = MotionEvent.obtain(0, 0, MotionEvent.ACTION_MOVE, 0, 0, 0);
|
||||||
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, moveEvent);
|
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, moveEvent);
|
||||||
mBiometricsExecutor.runAllReady();
|
mBiometricExecutor.runAllReady();
|
||||||
moveEvent.recycle();
|
moveEvent.recycle();
|
||||||
|
|
||||||
// AND ACTION_UP is received
|
// AND ACTION_UP is received
|
||||||
MotionEvent upEvent = MotionEvent.obtain(0, 0, MotionEvent.ACTION_UP, 0, 0, 0);
|
MotionEvent upEvent = MotionEvent.obtain(0, 0, MotionEvent.ACTION_UP, 0, 0, 0);
|
||||||
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, upEvent);
|
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, upEvent);
|
||||||
mBiometricsExecutor.runAllReady();
|
mBiometricExecutor.runAllReady();
|
||||||
upEvent.recycle();
|
upEvent.recycle();
|
||||||
|
|
||||||
// THEN the old FingerprintManager path is invoked.
|
// THEN the old FingerprintManager path is invoked.
|
||||||
@@ -1177,7 +1193,7 @@ public class UdfpsControllerTest extends SysuiTestCase {
|
|||||||
processorResultDown);
|
processorResultDown);
|
||||||
MotionEvent downEvent = MotionEvent.obtain(0, 0, ACTION_DOWN, 0, 0, 0);
|
MotionEvent downEvent = MotionEvent.obtain(0, 0, ACTION_DOWN, 0, 0, 0);
|
||||||
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, downEvent);
|
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, downEvent);
|
||||||
mBiometricsExecutor.runAllReady();
|
mBiometricExecutor.runAllReady();
|
||||||
downEvent.recycle();
|
downEvent.recycle();
|
||||||
|
|
||||||
// AND ACTION_UP is received
|
// AND ACTION_UP is received
|
||||||
@@ -1185,7 +1201,7 @@ public class UdfpsControllerTest extends SysuiTestCase {
|
|||||||
processorResultUp);
|
processorResultUp);
|
||||||
MotionEvent upEvent = MotionEvent.obtain(0, 0, MotionEvent.ACTION_UP, 0, 0, 0);
|
MotionEvent upEvent = MotionEvent.obtain(0, 0, MotionEvent.ACTION_UP, 0, 0, 0);
|
||||||
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, upEvent);
|
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, upEvent);
|
||||||
mBiometricsExecutor.runAllReady();
|
mBiometricExecutor.runAllReady();
|
||||||
upEvent.recycle();
|
upEvent.recycle();
|
||||||
|
|
||||||
// THEN the new FingerprintManager path is invoked.
|
// THEN the new FingerprintManager path is invoked.
|
||||||
@@ -1194,4 +1210,31 @@ public class UdfpsControllerTest extends SysuiTestCase {
|
|||||||
verify(mFingerprintManager).onPointerUp(anyLong(), anyInt(), anyInt(), anyFloat(),
|
verify(mFingerprintManager).onPointerUp(anyLong(), anyInt(), anyInt(), anyFloat(),
|
||||||
anyFloat(), anyFloat(), anyFloat(), anyFloat(), anyLong(), anyLong(), anyBoolean());
|
anyFloat(), anyFloat(), anyFloat(), anyFloat(), anyLong(), anyLong(), anyBoolean());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void onAodInterrupt_onAcquiredGood_fingerNoLongerDown() throws RemoteException {
|
||||||
|
// GIVEN UDFPS overlay is showing
|
||||||
|
mOverlayController.showUdfpsOverlay(TEST_REQUEST_ID, mOpticalProps.sensorId,
|
||||||
|
BiometricOverlayConstants.REASON_AUTH_KEYGUARD, mUdfpsOverlayControllerCallback);
|
||||||
|
mFgExecutor.runAllReady();
|
||||||
|
|
||||||
|
// GIVEN there's been an AoD interrupt
|
||||||
|
when(mKeyguardUpdateMonitor.isFingerprintDetectionRunning()).thenReturn(true);
|
||||||
|
mScreenObserver.onScreenTurnedOn();
|
||||||
|
mUdfpsController.onAodInterrupt(0, 0, 0, 0);
|
||||||
|
|
||||||
|
// THEN finger is considered down
|
||||||
|
assertTrue(mUdfpsController.isFingerDown());
|
||||||
|
|
||||||
|
// WHEN udfps receives an ACQUIRED_GOOD after the display is configured
|
||||||
|
when(mUdfpsView.isDisplayConfigured()).thenReturn(true);
|
||||||
|
verify(mFingerprintManager).setUdfpsOverlayController(
|
||||||
|
mUdfpsOverlayControllerCaptor.capture());
|
||||||
|
mUdfpsOverlayControllerCaptor.getValue().onAcquired(0, FINGERPRINT_ACQUIRED_GOOD);
|
||||||
|
mFgExecutor.runAllReady();
|
||||||
|
|
||||||
|
// THEN is fingerDown should be FALSE
|
||||||
|
assertFalse(mUdfpsController.isFingerDown());
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user