diff options
12 files changed, 19 insertions, 19 deletions
diff --git a/core/java/android/hardware/biometrics/IBiometricAuthenticator.aidl b/core/java/android/hardware/biometrics/IBiometricAuthenticator.aidl index b4ebed704441..c1dd20d66d53 100644 --- a/core/java/android/hardware/biometrics/IBiometricAuthenticator.aidl +++ b/core/java/android/hardware/biometrics/IBiometricAuthenticator.aidl @@ -57,5 +57,5 @@ interface IBiometricAuthenticator { void setActiveUser(int uid); // Gets the authenticator ID representing the current set of enrolled templates - long getAuthenticatorId(); + long getAuthenticatorId(int callingUserId); } diff --git a/core/java/android/hardware/biometrics/IBiometricService.aidl b/core/java/android/hardware/biometrics/IBiometricService.aidl index 10295db38120..07f88c2fbea6 100644 --- a/core/java/android/hardware/biometrics/IBiometricService.aidl +++ b/core/java/android/hardware/biometrics/IBiometricService.aidl @@ -65,5 +65,5 @@ interface IBiometricService { // Get a list of AuthenticatorIDs for authenticators which have enrolled templates and meet // the requirements for integrating with Keystore. The AuthenticatorID are known in Keystore // land as SIDs, and are used during key generation. - long[] getAuthenticatorIds(); + long[] getAuthenticatorIds(int callingUserId); } diff --git a/core/java/android/hardware/face/IFaceService.aidl b/core/java/android/hardware/face/IFaceService.aidl index 03937e0276e6..e2ab529d1e86 100644 --- a/core/java/android/hardware/face/IFaceService.aidl +++ b/core/java/android/hardware/face/IFaceService.aidl @@ -85,7 +85,7 @@ interface IFaceService { // long getHardwareDevice(int i); // Gets the authenticator ID for face - long getAuthenticatorId(); + long getAuthenticatorId(int callingUserId); // Reset the lockout when user authenticates with strong auth (e.g. PIN, pattern or password) void resetLockout(in byte [] token); diff --git a/core/java/android/hardware/fingerprint/IFingerprintService.aidl b/core/java/android/hardware/fingerprint/IFingerprintService.aidl index 2507c840d0e9..c5c375543adc 100644 --- a/core/java/android/hardware/fingerprint/IFingerprintService.aidl +++ b/core/java/android/hardware/fingerprint/IFingerprintService.aidl @@ -89,7 +89,7 @@ interface IFingerprintService { // long getHardwareDevice(int i); // Gets the authenticator ID for fingerprint - long getAuthenticatorId(); + long getAuthenticatorId(int callingUserId); // Reset the timeout when user authenticates with strong auth (e.g. PIN, pattern or password) void resetTimeout(in byte [] cryptoToken); diff --git a/services/core/java/com/android/server/biometrics/AuthService.java b/services/core/java/com/android/server/biometrics/AuthService.java index a0876c063fb3..061972c5723a 100644 --- a/services/core/java/com/android/server/biometrics/AuthService.java +++ b/services/core/java/com/android/server/biometrics/AuthService.java @@ -290,9 +290,10 @@ public class AuthService extends SystemService { // The permission check should be restored once Android Keystore no longer invokes this // method from inside app processes. + final int callingUserId = UserHandle.getCallingUserId(); final long identity = Binder.clearCallingIdentity(); try { - return mBiometricService.getAuthenticatorIds(); + return mBiometricService.getAuthenticatorIds(callingUserId); } finally { Binder.restoreCallingIdentity(identity); } diff --git a/services/core/java/com/android/server/biometrics/BiometricService.java b/services/core/java/com/android/server/biometrics/BiometricService.java index 7e28e94a17bb..69d8c0a31103 100644 --- a/services/core/java/com/android/server/biometrics/BiometricService.java +++ b/services/core/java/com/android/server/biometrics/BiometricService.java @@ -855,13 +855,13 @@ public class BiometricService extends SystemService { } @Override // Binder call - public long[] getAuthenticatorIds() { + public long[] getAuthenticatorIds(int callingUserId) { checkInternalPermission(); final List<Long> ids = new ArrayList<>(); for (AuthenticatorWrapper authenticator : mAuthenticators) { try { - final long id = authenticator.impl.getAuthenticatorId(); + final long id = authenticator.impl.getAuthenticatorId(callingUserId); if (Utils.isAtLeastStrength(authenticator.getActualStrength(), Authenticators.BIOMETRIC_STRONG) && id != 0) { ids.add(id); diff --git a/services/core/java/com/android/server/biometrics/BiometricServiceBase.java b/services/core/java/com/android/server/biometrics/BiometricServiceBase.java index 808f8c21cc8d..0ebc1d281c1f 100644 --- a/services/core/java/com/android/server/biometrics/BiometricServiceBase.java +++ b/services/core/java/com/android/server/biometrics/BiometricServiceBase.java @@ -1246,9 +1246,8 @@ public abstract class BiometricServiceBase extends SystemService /*** * @return authenticator id for the calling user */ - protected long getAuthenticatorId() { - final int userId = getUserOrWorkProfileId(null /* clientPackage */, - UserHandle.getCallingUserId()); + protected long getAuthenticatorId(int callingUserId) { + final int userId = getUserOrWorkProfileId(null /* clientPackage */, callingUserId); return mAuthenticatorIds.getOrDefault(userId, 0L); } diff --git a/services/core/java/com/android/server/biometrics/face/FaceAuthenticator.java b/services/core/java/com/android/server/biometrics/face/FaceAuthenticator.java index 9d8fcc3421cb..405c54e3be63 100644 --- a/services/core/java/com/android/server/biometrics/face/FaceAuthenticator.java +++ b/services/core/java/com/android/server/biometrics/face/FaceAuthenticator.java @@ -74,7 +74,7 @@ public final class FaceAuthenticator extends IBiometricAuthenticator.Stub { } @Override - public long getAuthenticatorId() throws RemoteException { - return mFaceService.getAuthenticatorId(); + public long getAuthenticatorId(int callingUserId) throws RemoteException { + return mFaceService.getAuthenticatorId(callingUserId); } } diff --git a/services/core/java/com/android/server/biometrics/face/FaceService.java b/services/core/java/com/android/server/biometrics/face/FaceService.java index ad73b6491697..72e1bbbcba60 100644 --- a/services/core/java/com/android/server/biometrics/face/FaceService.java +++ b/services/core/java/com/android/server/biometrics/face/FaceService.java @@ -608,9 +608,9 @@ public class FaceService extends BiometricServiceBase { } @Override // Binder call - public long getAuthenticatorId() { + public long getAuthenticatorId(int callingUserId) { checkPermission(USE_BIOMETRIC_INTERNAL); - return FaceService.this.getAuthenticatorId(); + return FaceService.this.getAuthenticatorId(callingUserId); } @Override // Binder call diff --git a/services/core/java/com/android/server/biometrics/fingerprint/FingerprintAuthenticator.java b/services/core/java/com/android/server/biometrics/fingerprint/FingerprintAuthenticator.java index 4604752408ba..61ddadadd784 100644 --- a/services/core/java/com/android/server/biometrics/fingerprint/FingerprintAuthenticator.java +++ b/services/core/java/com/android/server/biometrics/fingerprint/FingerprintAuthenticator.java @@ -74,7 +74,7 @@ public final class FingerprintAuthenticator extends IBiometricAuthenticator.Stub } @Override - public long getAuthenticatorId() throws RemoteException { - return mFingerprintService.getAuthenticatorId(); + public long getAuthenticatorId(int callingUserId) throws RemoteException { + return mFingerprintService.getAuthenticatorId(callingUserId); } } diff --git a/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java b/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java index 8520f5aa0632..8a7752d07b6e 100644 --- a/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java +++ b/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java @@ -411,9 +411,9 @@ public class FingerprintService extends BiometricServiceBase { } @Override // Binder call - public long getAuthenticatorId() { + public long getAuthenticatorId(int callingUserId) { checkPermission(USE_BIOMETRIC_INTERNAL); - return FingerprintService.this.getAuthenticatorId(); + return FingerprintService.this.getAuthenticatorId(callingUserId); } @Override // Binder call diff --git a/services/core/java/com/android/server/biometrics/iris/IrisAuthenticator.java b/services/core/java/com/android/server/biometrics/iris/IrisAuthenticator.java index 6789a12d065f..03818ed94926 100644 --- a/services/core/java/com/android/server/biometrics/iris/IrisAuthenticator.java +++ b/services/core/java/com/android/server/biometrics/iris/IrisAuthenticator.java @@ -67,7 +67,7 @@ public final class IrisAuthenticator extends IBiometricAuthenticator.Stub { } @Override - public long getAuthenticatorId() throws RemoteException { + public long getAuthenticatorId(int callingUserId) throws RemoteException { return 0; } } |