Use caller's user id for recent caller info

- retrieveServiceLocked used target service's user id and brought
  permission failure for persistent single-user services.

Bug: 185483916
Test: boot up car products and check no bind failure
Change-Id: I9b6ff17201f0cd93e2bb3ad219a5d71db34c98a6
This commit is contained in:
Keun young Park
2021-04-16 09:27:24 -07:00
parent ac6f5ee927
commit 699cbd988c

View File

@@ -3039,7 +3039,7 @@ public final class ActiveServices {
try {
r.mRecentCallerApplicationInfo =
mAm.mContext.getPackageManager().getApplicationInfoAsUser(callingPackage,
0, userId);
0, UserHandle.getUserId(callingUid));
} catch (PackageManager.NameNotFoundException e) {
}
if (!mAm.validateAssociationAllowedLocked(callingPackage, callingUid, r.packageName,