Merge "DO NOT MERGE : Revert "DO NOT MERGE. No direct Uri grants from system."" into nyc-mr1-dev

am: 7556690cf5

Change-Id: Ib0446301e56751f6a72403155c576516cd7e559c
This commit is contained in:
Amith Yamasani
2017-02-14 00:57:56 +00:00
committed by android-build-merger

View File

@@ -8169,12 +8169,7 @@ public final class ActivityManagerService extends ActivityManagerNative
// Third... does the caller itself have permission to access
// this uri?
final int callingAppId = UserHandle.getAppId(callingUid);
if ((callingAppId == Process.SYSTEM_UID) || (callingAppId == Process.ROOT_UID)) {
Slog.w(TAG, "For security reasons, the system cannot issue a Uri permission"
+ " grant to " + grantUri + "; use startActivityAsCaller() instead");
return -1;
} else {
if (UserHandle.getAppId(callingUid) != Process.SYSTEM_UID) {
if (!checkHoldingPermissionsLocked(pm, pi, grantUri, callingUid, modeFlags)) {
// Require they hold a strong enough Uri permission
if (!checkUriPermissionLocked(grantUri, callingUid, modeFlags)) {