Merge "Adds caller check to getAllPackages()" into pi-dev

This commit is contained in:
Patrick Baumann
2021-03-03 00:24:55 +00:00
committed by Android (Google) Code Review

View File

@@ -5792,6 +5792,7 @@ public class PackageManagerService extends IPackageManager.Stub
@Override
public List<String> getAllPackages() {
enforceSystemOrRootOrShell("getAllPackages is limited to privileged callers");
final int callingUid = Binder.getCallingUid();
final int callingUserId = UserHandle.getUserId(callingUid);
synchronized (mPackages) {