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

Commit 860dfcef authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

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

Merge "Revert "Enforce package visibility to the api checkUriPermission"" into sc-dev am: 88a62d67 am: b2c6773e

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15155271

Change-Id: I8724c348e9f1882547aace4e7396fac3c76b8317
parents 7106c006 b2c6773e
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;
    }