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

Commit 96cefbd5 authored by Presubmit Automerger Backend's avatar Presubmit Automerger Backend Committed by Joshua Mccloskey
Browse files

[DO NOT MERGE] fpService#authWithPrompt uses correct user handle. 2p: c7934628

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19911498

Bug: 231932206
Change-Id: Id36b39057cc689ab11d32122c2fc8a2a473ee40a
parents e3a5eed1 c7934628
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -332,8 +332,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);
                            callingUserId, receiver, opPackageName);
                } catch (PackageManager.NameNotFoundException e) {
                } catch (PackageManager.NameNotFoundException e) {
                    Slog.e(TAG, "Invalid package", e);
                    Slog.e(TAG, "Invalid package", e);
                    return -1;
                    return -1;
@@ -347,13 +347,14 @@ 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) throws PackageManager.NameNotFoundException {
                final String opPackageName) throws PackageManager.NameNotFoundException {


            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)