Loading core/java/android/hardware/biometrics/IBiometricServiceReceiverInternal.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ oneway interface IBiometricServiceReceiverInternal { // Notifies that a biometric has been acquired. void onAcquired(int acquiredInfo, String message); // Notifies that the SystemUI dialog has been dismissed. void onDialogDismissed(int reason); void onDialogDismissed(int reason, in byte[] credentialAttestation); // Notifies that the user has pressed the "try again" button on SystemUI void onTryAgainPressed(); // Notifies that the user has pressed the "use password" button on SystemUI Loading core/java/com/android/internal/statusbar/IStatusBar.aidl +2 −1 Original line number Diff line number Diff line Loading @@ -136,7 +136,8 @@ oneway interface IStatusBar // Used to show the authentication dialog (Biometrics, Device Credential) void showAuthenticationDialog(in Bundle bundle, IBiometricServiceReceiverInternal receiver, int biometricModality, boolean requireConfirmation, int userId, String opPackageName); int biometricModality, boolean requireConfirmation, int userId, String opPackageName, long operationId); // 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 Loading core/java/com/android/internal/statusbar/IStatusBarService.aidl +2 −1 Original line number Diff line number Diff line Loading @@ -105,7 +105,8 @@ interface IStatusBarService // Used to show the authentication dialog (Biometrics, Device Credential) void showAuthenticationDialog(in Bundle bundle, IBiometricServiceReceiverInternal receiver, int biometricModality, boolean requireConfirmation, int userId, String opPackageName); int biometricModality, boolean requireConfirmation, int userId, String opPackageName, long operationId); // 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 Loading packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java +12 −2 Original line number Diff line number Diff line Loading @@ -99,6 +99,8 @@ public class AuthContainerView extends LinearLayout // Non-null only if the dialog is in the act of dismissing and has not sent the reason yet. @Nullable @AuthDialogCallback.DismissedReason Integer mPendingCallbackReason; // HAT received from LockSettingsService when credential is verified. @Nullable byte[] mCredentialAttestation; static class Config { Context mContext; Loading @@ -109,6 +111,7 @@ public class AuthContainerView extends LinearLayout String mOpPackageName; int mModalityMask; boolean mSkipIntro; long mOperationId; } public static class Builder { Loading Loading @@ -149,6 +152,11 @@ public class AuthContainerView extends LinearLayout return this; } public Builder setOperationId(long operationId) { mConfig.mOperationId = operationId; return this; } public AuthContainerView build(int modalityMask) { mConfig.mModalityMask = modalityMask; return new AuthContainerView(mConfig, new Injector()); Loading Loading @@ -224,7 +232,8 @@ public class AuthContainerView extends LinearLayout final class CredentialCallback implements AuthCredentialView.Callback { @Override public void onCredentialMatched() { public void onCredentialMatched(byte[] attestation) { mCredentialAttestation = attestation; animateAway(AuthDialogCallback.DISMISSED_CREDENTIAL_AUTHENTICATED); } } Loading Loading @@ -341,6 +350,7 @@ public class AuthContainerView extends LinearLayout mCredentialView.setContainerView(this); mCredentialView.setUserId(mConfig.mUserId); mCredentialView.setOperationId(mConfig.mOperationId); mCredentialView.setEffectiveUserId(mEffectiveUserId); mCredentialView.setCredentialType(credentialType); mCredentialView.setCallback(mCredentialCallback); Loading Loading @@ -558,7 +568,7 @@ public class AuthContainerView extends LinearLayout private void sendPendingCallbackIfNotNull() { Log.d(TAG, "pendingCallback: " + mPendingCallbackReason); if (mPendingCallbackReason != null) { mConfig.mCallback.onDismissed(mPendingCallbackReason); mConfig.mCallback.onDismissed(mPendingCallbackReason, mCredentialAttestation); mPendingCallbackReason = null; } } Loading packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java +33 −16 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import static android.hardware.biometrics.BiometricAuthenticator.TYPE_FACE; import static android.hardware.biometrics.BiometricAuthenticator.TYPE_FINGERPRINT; import static android.hardware.biometrics.BiometricManager.Authenticators; import android.annotation.Nullable; import android.app.ActivityManager; import android.app.ActivityTaskManager; import android.app.IActivityTaskManager; Loading Loading @@ -99,7 +100,8 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks, try { if (mReceiver != null) { mReceiver.onDialogDismissed(BiometricPrompt.DISMISSED_REASON_USER_CANCEL); mReceiver.onDialogDismissed(BiometricPrompt.DISMISSED_REASON_USER_CANCEL, null /* credentialAttestation */); mReceiver = null; } } catch (RemoteException e) { Loading @@ -124,7 +126,8 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks, mCurrentDialog = null; if (mReceiver != null) { mReceiver.onDialogDismissed( BiometricPrompt.DISMISSED_REASON_USER_CANCEL); BiometricPrompt.DISMISSED_REASON_USER_CANCEL, null /* credentialAttestation */); mReceiver = null; } } Loading Loading @@ -162,35 +165,42 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks, } @Override public void onDismissed(@DismissedReason int reason) { public void onDismissed(@DismissedReason int reason, @Nullable byte[] credentialAttestation) { switch (reason) { case AuthDialogCallback.DISMISSED_USER_CANCELED: sendResultAndCleanUp(BiometricPrompt.DISMISSED_REASON_USER_CANCEL); sendResultAndCleanUp(BiometricPrompt.DISMISSED_REASON_USER_CANCEL, credentialAttestation); break; case AuthDialogCallback.DISMISSED_BUTTON_NEGATIVE: sendResultAndCleanUp(BiometricPrompt.DISMISSED_REASON_NEGATIVE); sendResultAndCleanUp(BiometricPrompt.DISMISSED_REASON_NEGATIVE, credentialAttestation); break; case AuthDialogCallback.DISMISSED_BUTTON_POSITIVE: sendResultAndCleanUp(BiometricPrompt.DISMISSED_REASON_BIOMETRIC_CONFIRMED); sendResultAndCleanUp(BiometricPrompt.DISMISSED_REASON_BIOMETRIC_CONFIRMED, credentialAttestation); break; case AuthDialogCallback.DISMISSED_BIOMETRIC_AUTHENTICATED: sendResultAndCleanUp( BiometricPrompt.DISMISSED_REASON_BIOMETRIC_CONFIRM_NOT_REQUIRED); BiometricPrompt.DISMISSED_REASON_BIOMETRIC_CONFIRM_NOT_REQUIRED, credentialAttestation); break; case AuthDialogCallback.DISMISSED_ERROR: sendResultAndCleanUp(BiometricPrompt.DISMISSED_REASON_ERROR); sendResultAndCleanUp(BiometricPrompt.DISMISSED_REASON_ERROR, credentialAttestation); break; case AuthDialogCallback.DISMISSED_BY_SYSTEM_SERVER: sendResultAndCleanUp(BiometricPrompt.DISMISSED_REASON_SERVER_REQUESTED); sendResultAndCleanUp(BiometricPrompt.DISMISSED_REASON_SERVER_REQUESTED, credentialAttestation); break; case AuthDialogCallback.DISMISSED_CREDENTIAL_AUTHENTICATED: sendResultAndCleanUp(BiometricPrompt.DISMISSED_REASON_CREDENTIAL_CONFIRMED); sendResultAndCleanUp(BiometricPrompt.DISMISSED_REASON_CREDENTIAL_CONFIRMED, credentialAttestation); break; default: Loading @@ -199,13 +209,14 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks, } } private void sendResultAndCleanUp(@DismissedReason int reason) { private void sendResultAndCleanUp(@DismissedReason int reason, @Nullable byte[] credentialAttestation) { if (mReceiver == null) { Log.e(TAG, "sendResultAndCleanUp: Receiver is null"); return; } try { mReceiver.onDialogDismissed(reason); mReceiver.onDialogDismissed(reason, credentialAttestation); } catch (RemoteException e) { Log.w(TAG, "Remote exception", e); } Loading Loading @@ -251,13 +262,15 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks, @Override public void showAuthenticationDialog(Bundle bundle, IBiometricServiceReceiverInternal receiver, int biometricModality, boolean requireConfirmation, int userId, String opPackageName) { int biometricModality, boolean requireConfirmation, int userId, String opPackageName, long operationId) { final int authenticators = Utils.getAuthenticators(bundle); if (DEBUG) { Log.d(TAG, "showAuthenticationDialog, authenticators: " + authenticators + ", biometricModality: " + biometricModality + ", requireConfirmation: " + requireConfirmation); + ", requireConfirmation: " + requireConfirmation + ", operationId: " + operationId); } SomeArgs args = SomeArgs.obtain(); args.arg1 = bundle; Loading @@ -266,6 +279,7 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks, args.arg3 = requireConfirmation; args.argi2 = userId; args.arg4 = opPackageName; args.arg5 = operationId; boolean skipAnimation = false; if (mCurrentDialog != null) { Loading Loading @@ -354,6 +368,7 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks, final boolean requireConfirmation = (boolean) args.arg3; final int userId = args.argi2; final String opPackageName = (String) args.arg4; final long operationId = (long) args.arg5; // Create a new dialog but do not replace the current one yet. final AuthDialog newDialog = buildDialog( Loading @@ -362,7 +377,8 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks, userId, type, opPackageName, skipAnimation); skipAnimation, operationId); if (newDialog == null) { Log.e(TAG, "Unsupported type: " + type); Loading Loading @@ -429,7 +445,7 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks, } protected AuthDialog buildDialog(Bundle biometricPromptBundle, boolean requireConfirmation, int userId, int type, String opPackageName, boolean skipIntro) { int userId, int type, String opPackageName, boolean skipIntro, long operationId) { return new AuthContainerView.Builder(mContext) .setCallback(this) .setBiometricPromptBundle(biometricPromptBundle) Loading @@ -437,6 +453,7 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks, .setUserId(userId) .setOpPackageName(opPackageName) .setSkipIntro(skipIntro) .setOperationId(operationId) .build(type); } } Loading
core/java/android/hardware/biometrics/IBiometricServiceReceiverInternal.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ oneway interface IBiometricServiceReceiverInternal { // Notifies that a biometric has been acquired. void onAcquired(int acquiredInfo, String message); // Notifies that the SystemUI dialog has been dismissed. void onDialogDismissed(int reason); void onDialogDismissed(int reason, in byte[] credentialAttestation); // Notifies that the user has pressed the "try again" button on SystemUI void onTryAgainPressed(); // Notifies that the user has pressed the "use password" button on SystemUI Loading
core/java/com/android/internal/statusbar/IStatusBar.aidl +2 −1 Original line number Diff line number Diff line Loading @@ -136,7 +136,8 @@ oneway interface IStatusBar // Used to show the authentication dialog (Biometrics, Device Credential) void showAuthenticationDialog(in Bundle bundle, IBiometricServiceReceiverInternal receiver, int biometricModality, boolean requireConfirmation, int userId, String opPackageName); int biometricModality, boolean requireConfirmation, int userId, String opPackageName, long operationId); // 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 Loading
core/java/com/android/internal/statusbar/IStatusBarService.aidl +2 −1 Original line number Diff line number Diff line Loading @@ -105,7 +105,8 @@ interface IStatusBarService // Used to show the authentication dialog (Biometrics, Device Credential) void showAuthenticationDialog(in Bundle bundle, IBiometricServiceReceiverInternal receiver, int biometricModality, boolean requireConfirmation, int userId, String opPackageName); int biometricModality, boolean requireConfirmation, int userId, String opPackageName, long operationId); // 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 Loading
packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java +12 −2 Original line number Diff line number Diff line Loading @@ -99,6 +99,8 @@ public class AuthContainerView extends LinearLayout // Non-null only if the dialog is in the act of dismissing and has not sent the reason yet. @Nullable @AuthDialogCallback.DismissedReason Integer mPendingCallbackReason; // HAT received from LockSettingsService when credential is verified. @Nullable byte[] mCredentialAttestation; static class Config { Context mContext; Loading @@ -109,6 +111,7 @@ public class AuthContainerView extends LinearLayout String mOpPackageName; int mModalityMask; boolean mSkipIntro; long mOperationId; } public static class Builder { Loading Loading @@ -149,6 +152,11 @@ public class AuthContainerView extends LinearLayout return this; } public Builder setOperationId(long operationId) { mConfig.mOperationId = operationId; return this; } public AuthContainerView build(int modalityMask) { mConfig.mModalityMask = modalityMask; return new AuthContainerView(mConfig, new Injector()); Loading Loading @@ -224,7 +232,8 @@ public class AuthContainerView extends LinearLayout final class CredentialCallback implements AuthCredentialView.Callback { @Override public void onCredentialMatched() { public void onCredentialMatched(byte[] attestation) { mCredentialAttestation = attestation; animateAway(AuthDialogCallback.DISMISSED_CREDENTIAL_AUTHENTICATED); } } Loading Loading @@ -341,6 +350,7 @@ public class AuthContainerView extends LinearLayout mCredentialView.setContainerView(this); mCredentialView.setUserId(mConfig.mUserId); mCredentialView.setOperationId(mConfig.mOperationId); mCredentialView.setEffectiveUserId(mEffectiveUserId); mCredentialView.setCredentialType(credentialType); mCredentialView.setCallback(mCredentialCallback); Loading Loading @@ -558,7 +568,7 @@ public class AuthContainerView extends LinearLayout private void sendPendingCallbackIfNotNull() { Log.d(TAG, "pendingCallback: " + mPendingCallbackReason); if (mPendingCallbackReason != null) { mConfig.mCallback.onDismissed(mPendingCallbackReason); mConfig.mCallback.onDismissed(mPendingCallbackReason, mCredentialAttestation); mPendingCallbackReason = null; } } Loading
packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java +33 −16 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import static android.hardware.biometrics.BiometricAuthenticator.TYPE_FACE; import static android.hardware.biometrics.BiometricAuthenticator.TYPE_FINGERPRINT; import static android.hardware.biometrics.BiometricManager.Authenticators; import android.annotation.Nullable; import android.app.ActivityManager; import android.app.ActivityTaskManager; import android.app.IActivityTaskManager; Loading Loading @@ -99,7 +100,8 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks, try { if (mReceiver != null) { mReceiver.onDialogDismissed(BiometricPrompt.DISMISSED_REASON_USER_CANCEL); mReceiver.onDialogDismissed(BiometricPrompt.DISMISSED_REASON_USER_CANCEL, null /* credentialAttestation */); mReceiver = null; } } catch (RemoteException e) { Loading @@ -124,7 +126,8 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks, mCurrentDialog = null; if (mReceiver != null) { mReceiver.onDialogDismissed( BiometricPrompt.DISMISSED_REASON_USER_CANCEL); BiometricPrompt.DISMISSED_REASON_USER_CANCEL, null /* credentialAttestation */); mReceiver = null; } } Loading Loading @@ -162,35 +165,42 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks, } @Override public void onDismissed(@DismissedReason int reason) { public void onDismissed(@DismissedReason int reason, @Nullable byte[] credentialAttestation) { switch (reason) { case AuthDialogCallback.DISMISSED_USER_CANCELED: sendResultAndCleanUp(BiometricPrompt.DISMISSED_REASON_USER_CANCEL); sendResultAndCleanUp(BiometricPrompt.DISMISSED_REASON_USER_CANCEL, credentialAttestation); break; case AuthDialogCallback.DISMISSED_BUTTON_NEGATIVE: sendResultAndCleanUp(BiometricPrompt.DISMISSED_REASON_NEGATIVE); sendResultAndCleanUp(BiometricPrompt.DISMISSED_REASON_NEGATIVE, credentialAttestation); break; case AuthDialogCallback.DISMISSED_BUTTON_POSITIVE: sendResultAndCleanUp(BiometricPrompt.DISMISSED_REASON_BIOMETRIC_CONFIRMED); sendResultAndCleanUp(BiometricPrompt.DISMISSED_REASON_BIOMETRIC_CONFIRMED, credentialAttestation); break; case AuthDialogCallback.DISMISSED_BIOMETRIC_AUTHENTICATED: sendResultAndCleanUp( BiometricPrompt.DISMISSED_REASON_BIOMETRIC_CONFIRM_NOT_REQUIRED); BiometricPrompt.DISMISSED_REASON_BIOMETRIC_CONFIRM_NOT_REQUIRED, credentialAttestation); break; case AuthDialogCallback.DISMISSED_ERROR: sendResultAndCleanUp(BiometricPrompt.DISMISSED_REASON_ERROR); sendResultAndCleanUp(BiometricPrompt.DISMISSED_REASON_ERROR, credentialAttestation); break; case AuthDialogCallback.DISMISSED_BY_SYSTEM_SERVER: sendResultAndCleanUp(BiometricPrompt.DISMISSED_REASON_SERVER_REQUESTED); sendResultAndCleanUp(BiometricPrompt.DISMISSED_REASON_SERVER_REQUESTED, credentialAttestation); break; case AuthDialogCallback.DISMISSED_CREDENTIAL_AUTHENTICATED: sendResultAndCleanUp(BiometricPrompt.DISMISSED_REASON_CREDENTIAL_CONFIRMED); sendResultAndCleanUp(BiometricPrompt.DISMISSED_REASON_CREDENTIAL_CONFIRMED, credentialAttestation); break; default: Loading @@ -199,13 +209,14 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks, } } private void sendResultAndCleanUp(@DismissedReason int reason) { private void sendResultAndCleanUp(@DismissedReason int reason, @Nullable byte[] credentialAttestation) { if (mReceiver == null) { Log.e(TAG, "sendResultAndCleanUp: Receiver is null"); return; } try { mReceiver.onDialogDismissed(reason); mReceiver.onDialogDismissed(reason, credentialAttestation); } catch (RemoteException e) { Log.w(TAG, "Remote exception", e); } Loading Loading @@ -251,13 +262,15 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks, @Override public void showAuthenticationDialog(Bundle bundle, IBiometricServiceReceiverInternal receiver, int biometricModality, boolean requireConfirmation, int userId, String opPackageName) { int biometricModality, boolean requireConfirmation, int userId, String opPackageName, long operationId) { final int authenticators = Utils.getAuthenticators(bundle); if (DEBUG) { Log.d(TAG, "showAuthenticationDialog, authenticators: " + authenticators + ", biometricModality: " + biometricModality + ", requireConfirmation: " + requireConfirmation); + ", requireConfirmation: " + requireConfirmation + ", operationId: " + operationId); } SomeArgs args = SomeArgs.obtain(); args.arg1 = bundle; Loading @@ -266,6 +279,7 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks, args.arg3 = requireConfirmation; args.argi2 = userId; args.arg4 = opPackageName; args.arg5 = operationId; boolean skipAnimation = false; if (mCurrentDialog != null) { Loading Loading @@ -354,6 +368,7 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks, final boolean requireConfirmation = (boolean) args.arg3; final int userId = args.argi2; final String opPackageName = (String) args.arg4; final long operationId = (long) args.arg5; // Create a new dialog but do not replace the current one yet. final AuthDialog newDialog = buildDialog( Loading @@ -362,7 +377,8 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks, userId, type, opPackageName, skipAnimation); skipAnimation, operationId); if (newDialog == null) { Log.e(TAG, "Unsupported type: " + type); Loading Loading @@ -429,7 +445,7 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks, } protected AuthDialog buildDialog(Bundle biometricPromptBundle, boolean requireConfirmation, int userId, int type, String opPackageName, boolean skipIntro) { int userId, int type, String opPackageName, boolean skipIntro, long operationId) { return new AuthContainerView.Builder(mContext) .setCallback(this) .setBiometricPromptBundle(biometricPromptBundle) Loading @@ -437,6 +453,7 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks, .setUserId(userId) .setOpPackageName(opPackageName) .setSkipIntro(skipIntro) .setOperationId(operationId) .build(type); } }