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

Commit 6bd2fd91 authored by Corina's avatar Corina Committed by Automerger Merge Worker
Browse files

DO NOT MERGE: Disable ENABLE_DYNAMIC_PERMISSIONS flag for now to avoid crashes. am: 39150a74

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

Change-Id: If953e3fd513d43696fd4e3763ee78634ef71751e
parents c59b7759 39150a74
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -991,7 +991,9 @@ public class UriGrantsManagerService extends IUriGrantsManager.Stub {
        // If this provider says that grants are always required, we need to
        // consult it directly to determine if the UID has permission
        final boolean forceMet;
        if (ENABLE_DYNAMIC_PERMISSIONS && pi.forceUriPermissions) {
        if (ENABLE_DYNAMIC_PERMISSIONS
                && pi.forceUriPermissions
                && isDynamicPermissionEnabledInMP()) {
            final int providerUserId = UserHandle.getUserId(pi.applicationInfo.uid);
            final int clientUserId = UserHandle.getUserId(uid);
            if (providerUserId == clientUserId) {
@@ -1009,6 +1011,15 @@ public class UriGrantsManagerService extends IUriGrantsManager.Stub {
        return readMet && writeMet && forceMet;
    }

    /**
     * Returns true if the available MediaProvider version contains the changes that enable dynamic
     * permission.
     */
    private boolean isDynamicPermissionEnabledInMP() {
        // TODO(b/159995598) Check MediaProvider version.
        return false;
    }

    @GuardedBy("mLock")
    private void removeUriPermissionIfNeededLocked(UriPermission perm) {
        if (perm.modeFlags != 0) {