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

Commit 23036d70 authored by Rhed Jao's avatar Rhed Jao Committed by Android Build Coastguard Worker
Browse files

Revert "Enforce package visibility to the api checkUriPermission"

Revert "Add tests for the api Context#checkUriPermission"

Revert submission 15065651-pm_package_visibility_check_uri_permission

Reason for revert: [Regression] Cross-profile sharing is broken
Reverted Changes:
Iea2f2d8a8:Enforce package visibility to the api checkUriPerm...
I0a4ed9350:Add tests for the api Context#checkUriPermission

Bug: 192357488
Change-Id: I0050e70121e23e8457dbfc061f488c40f7ec2a93
(cherry picked from commit 48e920c2)
parent e8daf01d
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;
    }