Loading core/java/android/hardware/biometrics/BiometricAuthenticator.java +2 −1 Original line number Diff line number Diff line Loading @@ -67,7 +67,8 @@ public interface BiometricAuthenticator { TYPE_NONE, TYPE_CREDENTIAL, TYPE_FINGERPRINT, TYPE_IRIS TYPE_IRIS, TYPE_FACE }) @Retention(RetentionPolicy.SOURCE) @interface Modality {} Loading core/java/com/android/internal/statusbar/IStatusBar.aidl +14 −6 Original line number Diff line number Diff line Loading @@ -143,17 +143,25 @@ oneway interface IStatusBar void showShutdownUi(boolean isReboot, String reason); // Used to show the authentication dialog (Biometrics, Device Credential) /** * Used to show the authentication dialog (Biometrics, Device Credential). */ void showAuthenticationDialog(in PromptInfo promptInfo, IBiometricSysuiReceiver sysuiReceiver, in int[] sensorIds, boolean credentialAllowed, boolean requireConfirmation, int userId, String opPackageName, long operationId, int multiSensorConfig); // Used to notify the authentication dialog that a biometric has been authenticated /** * Used to notify the authentication dialog that a biometric has been authenticated. */ void onBiometricAuthenticated(); // Used to set a temporary message, e.g. fingerprint not recognized, finger moved too fast, etc void onBiometricHelp(String message); // Used to show an error - the dialog will dismiss after a certain amount of time /** * Used to set a temporary message, e.g. fingerprint not recognized, finger moved too fast, etc. */ void onBiometricHelp(int modality, String message); /** Used to show an error - the dialog will dismiss after a certain amount of time. */ void onBiometricError(int modality, int error, int vendorCode); // Used to hide the authentication dialog, e.g. when the application cancels authentication /** * Used to hide the authentication dialog, e.g. when the application cancels authentication. */ void hideAuthenticationDialog(); /** Loading core/java/com/android/internal/statusbar/IStatusBarService.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -115,7 +115,7 @@ interface IStatusBarService // Used to notify the authentication dialog that a biometric has been authenticated void onBiometricAuthenticated(); // Used to set a temporary message, e.g. fingerprint not recognized, finger moved too fast, etc void onBiometricHelp(String message); void onBiometricHelp(int modality, String message); // Used to show an error - the dialog will dismiss after a certain amount of time void onBiometricError(int modality, int error, int vendorCode); // Used to hide the authentication dialog, e.g. when the application cancels authentication Loading packages/SystemUI/src/com/android/systemui/biometrics/AuthBiometricFaceToFingerprintView.java +16 −4 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ import static android.hardware.biometrics.BiometricAuthenticator.TYPE_FINGERPRIN import android.annotation.NonNull; import android.annotation.Nullable; import android.content.Context; import android.hardware.biometrics.BiometricAuthenticator; import android.hardware.biometrics.BiometricAuthenticator.Modality; import android.hardware.fingerprint.FingerprintSensorPropertiesInternal; import android.util.AttributeSet; import android.util.Log; Loading Loading @@ -87,9 +87,11 @@ public class AuthBiometricFaceToFingerprintView extends AuthBiometricFaceView { } } @BiometricAuthenticator.Modality private int mActiveSensorType = TYPE_FACE; @Modality private int mActiveSensorType = TYPE_FACE; @Nullable UdfpsDialogMeasureAdapter mUdfpsMeasureAdapter; @Nullable private UdfpsDialogMeasureAdapter mUdfpsMeasureAdapter; public AuthBiometricFaceToFingerprintView(Context context) { super(context); Loading Loading @@ -125,6 +127,16 @@ public class AuthBiometricFaceToFingerprintView extends AuthBiometricFaceView { return false; } @Override public void onAuthenticationFailed( @Modality int modality, @Nullable String failureReason) { if (modality == TYPE_FACE && mActiveSensorType == TYPE_FACE) { // switching from face -> fingerprint mode, suppress soft error messages failureReason = mContext.getString(R.string.fingerprint_dialog_use_fingerprint_instead); } super.onAuthenticationFailed(modality, failureReason); } @Override @BiometricState protected int getStateForAfterError() { Loading Loading @@ -155,7 +167,7 @@ public class AuthBiometricFaceToFingerprintView extends AuthBiometricFaceView { } @Override public void updateState(int newState) { public void updateState(@BiometricState int newState) { if (mState == STATE_HELP || mState == STATE_ERROR) { mActiveSensorType = TYPE_FINGERPRINT; Loading packages/SystemUI/src/com/android/systemui/biometrics/AuthBiometricFaceView.java +5 −2 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.content.Context; import android.graphics.drawable.Animatable2; import android.graphics.drawable.AnimatedVectorDrawable; import android.graphics.drawable.Drawable; import android.hardware.biometrics.BiometricAuthenticator.Modality; import android.os.Handler; import android.os.Looper; import android.util.AttributeSet; Loading @@ -29,6 +30,8 @@ import android.view.View; import android.widget.ImageView; import android.widget.TextView; import androidx.annotation.Nullable; import com.android.internal.annotations.VisibleForTesting; import com.android.systemui.R; Loading Loading @@ -206,7 +209,7 @@ public class AuthBiometricFaceView extends AuthBiometricView { } @Override public void onAuthenticationFailed(String failureReason) { public void onAuthenticationFailed(@Modality int modality, @Nullable String failureReason) { if (getSize() == AuthDialog.SIZE_MEDIUM) { if (supportsManualRetry()) { mTryAgainButton.setVisibility(View.VISIBLE); Loading @@ -216,7 +219,7 @@ public class AuthBiometricFaceView extends AuthBiometricView { // Do this last since we want to know if the button is being animated (in the case of // small -> medium dialog) super.onAuthenticationFailed(failureReason); super.onAuthenticationFailed(modality, failureReason); } private void resetErrorView() { Loading Loading
core/java/android/hardware/biometrics/BiometricAuthenticator.java +2 −1 Original line number Diff line number Diff line Loading @@ -67,7 +67,8 @@ public interface BiometricAuthenticator { TYPE_NONE, TYPE_CREDENTIAL, TYPE_FINGERPRINT, TYPE_IRIS TYPE_IRIS, TYPE_FACE }) @Retention(RetentionPolicy.SOURCE) @interface Modality {} Loading
core/java/com/android/internal/statusbar/IStatusBar.aidl +14 −6 Original line number Diff line number Diff line Loading @@ -143,17 +143,25 @@ oneway interface IStatusBar void showShutdownUi(boolean isReboot, String reason); // Used to show the authentication dialog (Biometrics, Device Credential) /** * Used to show the authentication dialog (Biometrics, Device Credential). */ void showAuthenticationDialog(in PromptInfo promptInfo, IBiometricSysuiReceiver sysuiReceiver, in int[] sensorIds, boolean credentialAllowed, boolean requireConfirmation, int userId, String opPackageName, long operationId, int multiSensorConfig); // Used to notify the authentication dialog that a biometric has been authenticated /** * Used to notify the authentication dialog that a biometric has been authenticated. */ void onBiometricAuthenticated(); // Used to set a temporary message, e.g. fingerprint not recognized, finger moved too fast, etc void onBiometricHelp(String message); // Used to show an error - the dialog will dismiss after a certain amount of time /** * Used to set a temporary message, e.g. fingerprint not recognized, finger moved too fast, etc. */ void onBiometricHelp(int modality, String message); /** Used to show an error - the dialog will dismiss after a certain amount of time. */ void onBiometricError(int modality, int error, int vendorCode); // Used to hide the authentication dialog, e.g. when the application cancels authentication /** * Used to hide the authentication dialog, e.g. when the application cancels authentication. */ void hideAuthenticationDialog(); /** Loading
core/java/com/android/internal/statusbar/IStatusBarService.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -115,7 +115,7 @@ interface IStatusBarService // Used to notify the authentication dialog that a biometric has been authenticated void onBiometricAuthenticated(); // Used to set a temporary message, e.g. fingerprint not recognized, finger moved too fast, etc void onBiometricHelp(String message); void onBiometricHelp(int modality, String message); // Used to show an error - the dialog will dismiss after a certain amount of time void onBiometricError(int modality, int error, int vendorCode); // Used to hide the authentication dialog, e.g. when the application cancels authentication Loading
packages/SystemUI/src/com/android/systemui/biometrics/AuthBiometricFaceToFingerprintView.java +16 −4 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ import static android.hardware.biometrics.BiometricAuthenticator.TYPE_FINGERPRIN import android.annotation.NonNull; import android.annotation.Nullable; import android.content.Context; import android.hardware.biometrics.BiometricAuthenticator; import android.hardware.biometrics.BiometricAuthenticator.Modality; import android.hardware.fingerprint.FingerprintSensorPropertiesInternal; import android.util.AttributeSet; import android.util.Log; Loading Loading @@ -87,9 +87,11 @@ public class AuthBiometricFaceToFingerprintView extends AuthBiometricFaceView { } } @BiometricAuthenticator.Modality private int mActiveSensorType = TYPE_FACE; @Modality private int mActiveSensorType = TYPE_FACE; @Nullable UdfpsDialogMeasureAdapter mUdfpsMeasureAdapter; @Nullable private UdfpsDialogMeasureAdapter mUdfpsMeasureAdapter; public AuthBiometricFaceToFingerprintView(Context context) { super(context); Loading Loading @@ -125,6 +127,16 @@ public class AuthBiometricFaceToFingerprintView extends AuthBiometricFaceView { return false; } @Override public void onAuthenticationFailed( @Modality int modality, @Nullable String failureReason) { if (modality == TYPE_FACE && mActiveSensorType == TYPE_FACE) { // switching from face -> fingerprint mode, suppress soft error messages failureReason = mContext.getString(R.string.fingerprint_dialog_use_fingerprint_instead); } super.onAuthenticationFailed(modality, failureReason); } @Override @BiometricState protected int getStateForAfterError() { Loading Loading @@ -155,7 +167,7 @@ public class AuthBiometricFaceToFingerprintView extends AuthBiometricFaceView { } @Override public void updateState(int newState) { public void updateState(@BiometricState int newState) { if (mState == STATE_HELP || mState == STATE_ERROR) { mActiveSensorType = TYPE_FINGERPRINT; Loading
packages/SystemUI/src/com/android/systemui/biometrics/AuthBiometricFaceView.java +5 −2 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.content.Context; import android.graphics.drawable.Animatable2; import android.graphics.drawable.AnimatedVectorDrawable; import android.graphics.drawable.Drawable; import android.hardware.biometrics.BiometricAuthenticator.Modality; import android.os.Handler; import android.os.Looper; import android.util.AttributeSet; Loading @@ -29,6 +30,8 @@ import android.view.View; import android.widget.ImageView; import android.widget.TextView; import androidx.annotation.Nullable; import com.android.internal.annotations.VisibleForTesting; import com.android.systemui.R; Loading Loading @@ -206,7 +209,7 @@ public class AuthBiometricFaceView extends AuthBiometricView { } @Override public void onAuthenticationFailed(String failureReason) { public void onAuthenticationFailed(@Modality int modality, @Nullable String failureReason) { if (getSize() == AuthDialog.SIZE_MEDIUM) { if (supportsManualRetry()) { mTryAgainButton.setVisibility(View.VISIBLE); Loading @@ -216,7 +219,7 @@ public class AuthBiometricFaceView extends AuthBiometricView { // Do this last since we want to know if the button is being animated (in the case of // small -> medium dialog) super.onAuthenticationFailed(failureReason); super.onAuthenticationFailed(modality, failureReason); } private void resetErrorView() { Loading