Merge "Adds caller check to getAllPackages()" into rvc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
649d086c2c
@@ -202,6 +202,12 @@ public class Process {
|
|||||||
*/
|
*/
|
||||||
public static final int SE_UID = 1068;
|
public static final int SE_UID = 1068;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Defines the UID/GID for the iorapd.
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
public static final int IORAPD_UID = 1071;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines the UID/GID for the NetworkStack app.
|
* Defines the UID/GID for the NetworkStack app.
|
||||||
* @hide
|
* @hide
|
||||||
|
|||||||
@@ -6169,6 +6169,10 @@ public class PackageManagerService extends IPackageManager.Stub
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getAllPackages() {
|
public List<String> getAllPackages() {
|
||||||
|
// Allow iorapd to call this method.
|
||||||
|
if (Binder.getCallingUid() != Process.IORAPD_UID) {
|
||||||
|
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 (mLock) {
|
synchronized (mLock) {
|
||||||
|
|||||||
Reference in New Issue
Block a user