Merge "[am] resolve service again when resetting userId in retrieveServiceLocked()" into rvc-dev am: 1aced77c2e am: fc25cbb078

Change-Id: Ic6ddb1518faabdb74ef4cd2a857e6a0b23c5df65
This commit is contained in:
Songchun Fan
2020-05-29 23:12:19 +00:00
committed by Automerger Merge Worker

View File

@@ -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);