diff options
author | Feng Yu <feny@google.com> | 2016-10-24 17:33:14 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2016-10-24 17:33:19 +0000 |
commit | ffca4506fdc4d4946bd20318f003cb09c3e03a49 (patch) | |
tree | 4bea304384b4914532786590b2b28f105f3c0f79 | |
parent | ab2f065f401aefc9ba21865102dd40440ed083aa (diff) | |
parent | 62509ef81bccfb7e0b4e3287d624b24114093349 (diff) | |
download | base-ffca4506fdc4d4946bd20318f003cb09c3e03a49.tar.gz |
Merge "DO NOT MERGE Isolated processes don't get precached system service binders" into security-aosp-mnc-mr1-release
-rw-r--r-- | services/core/java/com/android/server/am/ActivityManagerService.java | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java index 16620cdb158c..3307418645ea 100644 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java @@ -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,18 +2627,24 @@ 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)); - } + // 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; } |