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

Commit e891733b authored by Joshua Mccloskey's avatar Joshua Mccloskey Committed by Android (Google) Code Review
Browse files

Merge "fpService#authWithPrompt uses correct user handle." into tm-dev

parents a8c73beb f3650a6d
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -345,8 +345,8 @@ public class FingerprintService extends SystemService {
            if (!isKeyguard && !Utils.isSettings(getContext(), opPackageName)
            if (!isKeyguard && !Utils.isSettings(getContext(), opPackageName)
                    && sensorProps != null && sensorProps.isAnyUdfpsType()) {
                    && sensorProps != null && sensorProps.isAnyUdfpsType()) {
                try {
                try {
                    return authenticateWithPrompt(operationId, sensorProps, userId, receiver,
                    return authenticateWithPrompt(operationId, sensorProps, callingUid,
                            opPackageName, ignoreEnrollmentState);
                            callingUserId, receiver, opPackageName, ignoreEnrollmentState);
                } catch (PackageManager.NameNotFoundException e) {
                } catch (PackageManager.NameNotFoundException e) {
                    Slog.e(TAG, "Invalid package", e);
                    Slog.e(TAG, "Invalid package", e);
                    return -1;
                    return -1;
@@ -360,6 +360,7 @@ public class FingerprintService extends SystemService {
        private long authenticateWithPrompt(
        private long authenticateWithPrompt(
                final long operationId,
                final long operationId,
                @NonNull final FingerprintSensorPropertiesInternal props,
                @NonNull final FingerprintSensorPropertiesInternal props,
                final int uId,
                final int userId,
                final int userId,
                final IFingerprintServiceReceiver receiver,
                final IFingerprintServiceReceiver receiver,
                final String opPackageName,
                final String opPackageName,
@@ -367,7 +368,7 @@ public class FingerprintService extends SystemService {


            final Context context = getUiContext();
            final Context context = getUiContext();
            final Context promptContext = context.createPackageContextAsUser(
            final Context promptContext = context.createPackageContextAsUser(
                    opPackageName, 0 /* flags */, UserHandle.getUserHandleForUid(userId));
                    opPackageName, 0 /* flags */, UserHandle.getUserHandleForUid(uId));
            final Executor executor = context.getMainExecutor();
            final Executor executor = context.getMainExecutor();


            final BiometricPrompt biometricPrompt = new BiometricPrompt.Builder(promptContext)
            final BiometricPrompt biometricPrompt = new BiometricPrompt.Builder(promptContext)