Fix bugs around manager fetching.
A recent patch started returning "null" when a Binder service
required to provide a manager wasn't yet registered.
This fixes four locations where that new logging was triggered: in
two cases by adjusting the fetching ordering, and in two other cases
by only fetching when the device supports the manager.
Bug: 28634953
Change-Id: I84dbccffa4ac760c10a2bbcb234f21272bfecb91
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index f0cf320..cfd2e85 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -1013,6 +1013,10 @@
mSystemServiceManager.startService(SoundTriggerService.class);
if (!disableNonCoreServices) {
+ if (!disableTrustManager) {
+ mSystemServiceManager.startService(TrustManagerService.class);
+ }
+
if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_BACKUP)) {
mSystemServiceManager.startService(BACKUP_MANAGER_SERVICE_CLASS);
}
@@ -1142,10 +1146,6 @@
}
Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
- if (!disableTrustManager) {
- mSystemServiceManager.startService(TrustManagerService.class);
- }
-
if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_FINGERPRINT)) {
mSystemServiceManager.startService(FingerprintService.class);
}