• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

frameworks/base


Commit MetaInfo

Revision37648d47981bf9a52738dbe534982e0bdfd98eff (tree)
Time2016-11-04 05:59:58
AuthorChristopher Tate <ctate@goog...>
Commitergitbuildkicker

Log Message

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

More specifically, they get a PackageManager binder -- necessary for
Android process startup and configuration -- but none of the other
usual preloaded service binders.

Bug 30202228

Change-Id: I3810649f504cd631665ece338a83d2e54d41ad05
(cherry picked from commit 2c61c57ac53cbb270b4e76b9d04465f8a3f6eadc)
(cherry picked from commit f4d23f30c92bc80808f57677caab0282c8d28dc6)

Change Summary

Incremental Difference

--- 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
10011001 * For example, references to the commonly used services.
10021002 */
10031003 HashMap<String, IBinder> mAppBindArgs;
1004+ HashMap<String, IBinder> mIsolatedAppBindArgs;
10041005
10051006 /**
10061007 * Temporary to avoid allocations. Protected by main lock.
@@ -2626,18 +2627,24 @@ public final class ActivityManagerService extends ActivityManagerNative
26262627 * lazily setup to make sure the services are running when they're asked for.
26272628 */
26282629 private HashMap<String, IBinder> getCommonServicesLocked(boolean isolated) {
2630+ // Isolated processes won't get this optimization, so that we don't
2631+ // violate the rules about which services they have access to.
2632+ if (isolated) {
2633+ if (mIsolatedAppBindArgs == null) {
2634+ mIsolatedAppBindArgs = new HashMap<>();
2635+ mIsolatedAppBindArgs.put("package", ServiceManager.getService("package"));
2636+ }
2637+ return mIsolatedAppBindArgs;
2638+ }
2639+
26292640 if (mAppBindArgs == null) {
26302641 mAppBindArgs = new HashMap<>();
26312642
2632- // Isolated processes won't get this optimization, so that we don't
2633- // violate the rules about which services they have access to.
2634- if (!isolated) {
2635- // Setup the application init args
2636- mAppBindArgs.put("package", ServiceManager.getService("package"));
2637- mAppBindArgs.put("window", ServiceManager.getService("window"));
2638- mAppBindArgs.put(Context.ALARM_SERVICE,
2639- ServiceManager.getService(Context.ALARM_SERVICE));
2640- }
2643+ // Setup the application init args
2644+ mAppBindArgs.put("package", ServiceManager.getService("package"));
2645+ mAppBindArgs.put("window", ServiceManager.getService("window"));
2646+ mAppBindArgs.put(Context.ALARM_SERVICE,
2647+ ServiceManager.getService(Context.ALARM_SERVICE));
26412648 }
26422649 return mAppBindArgs;
26432650 }