From 699cbd988cc4184af84049facb1da7271f799ef8 Mon Sep 17 00:00:00 2001 From: Keun young Park Date: Fri, 16 Apr 2021 09:27:24 -0700 Subject: [PATCH] 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 --- services/core/java/com/android/server/am/ActiveServices.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/am/ActiveServices.java b/services/core/java/com/android/server/am/ActiveServices.java index 4324717a7938c..5a1a505d7aa80 100644 --- a/services/core/java/com/android/server/am/ActiveServices.java +++ b/services/core/java/com/android/server/am/ActiveServices.java @@ -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,