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

Commit 7044826a authored by Christopher Tate's avatar Christopher Tate Committed by android-build-merger
Browse files

DO NOT MERGE Isolated processes don't get precached system service binders am: f4d23f30

am: f93e1f26

Change-Id: I202adaed715d782a393733fefc8a3712e06280e2
parents 30404396 f93e1f26
Loading
Loading
Loading
Loading
+16 −9
Original line number Diff line number Diff line
@@ -1001,6 +1001,7 @@ public final class ActivityManagerService extends ActivityManagerNative
     * For example, references to the commonly used services.
     */
    HashMap<String, IBinder> mAppBindArgs;
    HashMap<String, IBinder> mIsolatedAppBindArgs;
    /**
     * Temporary to avoid allocations.  Protected by main lock.
@@ -2626,19 +2627,25 @@ public final class ActivityManagerService extends ActivityManagerNative
     * lazily setup to make sure the services are running when they're asked for.
     */
    private HashMap<String, IBinder> getCommonServicesLocked(boolean isolated) {
        // Isolated processes won't get this optimization, so that we don't
        // violate the rules about which services they have access to.
        if (isolated) {
            if (mIsolatedAppBindArgs == null) {
                mIsolatedAppBindArgs = new HashMap<>();
                mIsolatedAppBindArgs.put("package", ServiceManager.getService("package"));
            }
            return mIsolatedAppBindArgs;
        }
        if (mAppBindArgs == null) {
            mAppBindArgs = new HashMap<>();
            // Isolated processes won't get this optimization, so that we don't
            // violate the rules about which services they have access to.
            if (!isolated) {
            // Setup the application init args
            mAppBindArgs.put("package", ServiceManager.getService("package"));
            mAppBindArgs.put("window", ServiceManager.getService("window"));
            mAppBindArgs.put(Context.ALARM_SERVICE,
                    ServiceManager.getService(Context.ALARM_SERVICE));
        }
        }
        return mAppBindArgs;
    }