diff options
Diffstat (limited to 'services/java/com/android/server/SystemServer.java')
-rw-r--r-- | services/java/com/android/server/SystemServer.java | 231 |
1 files changed, 161 insertions, 70 deletions
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java index adff23ed28d6..52133a6d8d9f 100644 --- a/services/java/com/android/server/SystemServer.java +++ b/services/java/com/android/server/SystemServer.java @@ -16,6 +16,12 @@ package com.android.server; +import static android.os.IServiceManager.DUMP_FLAG_PRIORITY_CRITICAL; +import static android.os.IServiceManager.DUMP_FLAG_PRIORITY_HIGH; +import static android.os.IServiceManager.DUMP_FLAG_PRIORITY_NORMAL; +import static android.os.IServiceManager.DUMP_FLAG_PROTO; +import static android.view.Display.DEFAULT_DISPLAY; + import android.app.ActivityThread; import android.app.INotificationManager; import android.app.usage.UsageStatsManagerInternal; @@ -29,6 +35,7 @@ import android.content.res.Configuration; import android.content.res.Resources.Theme; import android.database.sqlite.SQLiteCompatibilityWalFlags; import android.database.sqlite.SQLiteGlobal; +import android.hardware.display.ColorDisplayManager; import android.hardware.display.DisplayManagerInternal; import android.os.BaseBundle; import android.os.Binder; @@ -57,7 +64,6 @@ import android.util.TimingsTraceLog; import android.view.WindowManager; import com.android.internal.R; -import com.android.internal.app.ColorDisplayController; import com.android.internal.logging.MetricsLogger; import com.android.internal.notification.SystemNotificationChannels; import com.android.internal.os.BinderInternal; @@ -66,10 +72,12 @@ import com.android.internal.util.ConcurrentUtils; import com.android.internal.util.EmergencyAffordanceManager; import com.android.internal.widget.ILockSettings; import com.android.server.am.ActivityManagerService; -import com.android.server.am.ActivityTaskManagerService; import com.android.server.appbinding.AppBindingService; import com.android.server.audio.AudioService; import com.android.server.biometrics.BiometricService; +import com.android.server.biometrics.face.FaceService; +import com.android.server.biometrics.fingerprint.FingerprintService; +import com.android.server.biometrics.iris.IrisService; import com.android.server.broadcastradio.BroadcastRadioService; import com.android.server.camera.CameraServiceProxy; import com.android.server.clipboard.ClipboardService; @@ -80,17 +88,16 @@ import com.android.server.display.ColorDisplayService; import com.android.server.display.DisplayManagerService; import com.android.server.dreams.DreamManagerService; import com.android.server.emergency.EmergencyAffordanceService; -import com.android.server.biometrics.face.FaceService; -import com.android.server.biometrics.fingerprint.FingerprintService; import com.android.server.hdmi.HdmiControlService; import com.android.server.input.InputManagerService; import com.android.server.inputmethod.InputMethodManagerService; +import com.android.server.inputmethod.MultiClientInputMethodManagerService; import com.android.server.job.JobSchedulerService; import com.android.server.lights.LightsService; import com.android.server.media.MediaResourceMonitorService; import com.android.server.media.MediaRouterService; -import com.android.server.media.MediaUpdateService; import com.android.server.media.MediaSessionService; +import com.android.server.media.MediaUpdateService; import com.android.server.media.projection.MediaProjectionManagerService; import com.android.server.net.NetworkPolicyManagerService; import com.android.server.net.NetworkStatsService; @@ -112,7 +119,9 @@ import com.android.server.pm.UserManagerService; import com.android.server.policy.PhoneWindowManager; import com.android.server.power.PowerManagerService; import com.android.server.power.ShutdownThread; +import com.android.server.power.ThermalManagerService; import com.android.server.restrictions.RestrictionsManagerService; +import com.android.server.role.RoleManagerService; import com.android.server.security.KeyAttestationApplicationIdProviderService; import com.android.server.security.KeyChainSystemService; import com.android.server.soundtrigger.SoundTriggerService; @@ -130,6 +139,8 @@ import com.android.server.uri.UriGrantsManagerService; import com.android.server.usage.UsageStatsService; import com.android.server.vr.VrManagerService; import com.android.server.webkit.WebViewUpdateService; +import com.android.server.wm.ActivityTaskManagerService; +import com.android.server.wm.WindowManagerGlobalLock; import com.android.server.wm.WindowManagerService; import dalvik.system.VMRuntime; @@ -144,13 +155,8 @@ import java.util.Timer; import java.util.concurrent.CountDownLatch; import java.util.concurrent.Future; -import static android.os.IServiceManager.DUMP_FLAG_PRIORITY_CRITICAL; -import static android.os.IServiceManager.DUMP_FLAG_PRIORITY_HIGH; -import static android.os.IServiceManager.DUMP_FLAG_PRIORITY_NORMAL; -import static android.os.IServiceManager.DUMP_FLAG_PROTO; -import static android.view.Display.DEFAULT_DISPLAY; - public final class SystemServer { + private static final String TAG = "SystemServer"; // Tag for timing measurement of main thread. @@ -235,6 +241,8 @@ public final class SystemServer { "com.android.server.wallpaper.WallpaperManagerService$Lifecycle"; private static final String AUTO_FILL_MANAGER_SERVICE_CLASS = "com.android.server.autofill.AutofillManagerService"; + private static final String INTELLIGENCE_MANAGER_SERVICE_CLASS = + "com.android.server.intelligence.IntelligenceManagerService"; private static final String TIME_ZONE_RULES_MANAGER_SERVICE_CLASS = "com.android.server.timezone.RulesManagerService$Lifecycle"; private static final String IOT_SERVICE_CLASS = @@ -249,6 +257,8 @@ public final class SystemServer { "com.android.server.timezonedetector.TimeZoneDetectorService$Lifecycle"; private static final String ACCESSIBILITY_MANAGER_SERVICE_CLASS = "com.android.server.accessibility.AccessibilityManagerService$Lifecycle"; + private static final String ADB_SERVICE_CLASS = + "com.android.server.adb.AdbService$Lifecycle"; private static final String PERSISTENT_DATA_BLOCK_PROP = "ro.frp.pst"; @@ -260,9 +270,8 @@ public final class SystemServer { private static final int sMaxBinderThreads = 31; /** - * Default theme used by the system context. This is used to style - * system-provided dialogs, such as the Power Off dialog, and other - * visual content. + * Default theme used by the system context. This is used to style system-provided dialogs, such + * as the Power Off dialog, and other visual content. */ private static final int DEFAULT_SYSTEM_THEME = com.android.internal.R.style.Theme_DeviceDefault_System; @@ -276,6 +285,7 @@ public final class SystemServer { // TODO: remove all of these references by improving dependency resolution and boot phases private PowerManagerService mPowerManagerService; private ActivityManagerService mActivityManagerService; + private WindowManagerGlobalLock mWindowManagerGlobalLock; private WebViewUpdateService mWebViewUpdateService; private DisplayManagerService mDisplayManagerService; private PackageManagerService mPackageManagerService; @@ -302,8 +312,7 @@ public final class SystemServer { private static native void startSensorService(); /** - * Start all HIDL services that are run inside the system server. This - * may take some time. + * Start all HIDL services that are run inside the system server. This may take some time. */ private static native void startHidlServices(); @@ -339,7 +348,7 @@ public final class SystemServer { // // Default the timezone property to GMT if not set. // - String timezoneProperty = SystemProperties.get("persist.sys.timezone"); + String timezoneProperty = SystemProperties.get("persist.sys.timezone"); if (timezoneProperty == null || timezoneProperty.isEmpty()) { Slog.w(TAG, "Timezone not set; setting to GMT."); SystemProperties.set("persist.sys.timezone", "GMT"); @@ -420,7 +429,7 @@ public final class SystemServer { // Prepare the main looper thread (this thread). android.os.Process.setThreadPriority( - android.os.Process.THREAD_PRIORITY_FOREGROUND); + android.os.Process.THREAD_PRIORITY_FOREGROUND); android.os.Process.setCanSelfBackground(false); Looper.prepareMainLooper(); Looper.getMainLooper().setSlowLogThresholdMs( @@ -525,7 +534,7 @@ public final class SystemServer { if (filename != null && filename.startsWith("/data")) { if (!new File(BLOCK_MAP_FILE).exists()) { Slog.e(TAG, "Can't find block map file, uncrypt failed or " + - "unexpected runtime restart?"); + "unexpected runtime restart?"); return; } } @@ -558,11 +567,10 @@ public final class SystemServer { } /** - * Starts the small tangle of critical services that are needed to get - * the system off the ground. These services have complex mutual dependencies - * which is why we initialize them all in one place here. Unless your service - * is also entwined in these dependencies, it should be initialized in one of - * the other functions. + * Starts the small tangle of critical services that are needed to get the system off the + * ground. These services have complex mutual dependencies which is why we initialize them all + * in one place here. Unless your service is also entwined in these dependencies, it should be + * initialized in one of the other functions. */ private void startBootstrapServices() { Slog.i(TAG, "Reading configuration..."); @@ -598,6 +606,7 @@ public final class SystemServer { mSystemServiceManager, atm); mActivityManagerService.setSystemServiceManager(mSystemServiceManager); mActivityManagerService.setInstaller(installer); + mWindowManagerGlobalLock = atm.getGlobalLock(); traceEnd(); // Power manager needs to be started early because other services need it. @@ -608,6 +617,10 @@ public final class SystemServer { mPowerManagerService = mSystemServiceManager.startService(PowerManagerService.class); traceEnd(); + traceBeginAndSlog("StartThermalManager"); + mSystemServiceManager.startService(ThermalManagerService.class); + traceEnd(); + // Now that the power manager has been started, let the activity manager // initialize power management features. traceBeginAndSlog("InitPowerManagement"); @@ -781,8 +794,7 @@ public final class SystemServer { } /** - * Starts a miscellaneous grab bag of stuff that has yet to be refactored - * and organized. + * Starts a miscellaneous grab bag of stuff that has yet to be refactored and organized. */ private void startOtherServices() { final Context context = mSystemContext; @@ -793,7 +805,7 @@ public final class SystemServer { NetworkStatsService networkStats = null; NetworkPolicyManagerService networkPolicy = null; ConnectivityService connectivity = null; - NsdService serviceDiscovery= null; + NsdService serviceDiscovery = null; WindowManagerService wm = null; SerialService serial = null; NetworkTimeUpdateService networkTimeUpdater = null; @@ -807,6 +819,11 @@ public final class SystemServer { boolean disableSystemTextClassifier = SystemProperties.getBoolean( "config.disable_systemtextclassifier", false); + + //TODO(b/111276913): temporarily disabled until the manager is properly implemented to + // ignore events when disabled and buffer when enabled + boolean disableIntelligence = SystemProperties.getBoolean( + "config.disable_intelligence", true); boolean disableNetworkTime = SystemProperties.getBoolean("config.disable_networktime", false); boolean disableCameraService = SystemProperties.getBoolean("config.disable_cameraservice", @@ -820,6 +837,9 @@ public final class SystemServer { boolean isWatch = context.getPackageManager().hasSystemFeature( PackageManager.FEATURE_WATCH); + boolean isArc = context.getPackageManager().hasSystemFeature( + "org.chromium.arc"); + boolean enableVrService = context.getPackageManager().hasSystemFeature( PackageManager.FEATURE_VR_MODE_HIGH_PERFORMANCE); @@ -930,7 +950,7 @@ public final class SystemServer { ConcurrentUtils.waitForFutureNoInterrupt(mSensorServiceStart, START_SENSOR_SERVICE); mSensorServiceStart = null; wm = WindowManagerService.main(context, inputManager, !mFirstBoot, mOnlyCore, - new PhoneWindowManager()); + new PhoneWindowManager(), mWindowManagerGlobalLock); ServiceManager.addService(Context.WINDOW_SERVICE, wm, /* allowIsolated= */ false, DUMP_FLAG_PRIORITY_CRITICAL | DUMP_FLAG_PROTO); ServiceManager.addService(Context.INPUT_SERVICE, inputManager, @@ -980,7 +1000,7 @@ public final class SystemServer { } else if (mFactoryTestMode == FactoryTest.FACTORY_TEST_LOW_LEVEL) { Slog.i(TAG, "No Bluetooth Service (factory test)"); } else if (!context.getPackageManager().hasSystemFeature - (PackageManager.FEATURE_BLUETOOTH)) { + (PackageManager.FEATURE_BLUETOOTH)) { Slog.i(TAG, "No Bluetooth Service (Bluetooth Hardware Not Present)"); } else { traceBeginAndSlog("StartBluetoothService"); @@ -1014,7 +1034,12 @@ public final class SystemServer { // Bring up services needed for UI. if (mFactoryTestMode != FactoryTest.FACTORY_TEST_LOW_LEVEL) { traceBeginAndSlog("StartInputMethodManagerLifecycle"); - mSystemServiceManager.startService(InputMethodManagerService.Lifecycle.class); + if (MultiClientInputMethodManagerService.isConfiguredToUse()) { + mSystemServiceManager.startService( + MultiClientInputMethodManagerService.Lifecycle.class); + } else { + mSystemServiceManager.startService(InputMethodManagerService.Lifecycle.class); + } traceEnd(); traceBeginAndSlog("StartAccessibilityManagerService"); @@ -1089,7 +1114,7 @@ public final class SystemServer { try { mSystemServiceManager.startService(LOCK_SETTINGS_SERVICE_CLASS); lockSettings = ILockSettings.Stub.asInterface( - ServiceManager.getService("lock_settings")); + ServiceManager.getService("lock_settings")); } catch (Throwable e) { reportWtf("starting LockSettingsService service", e); } @@ -1130,6 +1155,15 @@ public final class SystemServer { traceEnd(); } + if (!disableIntelligence) { + traceBeginAndSlog("StartIntelligenceService"); + mSystemServiceManager.startService(INTELLIGENCE_MANAGER_SERVICE_CLASS); + traceEnd(); + } else { + Slog.d(TAG, "IntelligenceService disabled"); + } + + // NOTE: ClipboardService indirectly depends on IntelligenceService traceBeginAndSlog("StartClipboardService"); mSystemServiceManager.startService(ClipboardService.class); traceEnd(); @@ -1158,7 +1192,8 @@ public final class SystemServer { if (!disableSystemTextClassifier) { traceBeginAndSlog("StartTextClassificationManagerService"); - mSystemServiceManager.startService(TextClassificationManagerService.Lifecycle.class); + mSystemServiceManager + .startService(TextClassificationManagerService.Lifecycle.class); traceEnd(); } @@ -1187,41 +1222,41 @@ public final class SystemServer { if (!mOnlyCore) { if (context.getPackageManager().hasSystemFeature( - PackageManager.FEATURE_WIFI)) { + PackageManager.FEATURE_WIFI)) { // Wifi Service must be started first for wifi-related services. traceBeginAndSlog("StartWifi"); mSystemServiceManager.startService(WIFI_SERVICE_CLASS); traceEnd(); traceBeginAndSlog("StartWifiScanning"); mSystemServiceManager.startService( - "com.android.server.wifi.scanner.WifiScanningService"); + "com.android.server.wifi.scanner.WifiScanningService"); traceEnd(); } if (context.getPackageManager().hasSystemFeature( - PackageManager.FEATURE_WIFI_RTT)) { + PackageManager.FEATURE_WIFI_RTT)) { traceBeginAndSlog("StartRttService"); mSystemServiceManager.startService( - "com.android.server.wifi.rtt.RttService"); + "com.android.server.wifi.rtt.RttService"); traceEnd(); } if (context.getPackageManager().hasSystemFeature( - PackageManager.FEATURE_WIFI_AWARE)) { + PackageManager.FEATURE_WIFI_AWARE)) { traceBeginAndSlog("StartWifiAware"); mSystemServiceManager.startService(WIFI_AWARE_SERVICE_CLASS); traceEnd(); } if (context.getPackageManager().hasSystemFeature( - PackageManager.FEATURE_WIFI_DIRECT)) { + PackageManager.FEATURE_WIFI_DIRECT)) { traceBeginAndSlog("StartWifiP2P"); mSystemServiceManager.startService(WIFI_P2P_SERVICE_CLASS); traceEnd(); } if (context.getPackageManager().hasSystemFeature( - PackageManager.FEATURE_LOWPAN)) { + PackageManager.FEATURE_LOWPAN)) { traceBeginAndSlog("StartLowpan"); mSystemServiceManager.startService(LOWPAN_SERVICE_CLASS); traceEnd(); @@ -1256,7 +1291,7 @@ public final class SystemServer { } if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_ETHERNET) || - mPackageManager.hasSystemFeature(PackageManager.FEATURE_USB_HOST)) { + mPackageManager.hasSystemFeature(PackageManager.FEATURE_USB_HOST)) { traceBeginAndSlog("StartEthernet"); mSystemServiceManager.startService(ETHERNET_SERVICE_CLASS); traceEnd(); @@ -1265,10 +1300,10 @@ public final class SystemServer { traceBeginAndSlog("StartConnectivityService"); try { connectivity = new ConnectivityService( - context, networkManagement, networkStats, networkPolicy); + context, networkManagement, networkStats, networkPolicy); ServiceManager.addService(Context.CONNECTIVITY_SERVICE, connectivity, - /* allowIsolated= */ false, - DUMP_FLAG_PRIORITY_HIGH | DUMP_FLAG_PRIORITY_NORMAL); + /* allowIsolated= */ false, + DUMP_FLAG_PRIORITY_HIGH | DUMP_FLAG_PRIORITY_NORMAL); networkStats.bindConnectivityManager(connectivity); networkPolicy.bindConnectivityManager(connectivity); } catch (Throwable e) { @@ -1280,7 +1315,7 @@ public final class SystemServer { try { serviceDiscovery = NsdService.create(context); ServiceManager.addService( - Context.NSD_SERVICE, serviceDiscovery); + Context.NSD_SERVICE, serviceDiscovery); } catch (Throwable e) { reportWtf("starting Service Discovery Service", e); } @@ -1298,7 +1333,7 @@ public final class SystemServer { traceBeginAndSlog("StartUpdateLockService"); try { ServiceManager.addService(Context.UPDATE_LOCK_SERVICE, - new UpdateLockService(context)); + new UpdateLockService(context)); } catch (Throwable e) { reportWtf("starting UpdateLockService", e); } @@ -1369,7 +1404,17 @@ public final class SystemServer { } traceBeginAndSlog("StartAudioService"); - mSystemServiceManager.startService(AudioService.Lifecycle.class); + if (!isArc) { + mSystemServiceManager.startService(AudioService.Lifecycle.class); + } else { + String className = context.getResources() + .getString(R.string.config_deviceSpecificAudioService); + try { + mSystemServiceManager.startService(className + "$Lifecycle"); + } catch (Throwable e) { + reportWtf("starting " + className, e); + } + } traceEnd(); if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_BROADCAST_RADIO)) { @@ -1406,15 +1451,24 @@ public final class SystemServer { } if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_USB_HOST) - || mPackageManager.hasSystemFeature( - PackageManager.FEATURE_USB_ACCESSORY) - || isEmulator) { + || mPackageManager.hasSystemFeature( + PackageManager.FEATURE_USB_ACCESSORY) + || isEmulator) { // Manage USB host and device support traceBeginAndSlog("StartUsbService"); mSystemServiceManager.startService(USB_SERVICE_CLASS); traceEnd(); } + // Start ADB Debugging Service + traceBeginAndSlog("StartAdbService"); + try { + mSystemServiceManager.startService(ADB_SERVICE_CLASS); + } catch (Throwable e) { + Slog.e(TAG, "Failure starting AdbService"); + } + traceEnd(); + if (!isWatch) { traceBeginAndSlog("StartSerialService"); try { @@ -1431,7 +1485,7 @@ public final class SystemServer { try { hardwarePropertiesService = new HardwarePropertiesManagerService(context); ServiceManager.addService(Context.HARDWARE_PROPERTIES_SERVICE, - hardwarePropertiesService); + hardwarePropertiesService); } catch (Throwable e) { Slog.e(TAG, "Failure starting HardwarePropertiesManagerService", e); } @@ -1441,8 +1495,8 @@ public final class SystemServer { mSystemServiceManager.startService(TwilightService.class); traceEnd(); - if (ColorDisplayController.isAvailable(context)) { - traceBeginAndSlog("StartNightDisplay"); + if (ColorDisplayManager.isNightDisplayAvailable(context)) { + traceBeginAndSlog("StartColorDisplay"); mSystemServiceManager.startService(ColorDisplayService.class); traceEnd(); } @@ -1466,7 +1520,7 @@ public final class SystemServer { } if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_APP_WIDGETS) - || context.getResources().getBoolean(R.bool.config_enableAppWidgetService)) { + || context.getResources().getBoolean(R.bool.config_enableAppWidgetService)) { traceBeginAndSlog("StartAppWidgetService"); mSystemServiceManager.startService(APPWIDGET_SERVICE_CLASS); traceEnd(); @@ -1552,7 +1606,7 @@ public final class SystemServer { traceBeginAndSlog("AddGraphicsStatsService"); ServiceManager.addService(GraphicsStatsService.GRAPHICS_STATS_SERVICE, - new GraphicsStatsService(context)); + new GraphicsStatsService(context)); traceEnd(); if (CoverageService.ENABLED) { @@ -1621,6 +1675,8 @@ public final class SystemServer { final boolean hasFeatureFace = mPackageManager.hasSystemFeature(PackageManager.FEATURE_FACE); + final boolean hasFeatureIris + = mPackageManager.hasSystemFeature(PackageManager.FEATURE_IRIS); final boolean hasFeatureFingerprint = mPackageManager.hasSystemFeature(PackageManager.FEATURE_FINGERPRINT); @@ -1630,15 +1686,21 @@ public final class SystemServer { traceEnd(); } + if (hasFeatureIris) { + traceBeginAndSlog("StartIrisSensor"); + mSystemServiceManager.startService(IrisService.class); + traceEnd(); + } + if (hasFeatureFingerprint) { traceBeginAndSlog("StartFingerprintSensor"); mSystemServiceManager.startService(FingerprintService.class); traceEnd(); } - if (hasFeatureFace || hasFeatureFingerprint) { + if (hasFeatureFace || hasFeatureIris || hasFeatureFingerprint) { // Start this service after all biometric services. - traceBeginAndSlog("StartBiometricPromptService"); + traceBeginAndSlog("StartBiometricService"); mSystemServiceManager.startService(BiometricService.class); traceEnd(); } @@ -1830,7 +1892,7 @@ public final class SystemServer { // propagate to it. final Configuration config = wm.computeNewConfiguration(DEFAULT_DISPLAY); DisplayMetrics metrics = new DisplayMetrics(); - WindowManager w = (WindowManager)context.getSystemService(Context.WINDOW_SERVICE); + WindowManager w = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); w.getDefaultDisplay().getMetrics(metrics); context.getResources().updateConfiguration(config, metrics); @@ -1917,6 +1979,11 @@ public final class SystemServer { } traceEnd(); + // Grants default permissions and defines roles + traceBeginAndSlog("StartRoleManagerService"); + mSystemServiceManager.startService(RoleManagerService.class); + traceEnd(); + // No dependency on Webview preparation in system server. But this should // be completed before allowing 3rd party final String WEBVIEW_PREPARATION = "WebViewFactoryPreparation"; @@ -1949,7 +2016,9 @@ public final class SystemServer { traceEnd(); traceBeginAndSlog("MakeNetworkManagementServiceReady"); try { - if (networkManagementF != null) networkManagementF.systemReady(); + if (networkManagementF != null) { + networkManagementF.systemReady(); + } } catch (Throwable e) { reportWtf("making Network Managment Service ready", e); } @@ -1961,21 +2030,27 @@ public final class SystemServer { traceEnd(); traceBeginAndSlog("MakeIpSecServiceReady"); try { - if (ipSecServiceF != null) ipSecServiceF.systemReady(); + if (ipSecServiceF != null) { + ipSecServiceF.systemReady(); + } } catch (Throwable e) { reportWtf("making IpSec Service ready", e); } traceEnd(); traceBeginAndSlog("MakeNetworkStatsServiceReady"); try { - if (networkStatsF != null) networkStatsF.systemReady(); + if (networkStatsF != null) { + networkStatsF.systemReady(); + } } catch (Throwable e) { reportWtf("making Network Stats Service ready", e); } traceEnd(); traceBeginAndSlog("MakeConnectivityServiceReady"); try { - if (connectivityF != null) connectivityF.systemReady(); + if (connectivityF != null) { + connectivityF.systemReady(); + } } catch (Throwable e) { reportWtf("making Connectivity Service ready", e); } @@ -2010,21 +2085,27 @@ public final class SystemServer { traceBeginAndSlog("MakeLocationServiceReady"); try { - if (locationF != null) locationF.systemRunning(); + if (locationF != null) { + locationF.systemRunning(); + } } catch (Throwable e) { reportWtf("Notifying Location Service running", e); } traceEnd(); traceBeginAndSlog("MakeCountryDetectionServiceReady"); try { - if (countryDetectorF != null) countryDetectorF.systemRunning(); + if (countryDetectorF != null) { + countryDetectorF.systemRunning(); + } } catch (Throwable e) { reportWtf("Notifying CountryDetectorService running", e); } traceEnd(); traceBeginAndSlog("MakeNetworkTimeUpdateReady"); try { - if (networkTimeUpdaterF != null) networkTimeUpdaterF.systemRunning(); + if (networkTimeUpdaterF != null) { + networkTimeUpdaterF.systemRunning(); + } } catch (Throwable e) { reportWtf("Notifying NetworkTimeService running", e); } @@ -2032,28 +2113,36 @@ public final class SystemServer { traceBeginAndSlog("MakeInputManagerServiceReady"); try { // TODO(BT) Pass parameter to input manager - if (inputManagerF != null) inputManagerF.systemRunning(); + if (inputManagerF != null) { + inputManagerF.systemRunning(); + } } catch (Throwable e) { reportWtf("Notifying InputManagerService running", e); } traceEnd(); traceBeginAndSlog("MakeTelephonyRegistryReady"); try { - if (telephonyRegistryF != null) telephonyRegistryF.systemRunning(); + if (telephonyRegistryF != null) { + telephonyRegistryF.systemRunning(); + } } catch (Throwable e) { reportWtf("Notifying TelephonyRegistry running", e); } traceEnd(); traceBeginAndSlog("MakeMediaRouterServiceReady"); try { - if (mediaRouterF != null) mediaRouterF.systemRunning(); + if (mediaRouterF != null) { + mediaRouterF.systemRunning(); + } } catch (Throwable e) { reportWtf("Notifying MediaRouterService running", e); } traceEnd(); traceBeginAndSlog("MakeMmsServiceReady"); try { - if (mmsServiceF != null) mmsServiceF.systemRunning(); + if (mmsServiceF != null) { + mmsServiceF.systemRunning(); + } } catch (Throwable e) { reportWtf("Notifying MmsService running", e); } @@ -2065,7 +2154,9 @@ public final class SystemServer { // in the build and should reliably be there. final IIncidentManager incident = IIncidentManager.Stub.asInterface( ServiceManager.getService(Context.INCIDENT_SERVICE)); - if (incident != null) incident.systemRunning(); + if (incident != null) { + incident.systemRunning(); + } } catch (Throwable e) { reportWtf("Notifying incident daemon running", e); } @@ -2076,7 +2167,7 @@ public final class SystemServer { static final void startSystemUi(Context context, WindowManagerService windowManager) { Intent intent = new Intent(); intent.setComponent(new ComponentName("com.android.systemui", - "com.android.systemui.SystemUIService")); + "com.android.systemui.SystemUIService")); intent.addFlags(Intent.FLAG_DEBUG_TRIAGED_MISSING); //Slog.d(TAG, "Starting service: " + intent); context.startServiceAsUser(intent, UserHandle.SYSTEM); |