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

Commit 9cc22aee 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

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

Change-Id: Ic994febd4c3c4c680dbceb6b6b0fb4fe2f85fc4d
parents a74c5194 88a62d67
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -5684,16 +5684,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;
    }