summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Christopher Tate <ctate@google.com> 2016-08-19 13:34:08 +0000
committer android-build-merger <android-build-merger@google.com> 2016-08-19 13:34:08 +0000
commit35f883d9cf27cee1538e70f3123b8ef170efb797 (patch)
tree3fc50bc0ef04b6c3d947c7c355cba43376e2f917
parent42adf24656cffd27b44bee813c24790c9d1b4200 (diff)
parentbf3d892df2eef55770695013effc8d9e8c8c457b (diff)
Isolated processes don't get precached system service binders am: 2c61c57ac5
am: bf3d892df2 Change-Id: I4d7c7376bb28c28ecbc15845179a546c5b1ddd93
-rw-r--r--services/core/java/com/android/server/am/ActivityManagerService.java25
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 9e601eb7e07c..ff3f159b1d08 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -1158,6 +1158,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.
@@ -2935,18 +2936,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;
}