Merge "Fix BiometricPrompt retrying without finger lift" into tm-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
69c392331a
@@ -626,17 +626,6 @@ public class AuthController implements CoreStartable, CommandQueue.Callbacks,
|
|||||||
mUdfpsController.onAodInterrupt(screenX, screenY, major, minor);
|
mUdfpsController.onAodInterrupt(screenX, screenY, major, minor);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Cancel a fingerprint scan manually. This will get rid of the white circle on the udfps
|
|
||||||
* sensor area even if the user hasn't explicitly lifted their finger yet.
|
|
||||||
*/
|
|
||||||
public void onCancelUdfps() {
|
|
||||||
if (mUdfpsController == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
mUdfpsController.onCancelUdfps();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void sendResultAndCleanUp(@DismissedReason int reason,
|
private void sendResultAndCleanUp(@DismissedReason int reason,
|
||||||
@Nullable byte[] credentialAttestation) {
|
@Nullable byte[] credentialAttestation) {
|
||||||
if (mReceiver == null) {
|
if (mReceiver == null) {
|
||||||
@@ -964,8 +953,6 @@ public class AuthController implements CoreStartable, CommandQueue.Callbacks,
|
|||||||
} else {
|
} else {
|
||||||
Log.w(TAG, "onBiometricError callback but dialog is gone");
|
Log.w(TAG, "onBiometricError callback but dialog is gone");
|
||||||
}
|
}
|
||||||
|
|
||||||
onCancelUdfps();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -786,7 +786,7 @@ public class UdfpsController implements DozeReceiver {
|
|||||||
// 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::onCancelUdfps,
|
mCancelAodTimeoutAction = mFgExecutor.executeDelayed(this::cancelAodInterrupt,
|
||||||
AOD_INTERRUPT_TIMEOUT_MILLIS);
|
AOD_INTERRUPT_TIMEOUT_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);
|
||||||
@@ -813,26 +813,22 @@ public class UdfpsController implements DozeReceiver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cancel UDFPS affordances - ability to hide the UDFPS overlay before the user explicitly
|
* The sensor that triggers {@link #onAodInterrupt} doesn't emit ACTION_UP or ACTION_CANCEL
|
||||||
* lifts their finger. Generally, this should be called on errors in the authentication flow.
|
* events, which means the fingerprint gesture created by the AOD interrupt needs to be
|
||||||
*
|
* cancelled manually.
|
||||||
* The sensor that triggers an AOD fingerprint interrupt (see onAodInterrupt) doesn't give
|
|
||||||
* ACTION_UP/ACTION_CANCEL events, so and AOD interrupt scan needs to be cancelled manually.
|
|
||||||
* This should be called when authentication either succeeds or fails. Failing to cancel the
|
* This should be called when authentication either succeeds or fails. Failing to cancel the
|
||||||
* scan will leave the display in the UDFPS mode until the user lifts their finger. On optical
|
* scan will leave the display in the UDFPS mode until the user lifts their finger. On optical
|
||||||
* sensors, this can result in illumination persisting for longer than necessary.
|
* sensors, this can result in illumination persisting for longer than necessary.
|
||||||
*/
|
*/
|
||||||
void onCancelUdfps() {
|
@VisibleForTesting
|
||||||
|
void cancelAodInterrupt() {
|
||||||
if (!mIsAodInterruptActive) {
|
if (!mIsAodInterruptActive) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (mOverlay != null && mOverlay.getOverlayView() != null) {
|
if (mOverlay != null && mOverlay.getOverlayView() != null) {
|
||||||
onFingerUp(mOverlay.getRequestId(), mOverlay.getOverlayView());
|
onFingerUp(mOverlay.getRequestId(), mOverlay.getOverlayView());
|
||||||
}
|
}
|
||||||
if (mCancelAodTimeoutAction != null) {
|
mCancelAodTimeoutAction = null;
|
||||||
mCancelAodTimeoutAction.run();
|
|
||||||
mCancelAodTimeoutAction = null;
|
|
||||||
}
|
|
||||||
mIsAodInterruptActive = false;
|
mIsAodInterruptActive = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -659,7 +659,7 @@ public class UdfpsControllerTest extends SysuiTestCase {
|
|||||||
mUdfpsController.onAodInterrupt(0, 0, 0f, 0f);
|
mUdfpsController.onAodInterrupt(0, 0, 0f, 0f);
|
||||||
when(mUdfpsView.isDisplayConfigured()).thenReturn(true);
|
when(mUdfpsView.isDisplayConfigured()).thenReturn(true);
|
||||||
// WHEN it is cancelled
|
// WHEN it is cancelled
|
||||||
mUdfpsController.onCancelUdfps();
|
mUdfpsController.cancelAodInterrupt();
|
||||||
// THEN the display is unconfigured
|
// THEN the display is unconfigured
|
||||||
verify(mUdfpsView).unconfigureDisplay();
|
verify(mUdfpsView).unconfigureDisplay();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user