Merge "Revert "Enforce package visibility to the api checkUriPermission"" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
88a62d67c1
@@ -5684,16 +5684,6 @@ public class ActivityManagerService extends IActivityManager.Stub
|
||||
if (pid == MY_PID) {
|
||||
return PackageManager.PERMISSION_GRANTED;
|
||||
}
|
||||
try {
|
||||
if (uid != 0) { // bypass the root
|
||||
final String[] packageNames = getPackageManager().getPackagesForUid(uid);
|
||||
if (ArrayUtils.isEmpty(packageNames)) {
|
||||
// The uid is not existed or not visible to the caller.
|
||||
return PackageManager.PERMISSION_DENIED;
|
||||
}
|
||||
}
|
||||
} catch (RemoteException e) {
|
||||
}
|
||||
return mUgmInternal.checkUriPermission(new GrantUri(userId, uri, modeFlags), uid, modeFlags)
|
||||
? PackageManager.PERMISSION_GRANTED : PackageManager.PERMISSION_DENIED;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user