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

Commit c8cf2a5c authored by Automerger Merge Worker's avatar Automerger Merge Worker Committed by Android (Google) Code Review
Browse files

Merge changes from topic "am-a6b16d02ad3a4958ac12da95de4c98eb" into rvc-qpr-dev-plus-aosp

* changes:
  Merge "Flip ENABLE_DYNAMIC_PERMISSIONS, attempt #6." into rvc-dev am: 00c2e16b am: 5ccff32c am: 45dded21
  Merge "Relax locking for startActivityInPackage()." into rvc-dev am: 3c76edd5 am: 984ce387 am: c04cd539
parents 4820f674 9356c82e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -115,7 +115,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;
+7 −1
Original line number Diff line number Diff line
@@ -639,8 +639,14 @@ class ActivityStarter {
                        mRequest.intent, caller);
            }

            // Do not lock the resolving to avoid potential deadlock.
            // If the caller hasn't already resolved the activity, we're willing
            // to do so here, but because that may require acquiring the AM lock
            // as part of calculating the NeededUriGrants, we must never hold
            // the WM lock here to avoid deadlocking.
            if (mRequest.activityInfo == null) {
                if (Thread.holdsLock(mService.mGlobalLock)) {
                    Slog.wtf(TAG, new IllegalStateException("Caller must not hold WM lock"));
                }
                mRequest.resolveActivity(mSupervisor);
            }

+9 −13
Original line number Diff line number Diff line
@@ -6174,13 +6174,11 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
                boolean validateIncomingUser, PendingIntentRecord originatingPendingIntent,
                boolean allowBackgroundActivityStart) {
            assertPackageMatchesCallingUid(callingPackage);
            synchronized (mGlobalLock) {
            return getActivityStartController().startActivitiesInPackage(uid, realCallingPid,
                    realCallingUid, callingPackage, callingFeatureId, intents, resolvedTypes,
                    resultTo, options, userId, validateIncomingUser, originatingPendingIntent,
                    allowBackgroundActivityStart);
        }
        }

        @Override
        public int startActivityInPackage(int uid, int realCallingPid, int realCallingUid,
@@ -6190,14 +6188,12 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
                boolean validateIncomingUser, PendingIntentRecord originatingPendingIntent,
                boolean allowBackgroundActivityStart) {
            assertPackageMatchesCallingUid(callingPackage);
            synchronized (mGlobalLock) {
            return getActivityStartController().startActivityInPackage(uid, realCallingPid,
                    realCallingUid, callingPackage, callingFeatureId, intent, resolvedType,
                    resultTo, resultWho, requestCode, startFlags, options, userId, inTask,
                    reason, validateIncomingUser, originatingPendingIntent,
                    allowBackgroundActivityStart);
        }
        }

        @Override
        public int startActivityAsUser(IApplicationThread caller, String callerPackage,