DO NOT MERGE Isolated processes don't get precached system service binders am: f4d23f30c9 am: f93e1f2671
am: 7044826aa8
Change-Id: Ia3129e0748d14e8250ac39d0f0e383318c9999bf
This commit is contained in:
@@ -1006,6 +1006,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.
|
||||
@@ -2631,18 +2632,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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user