Merge "Don't send cancel after client finished" into udc-d1-dev am: 0e4974d5c6

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23475545

Change-Id: I2095aa11d95c7692f2ccef0baba36e1c37067a59
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Joshua Mccloskey
2023-06-01 16:40:22 +00:00
committed by Automerger Merge Worker
3 changed files with 16 additions and 4 deletions

View File

@@ -266,8 +266,12 @@ public abstract class AuthenticationClient<T, O extends AuthenticateOptions>
} }
} else { } else {
if (isBackgroundAuth) { if (isBackgroundAuth) {
Slog.e(TAG, "cancelling due to background auth"); Slog.e(TAG, "Sending cancel to client(Due to background auth)");
cancel(); if (mTaskStackListener != null) {
mActivityTaskManager.unregisterTaskStackListener(mTaskStackListener);
}
sendCancelOnly(getListener());
mCallback.onClientFinished(this, false);
} else { } else {
// Allow system-defined limit of number of attempts before giving up // Allow system-defined limit of number of attempts before giving up
if (mShouldUseLockoutTracker) { if (mShouldUseLockoutTracker) {

View File

@@ -16,8 +16,10 @@
package com.android.server.biometrics.sensors.face.aidl; package com.android.server.biometrics.sensors.face.aidl;
import static android.hardware.biometrics.BiometricConstants.BIOMETRIC_ERROR_CANCELED;
import static android.hardware.biometrics.BiometricFaceConstants.FACE_ERROR_LOCKOUT; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ERROR_LOCKOUT;
import static android.hardware.biometrics.BiometricFaceConstants.FACE_ERROR_LOCKOUT_PERMANENT; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ERROR_LOCKOUT_PERMANENT;
import static com.google.common.truth.Truth.assertThat; import static com.google.common.truth.Truth.assertThat;
import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.any;
@@ -205,7 +207,9 @@ public class FaceAuthenticationClientTest {
client.onAuthenticated(new Face("friendly", 1 /* faceId */, 2 /* deviceId */), client.onAuthenticated(new Face("friendly", 1 /* faceId */, 2 /* deviceId */),
true /* authenticated */, new ArrayList<>()); true /* authenticated */, new ArrayList<>());
verify(mCancellationSignal).cancel(); verify(mCancellationSignal, never()).cancel();
verify(mClientMonitorCallbackConverter)
.onError(anyInt(), anyInt(), eq(BIOMETRIC_ERROR_CANCELED), anyInt());
} }
private FaceAuthenticationClient createClient() throws RemoteException { private FaceAuthenticationClient createClient() throws RemoteException {

View File

@@ -16,6 +16,8 @@
package com.android.server.biometrics.sensors.fingerprint.aidl; package com.android.server.biometrics.sensors.fingerprint.aidl;
import static android.hardware.biometrics.BiometricConstants.BIOMETRIC_ERROR_CANCELED;
import static com.google.common.truth.Truth.assertThat; import static com.google.common.truth.Truth.assertThat;
import static org.mockito.ArgumentMatchers.anyBoolean; import static org.mockito.ArgumentMatchers.anyBoolean;
@@ -399,7 +401,9 @@ public class FingerprintAuthenticationClientTest {
mLooper.moveTimeForward(10); mLooper.moveTimeForward(10);
mLooper.dispatchAll(); mLooper.dispatchAll();
verify(mCancellationSignal).cancel(); verify(mCancellationSignal, never()).cancel();
verify(mClientMonitorCallbackConverter)
.onError(anyInt(), anyInt(), eq(BIOMETRIC_ERROR_CANCELED), anyInt());
} }
private FingerprintAuthenticationClient createClient() throws RemoteException { private FingerprintAuthenticationClient createClient() throws RemoteException {