Merge "Enfore cross user permission to getPackagesForUid" into sc-dev

This commit is contained in:
Jackal Guo
2021-02-05 00:51:26 +00:00
committed by Android (Google) Code Review

View File

@@ -3622,6 +3622,8 @@ public class PackageManagerService extends IPackageManager.Stub
final boolean isCallerInstantApp = getInstantAppPackageName(callingUid) != null;
final int userId = UserHandle.getUserId(uid);
final int appId = UserHandle.getAppId(uid);
enforceCrossUserPermission(callingUid, userId,
/* requireFullPermission */ false, /* checkShell */ false, "getPackagesForUid");
return getPackagesForUidInternalBody(callingUid, userId, appId, isCallerInstantApp);
}