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

Commit 047054c1 authored by Christopher Tate's avatar Christopher Tate Committed by android-build-merger
Browse files

Isolated processes don't get precached system service binders am: 2c61c57a am: bf3d892d

am: 35f883d9

Change-Id: I06726ff14caa8628ab37f40d1fb90e21506c23db
parents 7d03ad19 35f883d9
Loading
Loading
Loading
Loading
+16 −9
Original line number Original line Diff line number Diff line
@@ -1154,6 +1154,7 @@ public final class ActivityManagerService extends ActivityManagerNative
     * For example, references to the commonly used services.
     * For example, references to the commonly used services.
     */
     */
    HashMap<String, IBinder> mAppBindArgs;
    HashMap<String, IBinder> mAppBindArgs;
    HashMap<String, IBinder> mIsolatedAppBindArgs;
    /**
    /**
     * Temporary to avoid allocations.  Protected by main lock.
     * Temporary to avoid allocations.  Protected by main lock.
@@ -2957,19 +2958,25 @@ public final class ActivityManagerService extends ActivityManagerNative
     * lazily setup to make sure the services are running when they're asked for.
     * lazily setup to make sure the services are running when they're asked for.
     */
     */
    private HashMap<String, IBinder> getCommonServicesLocked(boolean isolated) {
    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) {
        if (mAppBindArgs == null) {
            mAppBindArgs = new HashMap<>();
            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
            // Setup the application init args
            mAppBindArgs.put("package", ServiceManager.getService("package"));
            mAppBindArgs.put("package", ServiceManager.getService("package"));
            mAppBindArgs.put("window", ServiceManager.getService("window"));
            mAppBindArgs.put("window", ServiceManager.getService("window"));
            mAppBindArgs.put(Context.ALARM_SERVICE,
            mAppBindArgs.put(Context.ALARM_SERVICE,
                    ServiceManager.getService(Context.ALARM_SERVICE));
                    ServiceManager.getService(Context.ALARM_SERVICE));
        }
        }
        }
        return mAppBindArgs;
        return mAppBindArgs;
    }
    }