• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

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

frameworks/base


Commit MetaInfo

修訂54bd7b85b2e3c8c43e9d710d4b592921c96c3846 (tree)
時間2016-12-13 04:56:48
作者Christopher Tate <ctate@goog...>
CommiterJessica Wagantall

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.

CYNGNOS-3312
Bug 30202228

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

Change Summary

差異

--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -1030,6 +1030,7 @@ public final class ActivityManagerService extends ActivityManagerNative
10301030 * For example, references to the commonly used services.
10311031 */
10321032 HashMap<String, IBinder> mAppBindArgs;
1033+ HashMap<String, IBinder> mIsolatedAppBindArgs;
10331034
10341035 /**
10351036 * Temporary to avoid allocations. Protected by main lock.
@@ -2831,18 +2832,24 @@ public final class ActivityManagerService extends ActivityManagerNative
28312832 * lazily setup to make sure the services are running when they're asked for.
28322833 */
28332834 private HashMap<String, IBinder> getCommonServicesLocked(boolean isolated) {
2835+ // Isolated processes won't get this optimization, so that we don't
2836+ // violate the rules about which services they have access to.
2837+ if (isolated) {
2838+ if (mIsolatedAppBindArgs == null) {
2839+ mIsolatedAppBindArgs = new HashMap<>();
2840+ mIsolatedAppBindArgs.put("package", ServiceManager.getService("package"));
2841+ }
2842+ return mIsolatedAppBindArgs;
2843+ }
2844+
28342845 if (mAppBindArgs == null) {
28352846 mAppBindArgs = new HashMap<>();
28362847
2837- // Isolated processes won't get this optimization, so that we don't
2838- // violate the rules about which services they have access to.
2839- if (!isolated) {
2840- // Setup the application init args
2841- mAppBindArgs.put("package", ServiceManager.getService("package"));
2842- mAppBindArgs.put("window", ServiceManager.getService("window"));
2843- mAppBindArgs.put(Context.ALARM_SERVICE,
2844- ServiceManager.getService(Context.ALARM_SERVICE));
2845- }
2848+ // Setup the application init args
2849+ mAppBindArgs.put("package", ServiceManager.getService("package"));
2850+ mAppBindArgs.put("window", ServiceManager.getService("window"));
2851+ mAppBindArgs.put(Context.ALARM_SERVICE,
2852+ ServiceManager.getService(Context.ALARM_SERVICE));
28462853 }
28472854 return mAppBindArgs;
28482855 }