Loading core/java/android/hardware/biometrics/BiometricManager.java +19 −0 Original line number Diff line number Diff line Loading @@ -128,6 +128,25 @@ public class BiometricManager { } } /** * @hide * @param userId * @return */ @RequiresPermission(USE_BIOMETRIC_INTERNAL) public boolean hasEnrolledBiometrics(int userId) { if (mService != null) { try { return mService.hasEnrolledBiometrics(userId); } catch (RemoteException e) { Slog.w(TAG, "Remote exception in hasEnrolledBiometrics(): " + e); return false; } } else { return false; } } /** * Listens for changes to biometric eligibility on keyguard from user settings. * @param callback Loading core/java/android/hardware/biometrics/IBiometricService.aidl +3 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,9 @@ interface IBiometricService { // Checks if biometrics can be used. int canAuthenticate(String opPackageName, int userId); // Checks if any biometrics are enrolled. boolean hasEnrolledBiometrics(int userId); // Register callback for when keyguard biometric eligibility changes. void registerEnabledOnKeyguardCallback(IBiometricEnabledOnKeyguardCallback callback); Loading services/core/java/com/android/server/biometrics/BiometricService.java +17 −0 Original line number Diff line number Diff line Loading @@ -789,6 +789,23 @@ public class BiometricService extends SystemService { return error; } @Override public boolean hasEnrolledBiometrics(int userId) { checkInternalPermission(); final long ident = Binder.clearCallingIdentity(); try { for (int i = 0; i < mAuthenticators.size(); i++) { if (mAuthenticators.get(i).mAuthenticator.hasEnrolledTemplates(userId)) { return true; } } } finally { Binder.restoreCallingIdentity(ident); } return false; } @Override // Binder call public void registerEnabledOnKeyguardCallback(IBiometricEnabledOnKeyguardCallback callback) throws RemoteException { Loading services/core/java/com/android/server/locksettings/LockSettingsService.java +1 −1 Original line number Diff line number Diff line Loading @@ -446,7 +446,7 @@ public class LockSettingsService extends ILockSettings.Stub { public boolean hasEnrolledBiometrics(int userId) { BiometricManager bm = mContext.getSystemService(BiometricManager.class); return bm.canAuthenticate(userId) == BiometricManager.BIOMETRIC_SUCCESS; return bm.hasEnrolledBiometrics(userId); } public int binderGetCallingUid() { Loading Loading
core/java/android/hardware/biometrics/BiometricManager.java +19 −0 Original line number Diff line number Diff line Loading @@ -128,6 +128,25 @@ public class BiometricManager { } } /** * @hide * @param userId * @return */ @RequiresPermission(USE_BIOMETRIC_INTERNAL) public boolean hasEnrolledBiometrics(int userId) { if (mService != null) { try { return mService.hasEnrolledBiometrics(userId); } catch (RemoteException e) { Slog.w(TAG, "Remote exception in hasEnrolledBiometrics(): " + e); return false; } } else { return false; } } /** * Listens for changes to biometric eligibility on keyguard from user settings. * @param callback Loading
core/java/android/hardware/biometrics/IBiometricService.aidl +3 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,9 @@ interface IBiometricService { // Checks if biometrics can be used. int canAuthenticate(String opPackageName, int userId); // Checks if any biometrics are enrolled. boolean hasEnrolledBiometrics(int userId); // Register callback for when keyguard biometric eligibility changes. void registerEnabledOnKeyguardCallback(IBiometricEnabledOnKeyguardCallback callback); Loading
services/core/java/com/android/server/biometrics/BiometricService.java +17 −0 Original line number Diff line number Diff line Loading @@ -789,6 +789,23 @@ public class BiometricService extends SystemService { return error; } @Override public boolean hasEnrolledBiometrics(int userId) { checkInternalPermission(); final long ident = Binder.clearCallingIdentity(); try { for (int i = 0; i < mAuthenticators.size(); i++) { if (mAuthenticators.get(i).mAuthenticator.hasEnrolledTemplates(userId)) { return true; } } } finally { Binder.restoreCallingIdentity(ident); } return false; } @Override // Binder call public void registerEnabledOnKeyguardCallback(IBiometricEnabledOnKeyguardCallback callback) throws RemoteException { Loading
services/core/java/com/android/server/locksettings/LockSettingsService.java +1 −1 Original line number Diff line number Diff line Loading @@ -446,7 +446,7 @@ public class LockSettingsService extends ILockSettings.Stub { public boolean hasEnrolledBiometrics(int userId) { BiometricManager bm = mContext.getSystemService(BiometricManager.class); return bm.canAuthenticate(userId) == BiometricManager.BIOMETRIC_SUCCESS; return bm.hasEnrolledBiometrics(userId); } public int binderGetCallingUid() { Loading