From 00029af7e01f7911648b819af154369b04f1c3c2 Mon Sep 17 00:00:00 2001 From: Muhammad Qureshi Date: Wed, 2 Feb 2022 21:03:51 +0000 Subject: Revert "Revert "Revert "Introduce initOrder for apex-system-services.""" This reverts commit 5a38385882f451215e7561ecfac96cc937394096. Reason for revert: DroidMonitor: Potential culprit for Bug 217580573 - verified through ABTD: https://android-build.googleplex.com/builds/abtd/run/L65800000952890870 Change-Id: Ib9fdb4af623c93cd445d1031e57716b1df0f708e --- services/java/com/android/server/SystemServer.java | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'services/java/com') diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java index 9be481a867cd..c9aeabd17191 100644 --- a/services/java/com/android/server/SystemServer.java +++ b/services/java/com/android/server/SystemServer.java @@ -154,7 +154,6 @@ import com.android.server.os.NativeTombstoneManagerService; import com.android.server.os.SchedulingPolicyService; import com.android.server.people.PeopleService; import com.android.server.pm.ApexManager; -import com.android.server.pm.ApexSystemServiceInfo; import com.android.server.pm.CrossProfileAppsService; import com.android.server.pm.DataLoaderManagerService; import com.android.server.pm.DynamicCodeLoggingService; @@ -225,8 +224,8 @@ import java.text.SimpleDateFormat; import java.util.Arrays; import java.util.Date; import java.util.LinkedList; -import java.util.List; import java.util.Locale; +import java.util.Map; import java.util.Timer; import java.util.TreeSet; import java.util.concurrent.CountDownLatch; @@ -1471,7 +1470,7 @@ public final class SystemServer implements Dumpable { // TelecomLoader hooks into classes with defined HFP logic, // so check for either telephony or microphone. if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_MICROPHONE) || - mPackageManager.hasSystemFeature(PackageManager.FEATURE_TELEPHONY)) { + mPackageManager.hasSystemFeature(PackageManager.FEATURE_TELEPHONY)) { t.traceBegin("StartTelecomLoaderService"); mSystemServiceManager.startService(TelecomLoaderService.class); t.traceEnd(); @@ -1479,7 +1478,7 @@ public final class SystemServer implements Dumpable { t.traceBegin("StartTelephonyRegistry"); telephonyRegistry = new TelephonyRegistry( - context, new TelephonyRegistry.ConfigurationProvider()); + context, new TelephonyRegistry.ConfigurationProvider()); ServiceManager.addService("telephony.registry", telephonyRegistry); t.traceEnd(); @@ -3009,9 +3008,7 @@ public final class SystemServer implements Dumpable { t.traceEnd(); t.traceBegin("MakeTelephonyRegistryReady"); try { - if (telephonyRegistryF != null) { - telephonyRegistryF.systemRunning(); - } + if (telephonyRegistryF != null) telephonyRegistryF.systemRunning(); } catch (Throwable e) { reportWtf("Notifying TelephonyRegistry running", e); } @@ -3076,12 +3073,10 @@ public final class SystemServer implements Dumpable { */ private void startApexServices(@NonNull TimingsTraceAndSlog t) { t.traceBegin("startApexServices"); - // TODO(b/192880996): get the list from "android" package, once the manifest entries - // are migrated to system manifest. - List services = ApexManager.getInstance().getApexSystemServices(); - for (ApexSystemServiceInfo info : services) { - String name = info.getName(); - String jarPath = info.getJarPath(); + Map services = ApexManager.getInstance().getApexSystemServices(); + // TODO(satayev): introduce android:order for services coming the same apexes + for (String name : new TreeSet<>(services.keySet())) { + String jarPath = services.get(name); t.traceBegin("starting " + name); if (TextUtils.isEmpty(jarPath)) { mSystemServiceManager.startService(name); -- cgit v1.2.3-59-g8ed1b