Loading core/java/com/android/internal/statusbar/IStatusBar.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -153,7 +153,7 @@ oneway interface IStatusBar void showBiometricDialog(in Bundle bundle, IBiometricServiceReceiverInternal receiver, int type, boolean requireConfirmation, int userId); // Used to hide the dialog when a biometric is authenticated void onBiometricAuthenticated(boolean authenticated); void onBiometricAuthenticated(boolean authenticated, String failureReason); // Used to set a temporary message, e.g. fingerprint not recognized, finger moved too fast, etc void onBiometricHelp(String message); // Used to set a message - the dialog will dismiss after a certain amount of time Loading core/java/com/android/internal/statusbar/IStatusBarService.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -103,7 +103,7 @@ interface IStatusBarService void showBiometricDialog(in Bundle bundle, IBiometricServiceReceiverInternal receiver, int type, boolean requireConfirmation, int userId); // Used to hide the dialog when a biometric is authenticated void onBiometricAuthenticated(boolean authenticated); void onBiometricAuthenticated(boolean authenticated, String failureReason); // Used to set a temporary message, e.g. fingerprint not recognized, finger moved too fast, etc void onBiometricHelp(String message); // Used to set a message - the dialog will dismiss after a certain amount of time Loading packages/SystemUI/src/com/android/systemui/biometrics/BiometricDialogImpl.java +20 −11 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.hardware.biometrics.BiometricPrompt; import android.hardware.biometrics.IBiometricServiceReceiverInternal; import android.os.Bundle; import android.os.Handler; import android.os.Looper; import android.os.Message; import android.os.RemoteException; import android.util.Log; Loading Loading @@ -58,7 +59,7 @@ public class BiometricDialogImpl extends SystemUI implements CommandQueue.Callba private boolean mDialogShowing; private Callback mCallback = new Callback(); private Handler mHandler = new Handler() { private Handler mHandler = new Handler(Looper.getMainLooper()) { @Override public void handleMessage(Message msg) { switch(msg.what) { Loading @@ -66,15 +67,20 @@ public class BiometricDialogImpl extends SystemUI implements CommandQueue.Callba handleShowDialog((SomeArgs) msg.obj, false /* skipAnimation */, null /* savedState */); break; case MSG_BIOMETRIC_AUTHENTICATED: handleBiometricAuthenticated((boolean) msg.obj); case MSG_BIOMETRIC_AUTHENTICATED: { SomeArgs args = (SomeArgs) msg.obj; handleBiometricAuthenticated((boolean) args.arg1 /* authenticated */, (String) args.arg2 /* failureReason */); args.recycle(); break; case MSG_BIOMETRIC_HELP: } case MSG_BIOMETRIC_HELP: { SomeArgs args = (SomeArgs) msg.obj; handleBiometricHelp((String) args.arg1 /* message */, (boolean) args.arg2 /* requireTryAgain */); args.recycle(); break; } case MSG_BIOMETRIC_ERROR: handleBiometricError((String) msg.obj); break; Loading Loading @@ -161,9 +167,14 @@ public class BiometricDialogImpl extends SystemUI implements CommandQueue.Callba } @Override public void onBiometricAuthenticated(boolean authenticated) { if (DEBUG) Log.d(TAG, "onBiometricAuthenticated: " + authenticated); mHandler.obtainMessage(MSG_BIOMETRIC_AUTHENTICATED, authenticated).sendToTarget(); public void onBiometricAuthenticated(boolean authenticated, String failureReason) { if (DEBUG) Log.d(TAG, "onBiometricAuthenticated: " + authenticated + " reason: " + failureReason); SomeArgs args = SomeArgs.obtain(); args.arg1 = authenticated; args.arg2 = failureReason; mHandler.obtainMessage(MSG_BIOMETRIC_AUTHENTICATED, args).sendToTarget(); } @Override Loading Loading @@ -230,7 +241,7 @@ public class BiometricDialogImpl extends SystemUI implements CommandQueue.Callba mDialogShowing = true; } private void handleBiometricAuthenticated(boolean authenticated) { private void handleBiometricAuthenticated(boolean authenticated, String failureReason) { if (DEBUG) Log.d(TAG, "handleBiometricAuthenticated: " + authenticated); if (authenticated) { Loading @@ -246,9 +257,7 @@ public class BiometricDialogImpl extends SystemUI implements CommandQueue.Callba }, mCurrentDialog.getDelayAfterAuthenticatedDurationMs()); } } else { handleBiometricHelp(mContext.getResources() .getString(com.android.internal.R.string.biometric_not_recognized), true /* requireTryAgain */); handleBiometricHelp(failureReason, true /* requireTryAgain */); mCurrentDialog.showTryAgainButton(true /* show */); } } Loading packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java +15 −6 Original line number Diff line number Diff line Loading @@ -280,7 +280,7 @@ public class CommandQueue extends IStatusBar.Stub implements CallbackController< default void showBiometricDialog(Bundle bundle, IBiometricServiceReceiverInternal receiver, int type, boolean requireConfirmation, int userId) { } default void onBiometricAuthenticated(boolean authenticated) { } default void onBiometricAuthenticated(boolean authenticated, String failureReason) { } default void onBiometricHelp(String message) { } default void onBiometricError(String error) { } default void hideBiometricDialog() { } Loading Loading @@ -760,9 +760,12 @@ public class CommandQueue extends IStatusBar.Stub implements CallbackController< } @Override public void onBiometricAuthenticated(boolean authenticated) { public void onBiometricAuthenticated(boolean authenticated, String failureReason) { synchronized (mLock) { mHandler.obtainMessage(MSG_BIOMETRIC_AUTHENTICATED, authenticated).sendToTarget(); SomeArgs args = SomeArgs.obtain(); args.arg1 = authenticated; args.arg2 = failureReason; mHandler.obtainMessage(MSG_BIOMETRIC_AUTHENTICATED, args).sendToTarget(); } } Loading Loading @@ -1023,7 +1026,7 @@ public class CommandQueue extends IStatusBar.Stub implements CallbackController< mCallbacks.get(i).onRotationProposal(msg.arg1, msg.arg2 != 0); } break; case MSG_BIOMETRIC_SHOW: case MSG_BIOMETRIC_SHOW: { mHandler.removeMessages(MSG_BIOMETRIC_ERROR); mHandler.removeMessages(MSG_BIOMETRIC_HELP); mHandler.removeMessages(MSG_BIOMETRIC_AUTHENTICATED); Loading @@ -1038,11 +1041,17 @@ public class CommandQueue extends IStatusBar.Stub implements CallbackController< } someArgs.recycle(); break; case MSG_BIOMETRIC_AUTHENTICATED: } case MSG_BIOMETRIC_AUTHENTICATED: { SomeArgs someArgs = (SomeArgs) msg.obj; for (int i = 0; i < mCallbacks.size(); i++) { mCallbacks.get(i).onBiometricAuthenticated((boolean) msg.obj); mCallbacks.get(i).onBiometricAuthenticated( (boolean) someArgs.arg1 /* authenticated */, (String) someArgs.arg2 /* failureReason */); } someArgs.recycle(); break; } case MSG_BIOMETRIC_HELP: for (int i = 0; i < mCallbacks.size(); i++) { mCallbacks.get(i).onBiometricHelp((String) msg.obj); Loading services/core/java/com/android/server/biometrics/AuthenticationClient.java +1 −0 Original line number Diff line number Diff line Loading @@ -104,6 +104,7 @@ public abstract class AuthenticationClient extends ClientMonitor { public boolean onError(long deviceId, int error, int vendorCode) { if (!shouldFrameworkHandleLockout()) { switch (error) { case BiometricConstants.BIOMETRIC_ERROR_TIMEOUT: case BiometricConstants.BIOMETRIC_ERROR_LOCKOUT: case BiometricConstants.BIOMETRIC_ERROR_LOCKOUT_PERMANENT: if (mStarted) { Loading Loading
core/java/com/android/internal/statusbar/IStatusBar.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -153,7 +153,7 @@ oneway interface IStatusBar void showBiometricDialog(in Bundle bundle, IBiometricServiceReceiverInternal receiver, int type, boolean requireConfirmation, int userId); // Used to hide the dialog when a biometric is authenticated void onBiometricAuthenticated(boolean authenticated); void onBiometricAuthenticated(boolean authenticated, String failureReason); // Used to set a temporary message, e.g. fingerprint not recognized, finger moved too fast, etc void onBiometricHelp(String message); // Used to set a message - the dialog will dismiss after a certain amount of time Loading
core/java/com/android/internal/statusbar/IStatusBarService.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -103,7 +103,7 @@ interface IStatusBarService void showBiometricDialog(in Bundle bundle, IBiometricServiceReceiverInternal receiver, int type, boolean requireConfirmation, int userId); // Used to hide the dialog when a biometric is authenticated void onBiometricAuthenticated(boolean authenticated); void onBiometricAuthenticated(boolean authenticated, String failureReason); // Used to set a temporary message, e.g. fingerprint not recognized, finger moved too fast, etc void onBiometricHelp(String message); // Used to set a message - the dialog will dismiss after a certain amount of time Loading
packages/SystemUI/src/com/android/systemui/biometrics/BiometricDialogImpl.java +20 −11 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.hardware.biometrics.BiometricPrompt; import android.hardware.biometrics.IBiometricServiceReceiverInternal; import android.os.Bundle; import android.os.Handler; import android.os.Looper; import android.os.Message; import android.os.RemoteException; import android.util.Log; Loading Loading @@ -58,7 +59,7 @@ public class BiometricDialogImpl extends SystemUI implements CommandQueue.Callba private boolean mDialogShowing; private Callback mCallback = new Callback(); private Handler mHandler = new Handler() { private Handler mHandler = new Handler(Looper.getMainLooper()) { @Override public void handleMessage(Message msg) { switch(msg.what) { Loading @@ -66,15 +67,20 @@ public class BiometricDialogImpl extends SystemUI implements CommandQueue.Callba handleShowDialog((SomeArgs) msg.obj, false /* skipAnimation */, null /* savedState */); break; case MSG_BIOMETRIC_AUTHENTICATED: handleBiometricAuthenticated((boolean) msg.obj); case MSG_BIOMETRIC_AUTHENTICATED: { SomeArgs args = (SomeArgs) msg.obj; handleBiometricAuthenticated((boolean) args.arg1 /* authenticated */, (String) args.arg2 /* failureReason */); args.recycle(); break; case MSG_BIOMETRIC_HELP: } case MSG_BIOMETRIC_HELP: { SomeArgs args = (SomeArgs) msg.obj; handleBiometricHelp((String) args.arg1 /* message */, (boolean) args.arg2 /* requireTryAgain */); args.recycle(); break; } case MSG_BIOMETRIC_ERROR: handleBiometricError((String) msg.obj); break; Loading Loading @@ -161,9 +167,14 @@ public class BiometricDialogImpl extends SystemUI implements CommandQueue.Callba } @Override public void onBiometricAuthenticated(boolean authenticated) { if (DEBUG) Log.d(TAG, "onBiometricAuthenticated: " + authenticated); mHandler.obtainMessage(MSG_BIOMETRIC_AUTHENTICATED, authenticated).sendToTarget(); public void onBiometricAuthenticated(boolean authenticated, String failureReason) { if (DEBUG) Log.d(TAG, "onBiometricAuthenticated: " + authenticated + " reason: " + failureReason); SomeArgs args = SomeArgs.obtain(); args.arg1 = authenticated; args.arg2 = failureReason; mHandler.obtainMessage(MSG_BIOMETRIC_AUTHENTICATED, args).sendToTarget(); } @Override Loading Loading @@ -230,7 +241,7 @@ public class BiometricDialogImpl extends SystemUI implements CommandQueue.Callba mDialogShowing = true; } private void handleBiometricAuthenticated(boolean authenticated) { private void handleBiometricAuthenticated(boolean authenticated, String failureReason) { if (DEBUG) Log.d(TAG, "handleBiometricAuthenticated: " + authenticated); if (authenticated) { Loading @@ -246,9 +257,7 @@ public class BiometricDialogImpl extends SystemUI implements CommandQueue.Callba }, mCurrentDialog.getDelayAfterAuthenticatedDurationMs()); } } else { handleBiometricHelp(mContext.getResources() .getString(com.android.internal.R.string.biometric_not_recognized), true /* requireTryAgain */); handleBiometricHelp(failureReason, true /* requireTryAgain */); mCurrentDialog.showTryAgainButton(true /* show */); } } Loading
packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java +15 −6 Original line number Diff line number Diff line Loading @@ -280,7 +280,7 @@ public class CommandQueue extends IStatusBar.Stub implements CallbackController< default void showBiometricDialog(Bundle bundle, IBiometricServiceReceiverInternal receiver, int type, boolean requireConfirmation, int userId) { } default void onBiometricAuthenticated(boolean authenticated) { } default void onBiometricAuthenticated(boolean authenticated, String failureReason) { } default void onBiometricHelp(String message) { } default void onBiometricError(String error) { } default void hideBiometricDialog() { } Loading Loading @@ -760,9 +760,12 @@ public class CommandQueue extends IStatusBar.Stub implements CallbackController< } @Override public void onBiometricAuthenticated(boolean authenticated) { public void onBiometricAuthenticated(boolean authenticated, String failureReason) { synchronized (mLock) { mHandler.obtainMessage(MSG_BIOMETRIC_AUTHENTICATED, authenticated).sendToTarget(); SomeArgs args = SomeArgs.obtain(); args.arg1 = authenticated; args.arg2 = failureReason; mHandler.obtainMessage(MSG_BIOMETRIC_AUTHENTICATED, args).sendToTarget(); } } Loading Loading @@ -1023,7 +1026,7 @@ public class CommandQueue extends IStatusBar.Stub implements CallbackController< mCallbacks.get(i).onRotationProposal(msg.arg1, msg.arg2 != 0); } break; case MSG_BIOMETRIC_SHOW: case MSG_BIOMETRIC_SHOW: { mHandler.removeMessages(MSG_BIOMETRIC_ERROR); mHandler.removeMessages(MSG_BIOMETRIC_HELP); mHandler.removeMessages(MSG_BIOMETRIC_AUTHENTICATED); Loading @@ -1038,11 +1041,17 @@ public class CommandQueue extends IStatusBar.Stub implements CallbackController< } someArgs.recycle(); break; case MSG_BIOMETRIC_AUTHENTICATED: } case MSG_BIOMETRIC_AUTHENTICATED: { SomeArgs someArgs = (SomeArgs) msg.obj; for (int i = 0; i < mCallbacks.size(); i++) { mCallbacks.get(i).onBiometricAuthenticated((boolean) msg.obj); mCallbacks.get(i).onBiometricAuthenticated( (boolean) someArgs.arg1 /* authenticated */, (String) someArgs.arg2 /* failureReason */); } someArgs.recycle(); break; } case MSG_BIOMETRIC_HELP: for (int i = 0; i < mCallbacks.size(); i++) { mCallbacks.get(i).onBiometricHelp((String) msg.obj); Loading
services/core/java/com/android/server/biometrics/AuthenticationClient.java +1 −0 Original line number Diff line number Diff line Loading @@ -104,6 +104,7 @@ public abstract class AuthenticationClient extends ClientMonitor { public boolean onError(long deviceId, int error, int vendorCode) { if (!shouldFrameworkHandleLockout()) { switch (error) { case BiometricConstants.BIOMETRIC_ERROR_TIMEOUT: case BiometricConstants.BIOMETRIC_ERROR_LOCKOUT: case BiometricConstants.BIOMETRIC_ERROR_LOCKOUT_PERMANENT: if (mStarted) { Loading