Pre-cache more system servers

Bug: 78792330
Test: Boot system
Change-Id: Id65d9f7d9a697e3c85b410e5da4028a712e4347a
This commit is contained in:
Makoto Onuki
2018-05-07 14:43:05 -07:00
parent f450a7266b
commit 4589565b63
2 changed files with 59 additions and 11 deletions

View File

@@ -857,6 +857,27 @@ public final class ActivityThread extends ClientTransactionHandler {
String buildSerial, boolean autofillCompatibilityEnabled) {
if (services != null) {
if (false) {
// Test code to make sure the app could see the passed-in services.
for (Object oname : services.keySet()) {
if (services.get(oname) == null) {
continue; // AM just passed in a null service.
}
String name = (String) oname;
// See b/79378449 about the following exemption.
switch (name) {
case "package":
case Context.WINDOW_SERVICE:
continue;
}
if (ServiceManager.getService(name) == null) {
Log.wtf(TAG, "Service " + name + " should be accessible by this app");
}
}
}
// Setup the service cache in the ServiceManager
ServiceManager.initServiceCache(services);
}