10/n: Always send feedback if capacitive (or unknown) sensor am: 7f2031b6f5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15377751 Change-Id: I8f811f49da09522973dd89b8640eb85522754500
This commit is contained in:
@@ -26,7 +26,6 @@ import android.os.Handler;
|
|||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
import android.util.Slog;
|
import android.util.Slog;
|
||||||
|
|
||||||
import com.android.internal.annotations.GuardedBy;
|
|
||||||
import com.android.internal.annotations.VisibleForTesting;
|
import com.android.internal.annotations.VisibleForTesting;
|
||||||
import com.android.server.biometrics.sensors.BiometricScheduler.SensorType;
|
import com.android.server.biometrics.sensors.BiometricScheduler.SensorType;
|
||||||
import com.android.server.biometrics.sensors.fingerprint.Udfps;
|
import com.android.server.biometrics.sensors.fingerprint.Udfps;
|
||||||
@@ -239,6 +238,11 @@ public class CoexCoordinator {
|
|||||||
|
|
||||||
removeAndFinishAllFaceFromQueue();
|
removeAndFinishAllFaceFromQueue();
|
||||||
|
|
||||||
|
callback.sendHapticFeedback();
|
||||||
|
callback.sendAuthenticationResult(true /* addAuthTokenIfStrong */);
|
||||||
|
callback.handleLifecycleAfterAuth();
|
||||||
|
} else {
|
||||||
|
// Capacitive fingerprint sensor (or other)
|
||||||
callback.sendHapticFeedback();
|
callback.sendHapticFeedback();
|
||||||
callback.sendAuthenticationResult(true /* addAuthTokenIfStrong */);
|
callback.sendAuthenticationResult(true /* addAuthTokenIfStrong */);
|
||||||
callback.handleLifecycleAfterAuth();
|
callback.handleLifecycleAfterAuth();
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
package com.android.server.biometrics.sensors;
|
package com.android.server.biometrics.sensors;
|
||||||
|
|
||||||
import static com.android.server.biometrics.sensors.BiometricScheduler.SENSOR_TYPE_FACE;
|
import static com.android.server.biometrics.sensors.BiometricScheduler.SENSOR_TYPE_FACE;
|
||||||
|
import static com.android.server.biometrics.sensors.BiometricScheduler.SENSOR_TYPE_FP_OTHER;
|
||||||
import static com.android.server.biometrics.sensors.BiometricScheduler.SENSOR_TYPE_UDFPS;
|
import static com.android.server.biometrics.sensors.BiometricScheduler.SENSOR_TYPE_UDFPS;
|
||||||
|
|
||||||
import static junit.framework.Assert.assertEquals;
|
import static junit.framework.Assert.assertEquals;
|
||||||
@@ -326,6 +327,49 @@ public class CoexCoordinatorTest {
|
|||||||
verify(mCallback, never()).sendHapticFeedback();
|
verify(mCallback, never()).sendHapticFeedback();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testKeyguard_capacitiveAccepted_whenFaceScanning() {
|
||||||
|
mCoexCoordinator.reset();
|
||||||
|
|
||||||
|
AuthenticationClient<?> faceClient = mock(AuthenticationClient.class);
|
||||||
|
when(faceClient.isKeyguard()).thenReturn(true);
|
||||||
|
when(faceClient.getState()).thenReturn(AuthenticationClient.STATE_STARTED);
|
||||||
|
|
||||||
|
AuthenticationClient<?> fpClient = mock(AuthenticationClient.class);
|
||||||
|
when(fpClient.getState()).thenReturn(AuthenticationClient.STATE_STARTED);
|
||||||
|
when(fpClient.isKeyguard()).thenReturn(true);
|
||||||
|
|
||||||
|
mCoexCoordinator.addAuthenticationClient(SENSOR_TYPE_FACE, faceClient);
|
||||||
|
mCoexCoordinator.addAuthenticationClient(SENSOR_TYPE_FP_OTHER, fpClient);
|
||||||
|
|
||||||
|
mCoexCoordinator.onAuthenticationSucceeded(0 /* currentTimeMillis */, fpClient, mCallback);
|
||||||
|
verify(mCallback).sendHapticFeedback();
|
||||||
|
verify(mCallback).sendAuthenticationResult(eq(true) /* addAuthTokenIfStrong */);
|
||||||
|
verify(mCallback).handleLifecycleAfterAuth();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testKeyguard_capacitiveRejected_whenFaceScanning() {
|
||||||
|
mCoexCoordinator.reset();
|
||||||
|
|
||||||
|
AuthenticationClient<?> faceClient = mock(AuthenticationClient.class);
|
||||||
|
when(faceClient.isKeyguard()).thenReturn(true);
|
||||||
|
when(faceClient.getState()).thenReturn(AuthenticationClient.STATE_STARTED);
|
||||||
|
|
||||||
|
AuthenticationClient<?> fpClient = mock(AuthenticationClient.class);
|
||||||
|
when(fpClient.getState()).thenReturn(AuthenticationClient.STATE_STARTED);
|
||||||
|
when(fpClient.isKeyguard()).thenReturn(true);
|
||||||
|
|
||||||
|
mCoexCoordinator.addAuthenticationClient(SENSOR_TYPE_FACE, faceClient);
|
||||||
|
mCoexCoordinator.addAuthenticationClient(SENSOR_TYPE_FP_OTHER, fpClient);
|
||||||
|
|
||||||
|
mCoexCoordinator.onAuthenticationRejected(0 /* currentTimeMillis */, fpClient,
|
||||||
|
LockoutTracker.LOCKOUT_NONE, mCallback);
|
||||||
|
verify(mCallback).sendHapticFeedback();
|
||||||
|
verify(mCallback).sendAuthenticationResult(eq(false) /* addAuthTokenIfStrong */);
|
||||||
|
verify(mCallback).handleLifecycleAfterAuth();
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testNonKeyguard_rejectAndNotLockedOut() {
|
public void testNonKeyguard_rejectAndNotLockedOut() {
|
||||||
mCoexCoordinator.reset();
|
mCoexCoordinator.reset();
|
||||||
|
|||||||
Reference in New Issue
Block a user