Loading core/java/android/hardware/fingerprint/FingerprintManager.java +0 −20 Original line number Diff line number Diff line Loading @@ -849,26 +849,6 @@ public class FingerprintManager implements BiometricAuthenticator, BiometricFing return hasEnrolledFingerprints(userId); } /** * Checks if the specified user has enrollments in any of the specified sensors. * @hide */ @RequiresPermission(USE_BIOMETRIC_INTERNAL) public boolean hasEnrolledTemplatesForAnySensor(int userId, @NonNull List<FingerprintSensorPropertiesInternal> sensors) { if (mService == null) { Slog.w(TAG, "hasEnrolledTemplatesForAnySensor: no fingerprint service"); return false; } try { return mService.hasEnrolledTemplatesForAnySensor(userId, sensors, mContext.getOpPackageName()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * @hide */ Loading core/java/android/hardware/fingerprint/FingerprintStateListener.java +6 −1 Original line number Diff line number Diff line Loading @@ -49,5 +49,10 @@ public abstract class FingerprintStateListener extends IFingerprintStateListener * Defines behavior in response to state update * @param newState new state of fingerprint sensor */ public abstract void onStateChanged(@FingerprintStateListener.State int newState); public void onStateChanged(@FingerprintStateListener.State int newState) {}; /** * Invoked when enrollment state changes for the specified user */ public void onEnrollmentsChanged(int userId, int sensorId, boolean hasEnrollments) {}; } core/java/android/hardware/fingerprint/IFingerprintService.aidl +0 −3 Original line number Diff line number Diff line Loading @@ -120,9 +120,6 @@ interface IFingerprintService { // Determine if a user has at least one enrolled fingerprint. boolean hasEnrolledFingerprints(int sensorId, int userId, String opPackageName); // Determine if a user has at least one enrolled fingerprint in any of the specified sensors boolean hasEnrolledTemplatesForAnySensor(int userId, in List<FingerprintSensorPropertiesInternal> sensors, String opPackageName); // Return the LockoutTracker status for the specified user int getLockoutModeForUser(int sensorId, int userId); Loading core/java/android/hardware/fingerprint/IFingerprintStateListener.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -24,4 +24,5 @@ import android.hardware.fingerprint.Fingerprint; */ oneway interface IFingerprintStateListener { void onStateChanged(int newState); void onEnrollmentsChanged(int userId, int sensorId, boolean hasEnrollments); } packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java +25 −1 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ import android.hardware.face.FaceManager; import android.hardware.face.FaceSensorPropertiesInternal; import android.hardware.fingerprint.FingerprintManager; import android.hardware.fingerprint.FingerprintSensorPropertiesInternal; import android.hardware.fingerprint.FingerprintStateListener; import android.hardware.fingerprint.IFingerprintAuthenticatorsRegisteredCallback; import android.hardware.fingerprint.IUdfpsHbmListener; import android.os.Bundle; Loading @@ -49,6 +50,7 @@ import android.os.Handler; import android.os.Looper; import android.os.RemoteException; import android.util.Log; import android.util.SparseBooleanArray; import android.view.MotionEvent; import android.view.WindowManager; Loading Loading @@ -76,6 +78,9 @@ import kotlin.Unit; /** * Receives messages sent from {@link com.android.server.biometrics.BiometricService} and shows the * appropriate biometric UI (e.g. BiometricDialogView). * * Also coordinates biometric-related things, such as UDFPS, with * {@link com.android.keyguard.KeyguardUpdateMonitor} */ @SysUISingleton public class AuthController extends SystemUI implements CommandQueue.Callbacks, Loading Loading @@ -115,6 +120,8 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks, @Nullable private List<FingerprintSensorPropertiesInternal> mUdfpsProps; @Nullable private List<FingerprintSensorPropertiesInternal> mSidefpsProps; @NonNull private final SparseBooleanArray mUdfpsEnrolledForUser; private class BiometricTaskStackListener extends TaskStackListener { @Override public void onTaskStackChanged() { Loading @@ -122,6 +129,21 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks, } } private final FingerprintStateListener mFingerprintStateListener = new FingerprintStateListener() { @Override public void onEnrollmentsChanged(int userId, int sensorId, boolean hasEnrollments) { Log.d(TAG, "onEnrollmentsChanged, userId: " + userId + ", sensorId: " + sensorId + ", hasEnrollments: " + hasEnrollments); for (FingerprintSensorPropertiesInternal prop : mUdfpsProps) { if (prop.sensorId == sensorId) { mUdfpsEnrolledForUser.put(userId, hasEnrollments); } } } }; @NonNull private final IFingerprintAuthenticatorsRegisteredCallback mFingerprintAuthenticatorsRegisteredCallback = Loading Loading @@ -436,6 +458,7 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks, mUdfpsControllerFactory = udfpsControllerFactory; mSidefpsControllerFactory = sidefpsControllerFactory; mWindowManager = windowManager; mUdfpsEnrolledForUser = new SparseBooleanArray(); mOrientationListener = new BiometricOrientationEventListener(context, () -> { onOrientationChanged(); Loading Loading @@ -474,6 +497,7 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks, if (mFingerprintManager != null) { mFingerprintManager.addAuthenticatorsRegisteredCallback( mFingerprintAuthenticatorsRegisteredCallback); mFingerprintManager.registerFingerprintStateListener(mFingerprintStateListener); } mTaskStackListener = new BiometricTaskStackListener(); Loading Loading @@ -673,7 +697,7 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks, return false; } return mFingerprintManager.hasEnrolledTemplatesForAnySensor(userId, mUdfpsProps); return mUdfpsEnrolledForUser.get(userId); } private void showDialog(SomeArgs args, boolean skipAnimation, Bundle savedState) { Loading Loading
core/java/android/hardware/fingerprint/FingerprintManager.java +0 −20 Original line number Diff line number Diff line Loading @@ -849,26 +849,6 @@ public class FingerprintManager implements BiometricAuthenticator, BiometricFing return hasEnrolledFingerprints(userId); } /** * Checks if the specified user has enrollments in any of the specified sensors. * @hide */ @RequiresPermission(USE_BIOMETRIC_INTERNAL) public boolean hasEnrolledTemplatesForAnySensor(int userId, @NonNull List<FingerprintSensorPropertiesInternal> sensors) { if (mService == null) { Slog.w(TAG, "hasEnrolledTemplatesForAnySensor: no fingerprint service"); return false; } try { return mService.hasEnrolledTemplatesForAnySensor(userId, sensors, mContext.getOpPackageName()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * @hide */ Loading
core/java/android/hardware/fingerprint/FingerprintStateListener.java +6 −1 Original line number Diff line number Diff line Loading @@ -49,5 +49,10 @@ public abstract class FingerprintStateListener extends IFingerprintStateListener * Defines behavior in response to state update * @param newState new state of fingerprint sensor */ public abstract void onStateChanged(@FingerprintStateListener.State int newState); public void onStateChanged(@FingerprintStateListener.State int newState) {}; /** * Invoked when enrollment state changes for the specified user */ public void onEnrollmentsChanged(int userId, int sensorId, boolean hasEnrollments) {}; }
core/java/android/hardware/fingerprint/IFingerprintService.aidl +0 −3 Original line number Diff line number Diff line Loading @@ -120,9 +120,6 @@ interface IFingerprintService { // Determine if a user has at least one enrolled fingerprint. boolean hasEnrolledFingerprints(int sensorId, int userId, String opPackageName); // Determine if a user has at least one enrolled fingerprint in any of the specified sensors boolean hasEnrolledTemplatesForAnySensor(int userId, in List<FingerprintSensorPropertiesInternal> sensors, String opPackageName); // Return the LockoutTracker status for the specified user int getLockoutModeForUser(int sensorId, int userId); Loading
core/java/android/hardware/fingerprint/IFingerprintStateListener.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -24,4 +24,5 @@ import android.hardware.fingerprint.Fingerprint; */ oneway interface IFingerprintStateListener { void onStateChanged(int newState); void onEnrollmentsChanged(int userId, int sensorId, boolean hasEnrollments); }
packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java +25 −1 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ import android.hardware.face.FaceManager; import android.hardware.face.FaceSensorPropertiesInternal; import android.hardware.fingerprint.FingerprintManager; import android.hardware.fingerprint.FingerprintSensorPropertiesInternal; import android.hardware.fingerprint.FingerprintStateListener; import android.hardware.fingerprint.IFingerprintAuthenticatorsRegisteredCallback; import android.hardware.fingerprint.IUdfpsHbmListener; import android.os.Bundle; Loading @@ -49,6 +50,7 @@ import android.os.Handler; import android.os.Looper; import android.os.RemoteException; import android.util.Log; import android.util.SparseBooleanArray; import android.view.MotionEvent; import android.view.WindowManager; Loading Loading @@ -76,6 +78,9 @@ import kotlin.Unit; /** * Receives messages sent from {@link com.android.server.biometrics.BiometricService} and shows the * appropriate biometric UI (e.g. BiometricDialogView). * * Also coordinates biometric-related things, such as UDFPS, with * {@link com.android.keyguard.KeyguardUpdateMonitor} */ @SysUISingleton public class AuthController extends SystemUI implements CommandQueue.Callbacks, Loading Loading @@ -115,6 +120,8 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks, @Nullable private List<FingerprintSensorPropertiesInternal> mUdfpsProps; @Nullable private List<FingerprintSensorPropertiesInternal> mSidefpsProps; @NonNull private final SparseBooleanArray mUdfpsEnrolledForUser; private class BiometricTaskStackListener extends TaskStackListener { @Override public void onTaskStackChanged() { Loading @@ -122,6 +129,21 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks, } } private final FingerprintStateListener mFingerprintStateListener = new FingerprintStateListener() { @Override public void onEnrollmentsChanged(int userId, int sensorId, boolean hasEnrollments) { Log.d(TAG, "onEnrollmentsChanged, userId: " + userId + ", sensorId: " + sensorId + ", hasEnrollments: " + hasEnrollments); for (FingerprintSensorPropertiesInternal prop : mUdfpsProps) { if (prop.sensorId == sensorId) { mUdfpsEnrolledForUser.put(userId, hasEnrollments); } } } }; @NonNull private final IFingerprintAuthenticatorsRegisteredCallback mFingerprintAuthenticatorsRegisteredCallback = Loading Loading @@ -436,6 +458,7 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks, mUdfpsControllerFactory = udfpsControllerFactory; mSidefpsControllerFactory = sidefpsControllerFactory; mWindowManager = windowManager; mUdfpsEnrolledForUser = new SparseBooleanArray(); mOrientationListener = new BiometricOrientationEventListener(context, () -> { onOrientationChanged(); Loading Loading @@ -474,6 +497,7 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks, if (mFingerprintManager != null) { mFingerprintManager.addAuthenticatorsRegisteredCallback( mFingerprintAuthenticatorsRegisteredCallback); mFingerprintManager.registerFingerprintStateListener(mFingerprintStateListener); } mTaskStackListener = new BiometricTaskStackListener(); Loading Loading @@ -673,7 +697,7 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks, return false; } return mFingerprintManager.hasEnrolledTemplatesForAnySensor(userId, mUdfpsProps); return mUdfpsEnrolledForUser.get(userId); } private void showDialog(SomeArgs args, boolean skipAnimation, Bundle savedState) { Loading