Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d819c238 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by android-build-merger
Browse files

DO NOT MERGE. No direct Uri grants from system.

am: 3e2652a5

Change-Id: I19c72afa1d6407786b4a02d232f8489c42ea700d
parents bcc2e70d 3e2652a5
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -8150,7 +8150,12 @@ public final class ActivityManagerService extends ActivityManagerNative
        // Third...  does the caller itself have permission to access
        // this uri?
        if (UserHandle.getAppId(callingUid) != Process.SYSTEM_UID) {
        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 (!checkHoldingPermissionsLocked(pm, pi, grantUri, callingUid, modeFlags)) {
                // Require they hold a strong enough Uri permission
                if (!checkUriPermissionLocked(grantUri, callingUid, modeFlags)) {