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

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

Change-Id: Ib5e89d351b06bf06ce79c071834baaccb3c38fdd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Joshua Mccloskey
2022-06-02 23:29:47 +00:00
committed by Automerger Merge Worker

View File

@@ -345,8 +345,8 @@ public class FingerprintService extends SystemService {
if (!isKeyguard && !Utils.isSettings(getContext(), opPackageName)
&& sensorProps != null && sensorProps.isAnyUdfpsType()) {
try {
return authenticateWithPrompt(operationId, sensorProps, userId, receiver,
opPackageName, ignoreEnrollmentState);
return authenticateWithPrompt(operationId, sensorProps, callingUid,
callingUserId, receiver, opPackageName, ignoreEnrollmentState);
} catch (PackageManager.NameNotFoundException e) {
Slog.e(TAG, "Invalid package", e);
return -1;
@@ -360,6 +360,7 @@ public class FingerprintService extends SystemService {
private long authenticateWithPrompt(
final long operationId,
@NonNull final FingerprintSensorPropertiesInternal props,
final int uId,
final int userId,
final IFingerprintServiceReceiver receiver,
final String opPackageName,
@@ -367,7 +368,7 @@ public class FingerprintService extends SystemService {
final Context context = getUiContext();
final Context promptContext = context.createPackageContextAsUser(
opPackageName, 0 /* flags */, UserHandle.getUserHandleForUid(userId));
opPackageName, 0 /* flags */, UserHandle.getUserHandleForUid(uId));
final Executor executor = context.getMainExecutor();
final BiometricPrompt biometricPrompt = new BiometricPrompt.Builder(promptContext)