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

Commit d725de1e authored by Amith Yamasani's avatar Amith Yamasani Committed by Android (Google) Code Review
Browse files

Merge "Revert "No direct Uri grants from system.""

parents 2bf869e9 dae86855
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -8459,12 +8459,7 @@ public class ActivityManagerService extends IActivityManager.Stub
        // 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)) {