Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3b9777b5 authored by Kevin Chyn's avatar Kevin Chyn
Browse files

Use userId instead of callingUserId

Fixes: 120329836

Test: 1) set up personal profile with password+fingerprint
      2) set up work profile with only password
      3) disable one lock
      4) open work profile version of biometric demo
      5) biometric prompt is not shown (as expected)

Test: BiometricManager#canAuthenticate() checks for the correct user ID
      for personal and work profile

Change-Id: If3e5d6446dc9f4ec056efd49f575302aadfbb9fd
parent 1519a9a9
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -653,7 +653,7 @@ public class BiometricService extends SystemService {
            }

            mHandler.post(() -> {
                final Pair<Integer, Integer> result = checkAndGetBiometricModality(callingUserId);
                final Pair<Integer, Integer> result = checkAndGetBiometricModality(userId);
                final int modality = result.first;
                final int error = result.second;

@@ -950,7 +950,7 @@ public class BiometricService extends SystemService {
     * {@link BiometricAuthenticator#TYPE_FACE}
     * and the error containing one of the {@link BiometricConstants} errors.
     */
    private Pair<Integer, Integer> checkAndGetBiometricModality(int callingUid) {
    private Pair<Integer, Integer> checkAndGetBiometricModality(int userId) {
        int modality = TYPE_NONE;

        // No biometric features, send error
@@ -979,7 +979,7 @@ public class BiometricService extends SystemService {
                    // order.
                    firstHwAvailable = modality;
                }
                if (authenticator.hasEnrolledTemplates(callingUid)) {
                if (authenticator.hasEnrolledTemplates(userId)) {
                    hasTemplatesEnrolled = true;
                    if (isEnabledForApp(modality)) {
                        // TODO(b/110907543): When face settings (and other settings) have both a