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

Commit 858c59fa authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Automerger Merge Worker
Browse files

Merge changes from topic "jun1" into rvc-dev am: 8a0bca43

Original change: undetermined

Change-Id: I2b7061de97f3204f0c1e5818b40a5a74dabdce27
parents 0d11f702 8a0bca43
Loading
Loading
Loading
Loading
+2 −24
Original line number Diff line number Diff line
@@ -18900,30 +18900,8 @@ public class ActivityManagerService extends IActivityManager.Stub
        @Override
        public int checkContentProviderUriPermission(Uri uri, int userId,
                int callingUid, int modeFlags) {
            // We can find ourselves needing to check Uri permissions while
            // already holding the WM lock, which means reaching back here for
            // the AM lock would cause an inversion. The WM team has requested
            // that we use the strategy below instead of shifting where Uri
            // grants are calculated.
            // Since we could also arrive here while holding the AM lock, we
            // can't always delegate the call through the handler, and we need
            // to delicately dance between the deadlocks.
            if (Thread.currentThread().holdsLock(ActivityManagerService.this)) {
            return ActivityManagerService.this.checkContentProviderUriPermission(uri,
                    userId, callingUid, modeFlags);
            } else {
                final CompletableFuture<Integer> res = new CompletableFuture<>();
                mHandler.post(() -> {
                    res.complete(ActivityManagerService.this.checkContentProviderUriPermission(uri,
                            userId, callingUid, modeFlags));
                });
                try {
                    return res.get();
                } catch (InterruptedException | ExecutionException e) {
                    throw new RuntimeException(e);
                }
            }
        }
        @Override
+1 −1
Original line number Diff line number Diff line
@@ -114,7 +114,7 @@ public class UriGrantsManagerService extends IUriGrantsManager.Stub {
    private static final String TAG = "UriGrantsManagerService";
    // Maximum number of persisted Uri grants a package is allowed
    private static final int MAX_PERSISTED_URI_GRANTS = 128;
    private static final boolean ENABLE_DYNAMIC_PERMISSIONS = false;
    private static final boolean ENABLE_DYNAMIC_PERMISSIONS = true;

    private final Object mLock = new Object();
    private final H mH;