Loading core/java/android/hardware/biometrics/BiometricConstants.java +10 −0 Original line number Diff line number Diff line Loading @@ -178,6 +178,15 @@ public interface BiometricConstants { @FlaggedApi(Flags.FLAG_IDENTITY_CHECK_API) int BIOMETRIC_ERROR_NOT_ENABLED_FOR_APPS = 21; /** * The user pressed the more options button on prompt content. This is a placeholder that is * currently only used by the support library. * * @hide */ int BIOMETRIC_ERROR_CONTENT_VIEW_MORE_OPTIONS_BUTTON = 22; /** * This constant is only used by SystemUI. It notifies SystemUI that authentication was paused * because the authentication attempt was unsuccessful. Loading Loading @@ -209,6 +218,7 @@ public interface BiometricConstants { BIOMETRIC_ERROR_SECURITY_UPDATE_REQUIRED, BIOMETRIC_ERROR_IDENTITY_CHECK_NOT_ACTIVE, BIOMETRIC_ERROR_NOT_ENABLED_FOR_APPS, BIOMETRIC_ERROR_CONTENT_VIEW_MORE_OPTIONS_BUTTON, BIOMETRIC_PAUSED_REJECTED}) @Retention(RetentionPolicy.SOURCE) @interface Errors {} Loading services/core/java/com/android/server/biometrics/AuthSession.java +3 −0 Original line number Diff line number Diff line Loading @@ -803,6 +803,9 @@ public final class AuthSession implements IBinder.DeathRecipient { case BiometricPrompt.DISMISSED_REASON_USER_CANCEL: error = BiometricConstants.BIOMETRIC_ERROR_USER_CANCELED; break; case BiometricPrompt.DISMISSED_REASON_CONTENT_VIEW_MORE_OPTIONS: error = BiometricConstants.BIOMETRIC_ERROR_CONTENT_VIEW_MORE_OPTIONS_BUTTON; break; default: } Loading services/tests/servicestests/src/com/android/server/biometrics/AuthSessionTest.java +30 −1 Original line number Diff line number Diff line Loading @@ -18,9 +18,11 @@ package com.android.server.biometrics; import static android.hardware.biometrics.BiometricAuthenticator.TYPE_FACE; import static android.hardware.biometrics.BiometricAuthenticator.TYPE_FINGERPRINT; import static android.hardware.biometrics.BiometricConstants.BIOMETRIC_ERROR_CONTENT_VIEW_MORE_OPTIONS_BUTTON; import static android.hardware.biometrics.BiometricConstants.BIOMETRIC_ERROR_NEGATIVE_BUTTON; import static android.hardware.biometrics.BiometricPrompt.DISMISSED_REASON_BIOMETRIC_CONFIRMED; import static android.hardware.biometrics.BiometricPrompt.DISMISSED_REASON_BIOMETRIC_CONFIRM_NOT_REQUIRED; import static android.hardware.biometrics.BiometricPrompt.DISMISSED_REASON_CONTENT_VIEW_MORE_OPTIONS; import static android.hardware.biometrics.BiometricPrompt.DISMISSED_REASON_NEGATIVE; import static android.hardware.biometrics.BiometricPrompt.DISMISSED_REASON_USER_CANCEL; Loading Loading @@ -588,7 +590,7 @@ public class AuthSessionTest { } @Test public void testLogOnDialogDismissed_error() throws RemoteException { public void testLogOnDialogDismissed_negativeButton() throws RemoteException { final IBiometricAuthenticator faceAuthenticator = mock(IBiometricAuthenticator.class); setupFace(0 /* id */, false /* confirmationAlwaysRequired */, faceAuthenticator); Loading @@ -614,6 +616,33 @@ public class AuthSessionTest { eq(0) /* userId */); } @Test public void testLogOnDialogDismissed_contentViewMoreOptionsButton() throws RemoteException { final IBiometricAuthenticator faceAuthenticator = mock(IBiometricAuthenticator.class); setupFace(0 /* id */, false /* confirmationAlwaysRequired */, faceAuthenticator); final AuthSession session = createAuthSession(mSensors, false /* checkDevicePolicyManager */, Authenticators.BIOMETRIC_STRONG, TEST_REQUEST_ID, 0 /* operationId */, 0 /* userId */); session.goToInitialState(); assertEquals(STATE_AUTH_CALLED, session.getState()); session.onDialogDismissed(DISMISSED_REASON_CONTENT_VIEW_MORE_OPTIONS, null); verify(mBiometricFrameworkStatsLogger, times(1)).error( (OperationContextExt) anyObject(), eq(BiometricsProtoEnums.MODALITY_FACE), eq(BiometricsProtoEnums.ACTION_AUTHENTICATE), eq(BiometricsProtoEnums.CLIENT_BIOMETRIC_PROMPT), eq(false), anyLong(), eq(BIOMETRIC_ERROR_CONTENT_VIEW_MORE_OPTIONS_BUTTON), eq(0) /* vendorCode */, eq(0) /* userId */); } @Test public void onErrorReceivedAfterOnTryAgainPressedWhenSensorsAuthenticating() throws Exception { setupFingerprint(0 /* id */, FingerprintSensorProperties.TYPE_UDFPS_OPTICAL); Loading Loading
core/java/android/hardware/biometrics/BiometricConstants.java +10 −0 Original line number Diff line number Diff line Loading @@ -178,6 +178,15 @@ public interface BiometricConstants { @FlaggedApi(Flags.FLAG_IDENTITY_CHECK_API) int BIOMETRIC_ERROR_NOT_ENABLED_FOR_APPS = 21; /** * The user pressed the more options button on prompt content. This is a placeholder that is * currently only used by the support library. * * @hide */ int BIOMETRIC_ERROR_CONTENT_VIEW_MORE_OPTIONS_BUTTON = 22; /** * This constant is only used by SystemUI. It notifies SystemUI that authentication was paused * because the authentication attempt was unsuccessful. Loading Loading @@ -209,6 +218,7 @@ public interface BiometricConstants { BIOMETRIC_ERROR_SECURITY_UPDATE_REQUIRED, BIOMETRIC_ERROR_IDENTITY_CHECK_NOT_ACTIVE, BIOMETRIC_ERROR_NOT_ENABLED_FOR_APPS, BIOMETRIC_ERROR_CONTENT_VIEW_MORE_OPTIONS_BUTTON, BIOMETRIC_PAUSED_REJECTED}) @Retention(RetentionPolicy.SOURCE) @interface Errors {} Loading
services/core/java/com/android/server/biometrics/AuthSession.java +3 −0 Original line number Diff line number Diff line Loading @@ -803,6 +803,9 @@ public final class AuthSession implements IBinder.DeathRecipient { case BiometricPrompt.DISMISSED_REASON_USER_CANCEL: error = BiometricConstants.BIOMETRIC_ERROR_USER_CANCELED; break; case BiometricPrompt.DISMISSED_REASON_CONTENT_VIEW_MORE_OPTIONS: error = BiometricConstants.BIOMETRIC_ERROR_CONTENT_VIEW_MORE_OPTIONS_BUTTON; break; default: } Loading
services/tests/servicestests/src/com/android/server/biometrics/AuthSessionTest.java +30 −1 Original line number Diff line number Diff line Loading @@ -18,9 +18,11 @@ package com.android.server.biometrics; import static android.hardware.biometrics.BiometricAuthenticator.TYPE_FACE; import static android.hardware.biometrics.BiometricAuthenticator.TYPE_FINGERPRINT; import static android.hardware.biometrics.BiometricConstants.BIOMETRIC_ERROR_CONTENT_VIEW_MORE_OPTIONS_BUTTON; import static android.hardware.biometrics.BiometricConstants.BIOMETRIC_ERROR_NEGATIVE_BUTTON; import static android.hardware.biometrics.BiometricPrompt.DISMISSED_REASON_BIOMETRIC_CONFIRMED; import static android.hardware.biometrics.BiometricPrompt.DISMISSED_REASON_BIOMETRIC_CONFIRM_NOT_REQUIRED; import static android.hardware.biometrics.BiometricPrompt.DISMISSED_REASON_CONTENT_VIEW_MORE_OPTIONS; import static android.hardware.biometrics.BiometricPrompt.DISMISSED_REASON_NEGATIVE; import static android.hardware.biometrics.BiometricPrompt.DISMISSED_REASON_USER_CANCEL; Loading Loading @@ -588,7 +590,7 @@ public class AuthSessionTest { } @Test public void testLogOnDialogDismissed_error() throws RemoteException { public void testLogOnDialogDismissed_negativeButton() throws RemoteException { final IBiometricAuthenticator faceAuthenticator = mock(IBiometricAuthenticator.class); setupFace(0 /* id */, false /* confirmationAlwaysRequired */, faceAuthenticator); Loading @@ -614,6 +616,33 @@ public class AuthSessionTest { eq(0) /* userId */); } @Test public void testLogOnDialogDismissed_contentViewMoreOptionsButton() throws RemoteException { final IBiometricAuthenticator faceAuthenticator = mock(IBiometricAuthenticator.class); setupFace(0 /* id */, false /* confirmationAlwaysRequired */, faceAuthenticator); final AuthSession session = createAuthSession(mSensors, false /* checkDevicePolicyManager */, Authenticators.BIOMETRIC_STRONG, TEST_REQUEST_ID, 0 /* operationId */, 0 /* userId */); session.goToInitialState(); assertEquals(STATE_AUTH_CALLED, session.getState()); session.onDialogDismissed(DISMISSED_REASON_CONTENT_VIEW_MORE_OPTIONS, null); verify(mBiometricFrameworkStatsLogger, times(1)).error( (OperationContextExt) anyObject(), eq(BiometricsProtoEnums.MODALITY_FACE), eq(BiometricsProtoEnums.ACTION_AUTHENTICATE), eq(BiometricsProtoEnums.CLIENT_BIOMETRIC_PROMPT), eq(false), anyLong(), eq(BIOMETRIC_ERROR_CONTENT_VIEW_MORE_OPTIONS_BUTTON), eq(0) /* vendorCode */, eq(0) /* userId */); } @Test public void onErrorReceivedAfterOnTryAgainPressedWhenSensorsAuthenticating() throws Exception { setupFingerprint(0 /* id */, FingerprintSensorProperties.TYPE_UDFPS_OPTICAL); Loading