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

Commit ee606994 authored by Automerger Merge Worker's avatar Automerger Merge Worker Committed by Android (Google) Code Review
Browse files

Merge "Merge "Revert "Enforce package visibility to the api...

Merge "Merge "Revert "Enforce package visibility to the api checkUriPermission"" into sc-dev am: 88a62d67 am: ab7ac5ba" into sc-v2-dev-plus-aosp
parents 7106c006 3b2b0959
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -5690,16 +5690,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;
    }