Merge "Adds caller check to getAllPackages()" into pi-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
7905a07048
@@ -5792,6 +5792,7 @@ public class PackageManagerService extends IPackageManager.Stub
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getAllPackages() {
|
public List<String> getAllPackages() {
|
||||||
|
enforceSystemOrRootOrShell("getAllPackages is limited to privileged callers");
|
||||||
final int callingUid = Binder.getCallingUid();
|
final int callingUid = Binder.getCallingUid();
|
||||||
final int callingUserId = UserHandle.getUserId(callingUid);
|
final int callingUserId = UserHandle.getUserId(callingUid);
|
||||||
synchronized (mPackages) {
|
synchronized (mPackages) {
|
||||||
|
|||||||
Reference in New Issue
Block a user