diff options
| author | 2020-05-29 09:14:45 -0700 | |
|---|---|---|
| committer | 2020-05-29 09:16:36 -0700 | |
| commit | 89f29261cdf1d103ab90dfdcc1ebd962bb5226aa (patch) | |
| tree | 89d24e9d124a9c02511f583fa912dea6bebe1792 | |
| parent | dcd5bcaf101a4efcacdf05b2c83e78aa6f21f4a8 (diff) | |
[am] resolve service again when resetting userId in retrieveServiceLocked()
Test: manual and no incorrect
isLoadedApkResourceDirsUpToDate() results during work profile setup
BUG: 149410951
Change-Id: If40f37612a794b8850b71ab9edbe13682c8fa05f
| -rw-r--r-- | services/core/java/com/android/server/am/ActiveServices.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/am/ActiveServices.java b/services/core/java/com/android/server/am/ActiveServices.java index ec12aebc37f6..8cdffb7b1b13 100644 --- a/services/core/java/com/android/server/am/ActiveServices.java +++ b/services/core/java/com/android/server/am/ActiveServices.java @@ -2460,6 +2460,16 @@ public final class ActiveServices { && mAm.isValidSingletonCall(callingUid, sInfo.applicationInfo.uid)) { userId = 0; smap = getServiceMapLocked(0); + ResolveInfo rInfoForUserId0 = + mAm.getPackageManagerInternalLocked().resolveService(service, + resolvedType, flags, userId, callingUid); + if (rInfoForUserId0 == null) { + Slog.w(TAG_SERVICE, + "Unable to resolve service " + service + " U=" + userId + + ": not found"); + return null; + } + sInfo = rInfoForUserId0.serviceInfo; } sInfo = new ServiceInfo(sInfo); sInfo.applicationInfo = mAm.getAppInfoForUser(sInfo.applicationInfo, userId); |