summaryrefslogtreecommitdiff
path: root/services/java
diff options
context:
space:
mode:
Diffstat (limited to 'services/java')
-rw-r--r--services/java/com/android/server/SystemServer.java413
1 files changed, 366 insertions, 47 deletions
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index 18c7e128b04e..d50db91acc99 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -36,6 +36,7 @@ import android.app.AppCompatCallbacks;
import android.app.ApplicationErrorReport;
import android.app.INotificationManager;
import android.app.SystemServiceRegistry;
+import android.app.admin.DevicePolicySafetyChecker;
import android.app.usage.UsageStatsManagerInternal;
import android.content.ContentResolver;
import android.content.Context;
@@ -48,6 +49,7 @@ import android.content.res.Resources.Theme;
import android.database.sqlite.SQLiteCompatibilityWalFlags;
import android.database.sqlite.SQLiteGlobal;
import android.graphics.GraphicsStatsService;
+import android.graphics.Typeface;
import android.hardware.display.DisplayManagerInternal;
import android.net.ConnectivityManager;
import android.net.ConnectivityModuleConnector;
@@ -80,17 +82,22 @@ import android.sysprop.VoldProperties;
import android.system.ErrnoException;
import android.system.Os;
import android.text.TextUtils;
+import android.util.ArrayMap;
import android.util.DisplayMetrics;
import android.util.EventLog;
+import android.util.IndentingPrintWriter;
import android.util.Pair;
import android.util.Slog;
+import android.util.TimeUtils;
import android.view.contentcapture.ContentCaptureManager;
import com.android.i18n.timezone.ZoneInfoDb;
import com.android.internal.R;
+import com.android.internal.annotations.GuardedBy;
import com.android.internal.notification.SystemNotificationChannels;
import com.android.internal.os.BinderInternal;
import com.android.internal.os.RuntimeInit;
+import com.android.internal.policy.AttributeCache;
import com.android.internal.util.ConcurrentUtils;
import com.android.internal.util.EmergencyAffordanceManager;
import com.android.internal.util.FrameworkStatsLog;
@@ -101,9 +108,10 @@ import com.android.server.attention.AttentionManagerService;
import com.android.server.audio.AudioService;
import com.android.server.biometrics.AuthService;
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.biometrics.sensors.BiometricServiceCallback;
+import com.android.server.biometrics.sensors.face.FaceService;
+import com.android.server.biometrics.sensors.fingerprint.FingerprintService;
+import com.android.server.biometrics.sensors.iris.IrisService;
import com.android.server.broadcastradio.BroadcastRadioService;
import com.android.server.camera.CameraServiceProxy;
import com.android.server.clipboard.ClipboardService;
@@ -112,11 +120,13 @@ import com.android.server.compat.PlatformCompatNative;
import com.android.server.contentcapture.ContentCaptureManagerInternal;
import com.android.server.coverage.CoverageService;
import com.android.server.devicepolicy.DevicePolicyManagerService;
+import com.android.server.devicestate.DeviceStateManagerService;
import com.android.server.display.DisplayManagerService;
import com.android.server.display.color.ColorDisplayService;
import com.android.server.dreams.DreamManagerService;
import com.android.server.emergency.EmergencyAffordanceService;
import com.android.server.gpu.GpuService;
+import com.android.server.graphics.fonts.FontManagerService;
import com.android.server.hdmi.HdmiControlService;
import com.android.server.incident.IncidentCompanionService;
import com.android.server.input.InputManagerService;
@@ -126,9 +136,8 @@ import com.android.server.inputmethod.MultiClientInputMethodManagerService;
import com.android.server.integrity.AppIntegrityManagerService;
import com.android.server.lights.LightsService;
import com.android.server.location.LocationManagerService;
-import com.android.server.media.MediaResourceMonitorService;
import com.android.server.media.MediaRouterService;
-import com.android.server.media.MediaSessionService;
+import com.android.server.media.metrics.MediaMetricsManagerService;
import com.android.server.media.projection.MediaProjectionManagerService;
import com.android.server.net.NetworkPolicyManagerService;
import com.android.server.net.NetworkStatsService;
@@ -152,16 +161,19 @@ import com.android.server.pm.PackageManagerService;
import com.android.server.pm.ShortcutService;
import com.android.server.pm.UserManagerService;
import com.android.server.pm.dex.SystemServerDexLoadReporter;
+import com.android.server.pm.verify.domain.DomainVerificationService;
import com.android.server.policy.PermissionPolicyService;
import com.android.server.policy.PhoneWindowManager;
-import com.android.server.policy.role.LegacyRoleResolutionPolicy;
+import com.android.server.policy.role.RoleServicePlatformHelperImpl;
import com.android.server.power.PowerManagerService;
import com.android.server.power.ShutdownThread;
import com.android.server.power.ThermalManagerService;
+import com.android.server.powerstats.PowerStatsService;
import com.android.server.profcollect.ProfcollectForwardingService;
import com.android.server.recoverysystem.RecoverySystemService;
import com.android.server.restrictions.RestrictionsManagerService;
-import com.android.server.role.RoleManagerService;
+import com.android.server.role.RoleServicePlatformHelper;
+import com.android.server.rotationresolver.RotationResolverManagerService;
import com.android.server.security.FileIntegrityService;
import com.android.server.security.KeyAttestationApplicationIdProviderService;
import com.android.server.security.KeyChainSystemService;
@@ -183,6 +195,7 @@ import com.android.server.twilight.TwilightService;
import com.android.server.uri.UriGrantsManagerService;
import com.android.server.usage.UsageStatsService;
import com.android.server.utils.TimingsTraceAndSlog;
+import com.android.server.vibrator.VibratorManagerService;
import com.android.server.vr.VrManagerService;
import com.android.server.webkit.WebViewUpdateService;
import com.android.server.wm.ActivityTaskManagerService;
@@ -196,13 +209,23 @@ import com.google.android.startop.iorap.IorapForwardingService;
import java.io.File;
import java.io.FileDescriptor;
import java.io.IOException;
+import java.io.PrintWriter;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Date;
import java.util.LinkedList;
+import java.util.List;
import java.util.Locale;
import java.util.Timer;
+import java.util.TreeSet;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Future;
-public final class SystemServer {
+/**
+ * Entry point to {@code system_server}.
+ */
+public final class SystemServer implements Dumpable {
private static final String TAG = "SystemServer";
@@ -230,6 +253,10 @@ public final class SystemServer {
"com.android.server.companion.CompanionDeviceManagerService";
private static final String STATS_COMPANION_APEX_PATH =
"/apex/com.android.os.statsd/javalib/service-statsd.jar";
+ private static final String SCHEDULING_APEX_PATH =
+ "/apex/com.android.scheduling/javalib/service-scheduling.jar";
+ private static final String REBOOT_READINESS_LIFECYCLE_CLASS =
+ "com.android.server.scheduling.RebootReadinessManagerService$Lifecycle";
private static final String CONNECTIVITY_SERVICE_APEX_PATH =
"/apex/com.android.tethering/javalib/service-connectivity.jar";
private static final String STATS_COMPANION_LIFECYCLE_CLASS =
@@ -292,8 +319,14 @@ public final class SystemServer {
"com.android.server.autofill.AutofillManagerService";
private static final String CONTENT_CAPTURE_MANAGER_SERVICE_CLASS =
"com.android.server.contentcapture.ContentCaptureManagerService";
+ private static final String TRANSLATION_MANAGER_SERVICE_CLASS =
+ "com.android.server.translation.TranslationManagerService";
+ private static final String MUSIC_RECOGNITION_MANAGER_SERVICE_CLASS =
+ "com.android.server.musicrecognition.MusicRecognitionManagerService";
private static final String SYSTEM_CAPTIONS_MANAGER_SERVICE_CLASS =
"com.android.server.systemcaptions.SystemCaptionsManagerService";
+ private static final String TEXT_TO_SPEECH_MANAGER_SERVICE_CLASS =
+ "com.android.server.texttospeech.TextToSpeechManagerService";
private static final String TIME_ZONE_RULES_MANAGER_SERVICE_CLASS =
"com.android.server.timezone.RulesManagerService$Lifecycle";
private static final String IOT_SERVICE_CLASS =
@@ -306,24 +339,48 @@ public final class SystemServer {
"com.android.server.timedetector.TimeDetectorService$Lifecycle";
private static final String TIME_ZONE_DETECTOR_SERVICE_CLASS =
"com.android.server.timezonedetector.TimeZoneDetectorService$Lifecycle";
+ private static final String LOCATION_TIME_ZONE_MANAGER_SERVICE_CLASS =
+ "com.android.server.timezonedetector.location.LocationTimeZoneManagerService$Lifecycle";
+ private static final String GNSS_TIME_UPDATE_SERVICE_CLASS =
+ "com.android.server.timedetector.GnssTimeUpdateService$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 SPEECH_RECOGNITION_MANAGER_SERVICE_CLASS =
+ "com.android.server.speech.SpeechRecognitionManagerService";
private static final String APP_PREDICTION_MANAGER_SERVICE_CLASS =
"com.android.server.appprediction.AppPredictionManagerService";
private static final String CONTENT_SUGGESTIONS_SERVICE_CLASS =
"com.android.server.contentsuggestions.ContentSuggestionsManagerService";
+ private static final String SEARCH_UI_MANAGER_SERVICE_CLASS =
+ "com.android.server.searchui.SearchUiManagerService";
+ private static final String SMARTSPACE_MANAGER_SERVICE_CLASS =
+ "com.android.server.smartspace.SmartspaceManagerService";
private static final String DEVICE_IDLE_CONTROLLER_CLASS =
"com.android.server.DeviceIdleController";
private static final String BLOB_STORE_MANAGER_SERVICE_CLASS =
"com.android.server.blob.BlobStoreManagerService";
+ private static final String APP_SEARCH_MANAGER_SERVICE_CLASS =
+ "com.android.server.appsearch.AppSearchManagerService";
private static final String ROLLBACK_MANAGER_SERVICE_CLASS =
"com.android.server.rollback.RollbackManagerService";
+ private static final String ALARM_MANAGER_SERVICE_CLASS =
+ "com.android.server.alarm.AlarmManagerService";
+ private static final String MEDIA_SESSION_SERVICE_CLASS =
+ "com.android.server.media.MediaSessionService";
+ private static final String MEDIA_RESOURCE_MONITOR_SERVICE_CLASS =
+ "com.android.server.media.MediaResourceMonitorService";
private static final String CONNECTIVITY_SERVICE_INITIALIZER_CLASS =
"com.android.server.ConnectivityServiceInitializer";
private static final String IP_CONNECTIVITY_METRICS_CLASS =
"com.android.server.connectivity.IpConnectivityMetrics";
+ private static final String MEDIA_COMMUNICATION_SERVICE_CLASS =
+ "com.android.server.media.MediaCommunicationService";
+
+ private static final String ROLE_SERVICE_CLASS = "com.android.role.RoleService";
+ private static final String GAME_MANAGER_SERVICE_CLASS =
+ "com.android.server.app.GameManagerService$Lifecycle";
private static final String TETHERING_CONNECTOR_CLASS = "android.net.ITetheringConnector";
@@ -383,6 +440,9 @@ public final class SystemServer {
private Future<?> mZygotePreload;
private Future<?> mBlobStoreServiceStart;
+ private final SystemServerDumper mDumper = new SystemServerDumper();
+
+
/**
* The pending WTF to be logged into dropbox.
*/
@@ -433,6 +493,49 @@ public final class SystemServer {
private static native void fdtrackAbort();
+ private static final File HEAP_DUMP_PATH = new File("/data/system/heapdump/");
+ private static final int MAX_HEAP_DUMPS = 2;
+
+ /**
+ * Dump system_server's heap.
+ *
+ * For privacy reasons, these aren't automatically pulled into bugreports:
+ * they must be manually pulled by the user.
+ */
+ private static void dumpHprof() {
+ // hprof dumps are rather large, so ensure we don't fill the disk by generating
+ // hundreds of these that will live forever.
+ TreeSet<File> existingTombstones = new TreeSet<>();
+ for (File file : HEAP_DUMP_PATH.listFiles()) {
+ if (!file.isFile()) {
+ continue;
+ }
+ if (!file.getName().startsWith("fdtrack-")) {
+ continue;
+ }
+ existingTombstones.add(file);
+ }
+ if (existingTombstones.size() >= MAX_HEAP_DUMPS) {
+ for (int i = 0; i < MAX_HEAP_DUMPS - 1; ++i) {
+ // Leave the newest `MAX_HEAP_DUMPS - 1` tombstones in place.
+ existingTombstones.pollLast();
+ }
+ for (File file : existingTombstones) {
+ if (!file.delete()) {
+ Slog.w("System", "Failed to clean up hprof " + file);
+ }
+ }
+ }
+
+ try {
+ String date = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss").format(new Date());
+ String filename = "/data/system/heapdump/fdtrack-" + date + ".hprof";
+ Debug.dumpHprofData(filename);
+ } catch (IOException ex) {
+ Slog.e("System", "Failed to dump fdtrack hprof", ex);
+ }
+ }
+
/**
* Spawn a thread that monitors for fd leaks.
*/
@@ -457,6 +560,7 @@ public final class SystemServer {
enabled = true;
} else if (maxFd > abortThreshold) {
Slog.i("System", "fdtrack abort threshold reached, dumping and aborting");
+ dumpHprof();
fdtrackAbort();
}
@@ -505,6 +609,75 @@ public final class SystemServer {
mRuntimeRestart = "1".equals(SystemProperties.get("sys.boot_completed"));
}
+ @Override
+ public void dump(IndentingPrintWriter pw, String[] args) {
+ pw.printf("Runtime restart: %b\n", mRuntimeRestart);
+ pw.printf("Start count: %d\n", mStartCount);
+ pw.print("Runtime start-up time: ");
+ TimeUtils.formatDuration(mRuntimeStartUptime, pw); pw.println();
+ pw.print("Runtime start-elapsed time: ");
+ TimeUtils.formatDuration(mRuntimeStartElapsedTime, pw); pw.println();
+ }
+
+ private final class SystemServerDumper extends Binder {
+
+ @GuardedBy("mDumpables")
+ private final ArrayMap<String, Dumpable> mDumpables = new ArrayMap<>(4);
+
+ @Override
+ protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
+ final boolean hasArgs = args != null && args.length > 0;
+
+ synchronized (mDumpables) {
+ if (hasArgs && "--list".equals(args[0])) {
+ final int dumpablesSize = mDumpables.size();
+ for (int i = 0; i < dumpablesSize; i++) {
+ pw.println(mDumpables.keyAt(i));
+ }
+ return;
+ }
+
+ if (hasArgs && "--name".equals(args[0])) {
+ if (args.length < 2) {
+ pw.println("Must pass at least one argument to --name");
+ return;
+ }
+ final String name = args[1];
+ final Dumpable dumpable = mDumpables.get(name);
+ if (dumpable == null) {
+ pw.printf("No dummpable named %s\n", name);
+ return;
+ }
+
+ try (IndentingPrintWriter ipw = new IndentingPrintWriter(pw, " ")) {
+ // Strip --name DUMPABLE from args
+ final String[] actualArgs = Arrays.copyOfRange(args, 2, args.length);
+ dumpable.dump(ipw, actualArgs);
+ }
+ return;
+ }
+
+ final int dumpablesSize = mDumpables.size();
+ try (IndentingPrintWriter ipw = new IndentingPrintWriter(pw, " ")) {
+ for (int i = 0; i < dumpablesSize; i++) {
+ final Dumpable dumpable = mDumpables.valueAt(i);
+ ipw.printf("%s:\n", dumpable.getDumpableName());
+ ipw.increaseIndent();
+ dumpable.dump(ipw, args);
+ ipw.decreaseIndent();
+ ipw.println();
+ }
+ }
+ }
+ }
+
+ private void addDumpable(@NonNull Dumpable dumpable) {
+ synchronized (mDumpables) {
+ mDumpables.put(dumpable.getDumpableName(), dumpable);
+ }
+ }
+ }
+
private void run() {
TimingsTraceAndSlog t = new TimingsTraceAndSlog();
try {
@@ -631,13 +804,28 @@ public final class SystemServer {
// Call per-process mainline module initialization.
ActivityThread.initializeMainlineModules();
+ // Sets the dumper service
+ ServiceManager.addService("system_server_dumper", mDumper);
+ mDumper.addDumpable(this);
+
// Create the system service manager.
mSystemServiceManager = new SystemServiceManager(mSystemContext);
mSystemServiceManager.setStartInfo(mRuntimeRestart,
mRuntimeStartElapsedTime, mRuntimeStartUptime);
+ mDumper.addDumpable(mSystemServiceManager);
+
LocalServices.addService(SystemServiceManager.class, mSystemServiceManager);
// Prepare the thread pool for init tasks that can be parallelized
- SystemServerInitThreadPool.start();
+ SystemServerInitThreadPool tp = SystemServerInitThreadPool.start();
+ mDumper.addDumpable(tp);
+
+ // Load preinstalled system fonts for system server, so that WindowManagerService, etc
+ // can start using Typeface. Note that fonts are required not only for text rendering,
+ // but also for some text operations (e.g. TextUtils.makeSafeForPresentation()).
+ if (Typeface.ENABLE_LAZY_TYPEFACE_INITIALIZATION) {
+ Typeface.loadPreinstalledSystemFontMap();
+ }
+
// Attach JVMTI agent if this is a debuggable build and the system property is set.
if (Build.IS_DEBUGGABLE) {
// Property is of the form "library_path=parameters".
@@ -831,6 +1019,11 @@ public final class SystemServer {
mSystemServiceManager.startService(UriGrantsManagerService.Lifecycle.class);
t.traceEnd();
+ t.traceBegin("StartPowerStatsService");
+ // Tracks rail data to be used for power statistics.
+ mSystemServiceManager.startService(PowerStatsService.class);
+ t.traceEnd();
+
// Activity manager runs the show.
t.traceBegin("StartActivityManager");
// TODO: Might need to move after migration to WM.
@@ -924,11 +1117,18 @@ public final class SystemServer {
SystemClock.elapsedRealtime());
}
+ t.traceBegin("StartDomainVerificationService");
+ DomainVerificationService domainVerificationService = new DomainVerificationService(
+ mSystemContext, SystemConfig.getInstance(), platformCompat);
+ mSystemServiceManager.startService(domainVerificationService);
+ t.traceEnd();
+
t.traceBegin("StartPackageManagerService");
try {
Watchdog.getInstance().pauseWatchingCurrentThread("packagemanagermain");
mPackageManagerService = PackageManagerService.main(mSystemContext, installer,
- mFactoryTestMode != FactoryTest.FACTORY_TEST_OFF, mOnlyCore);
+ domainVerificationService, mFactoryTestMode != FactoryTest.FACTORY_TEST_OFF,
+ mOnlyCore);
} finally {
Watchdog.getInstance().resumeWatchingCurrentThread("packagemanagermain");
}
@@ -1098,7 +1298,6 @@ public final class SystemServer {
t.traceBegin("startOtherServices");
final Context context = mSystemContext;
- VibratorService vibrator = null;
DynamicSystemService dynamicSystem = null;
IStorageManager storageManager = null;
NetworkManagementService networkManagement = null;
@@ -1202,7 +1401,7 @@ public final class SystemServer {
t.traceEnd();
t.traceBegin("InstallSystemProviders");
- mActivityManagerService.installSystemProviders();
+ mActivityManagerService.getContentProviderHelper().installSystemProviders();
// Now that SettingsProvider is ready, reactivate SQLiteCompatibilityWalFlags
SQLiteCompatibilityWalFlags.reset();
t.traceEnd();
@@ -1214,9 +1413,15 @@ public final class SystemServer {
mSystemServiceManager.startService(DropBoxManagerService.class);
t.traceEnd();
- t.traceBegin("StartVibratorService");
- vibrator = new VibratorService(context);
- ServiceManager.addService("vibrator", vibrator);
+ // Grants default permissions and defines roles
+ t.traceBegin("StartRoleManagerService");
+ LocalManagerRegistry.addManager(RoleServicePlatformHelper.class,
+ new RoleServicePlatformHelperImpl(mSystemContext));
+ mSystemServiceManager.startService(ROLE_SERVICE_CLASS);
+ t.traceEnd();
+
+ t.traceBegin("StartVibratorManagerService");
+ mSystemServiceManager.startService(VibratorManagerService.Lifecycle.class);
t.traceEnd();
t.traceBegin("StartDynamicSystemService");
@@ -1232,13 +1437,23 @@ public final class SystemServer {
}
t.traceBegin("StartAlarmManagerService");
- mSystemServiceManager.startService(new AlarmManagerService(context));
+ mSystemServiceManager.startService(ALARM_MANAGER_SERVICE_CLASS);
t.traceEnd();
t.traceBegin("StartInputManagerService");
inputManager = new InputManagerService(context);
t.traceEnd();
+ t.traceBegin("DeviceStateManagerService");
+ mSystemServiceManager.startService(DeviceStateManagerService.class);
+ t.traceEnd();
+
+ if (!disableCameraService) {
+ t.traceBegin("StartCameraServiceProxy");
+ mSystemServiceManager.startService(CameraServiceProxy.class);
+ t.traceEnd();
+ }
+
t.traceBegin("StartWindowManagerService");
// WMS needs sensor service ready
ConcurrentUtils.waitForFutureNoInterrupt(mSensorServiceStart, START_SENSOR_SERVICE);
@@ -1431,7 +1646,10 @@ public final class SystemServer {
}
t.traceEnd();
- if (mFactoryTestMode != FactoryTest.FACTORY_TEST_LOW_LEVEL) {
+ final DevicePolicyManagerService.Lifecycle dpms;
+ if (mFactoryTestMode == FactoryTest.FACTORY_TEST_LOW_LEVEL) {
+ dpms = null;
+ } else {
t.traceBegin("StartLockSettingsService");
try {
mSystemServiceManager.startService(LOCK_SETTINGS_SERVICE_CLASS);
@@ -1468,7 +1686,7 @@ public final class SystemServer {
// Always start the Device Policy Manager, so that the API is compatible with
// API8.
t.traceBegin("StartDevicePolicyManager");
- mSystemServiceManager.startService(DevicePolicyManagerService.Lifecycle.class);
+ dpms = mSystemServiceManager.startService(DevicePolicyManagerService.Lifecycle.class);
t.traceEnd();
if (!isWatch) {
@@ -1482,10 +1700,31 @@ public final class SystemServer {
t.traceEnd();
}
+ if (deviceHasConfigString(context,
+ R.string.config_defaultMusicRecognitionService)) {
+ t.traceBegin("StartMusicRecognitionManagerService");
+ mSystemServiceManager.startService(MUSIC_RECOGNITION_MANAGER_SERVICE_CLASS);
+ t.traceEnd();
+ } else {
+ Slog.d(TAG,
+ "MusicRecognitionManagerService not defined by OEM or disabled by flag");
+ }
+
startContentCaptureService(context, t);
startAttentionService(context, t);
-
+ startRotationResolverService(context, t);
startSystemCaptionsManagerService(context, t);
+ startTextToSpeechManagerService(context, t);
+
+ // System Speech Recognition Service
+ if (deviceHasConfigString(context,
+ R.string.config_defaultOnDeviceSpeechRecognitionService)) {
+ t.traceBegin("StartSpeechRecognitionManagerService");
+ mSystemServiceManager.startService(SPEECH_RECOGNITION_MANAGER_SERVICE_CLASS);
+ t.traceEnd();
+ } else {
+ Slog.d(TAG, "System speech recognition is not defined by OEM");
+ }
// App prediction manager service
if (deviceHasConfigString(context, R.string.config_defaultAppPredictionService)) {
@@ -1505,6 +1744,18 @@ public final class SystemServer {
Slog.d(TAG, "ContentSuggestionsService not defined by OEM");
}
+ // Search UI manager service
+ // TODO: add deviceHasConfigString(context, R.string.config_defaultSearchUiService)
+ t.traceBegin("StartSearchUiService");
+ mSystemServiceManager.startService(SEARCH_UI_MANAGER_SERVICE_CLASS);
+ t.traceEnd();
+
+ // Smartspace manager service
+ // TODO: add deviceHasConfigString(context, R.string.config_defaultSmartspaceService)
+ t.traceBegin("StartSmartspaceService");
+ mSystemServiceManager.startService(SMARTSPACE_MANAGER_SERVICE_CLASS);
+ t.traceEnd();
+
t.traceBegin("InitConnectivityModuleConnector");
try {
ConnectivityModuleConnector.getInstance().init(context);
@@ -1540,6 +1791,10 @@ public final class SystemServer {
}
t.traceEnd();
+ t.traceBegin("StartFontManagerService");
+ mSystemServiceManager.startService(FontManagerService.Lifecycle.class);
+ t.traceEnd();
+
t.traceBegin("StartTextServicesManager");
mSystemServiceManager.startService(TextServicesManagerService.Lifecycle.class);
t.traceEnd();
@@ -1712,7 +1967,7 @@ public final class SystemServer {
try {
mSystemServiceManager.startService(TIME_DETECTOR_SERVICE_CLASS);
} catch (Throwable e) {
- reportWtf("starting StartTimeDetectorService service", e);
+ reportWtf("starting TimeDetectorService service", e);
}
t.traceEnd();
@@ -1720,10 +1975,28 @@ public final class SystemServer {
try {
mSystemServiceManager.startService(TIME_ZONE_DETECTOR_SERVICE_CLASS);
} catch (Throwable e) {
- reportWtf("starting StartTimeZoneDetectorService service", e);
+ reportWtf("starting TimeZoneDetectorService service", e);
+ }
+ t.traceEnd();
+
+ t.traceBegin("StartLocationTimeZoneManagerService");
+ try {
+ mSystemServiceManager.startService(LOCATION_TIME_ZONE_MANAGER_SERVICE_CLASS);
+ } catch (Throwable e) {
+ reportWtf("starting LocationTimeZoneManagerService service", e);
}
t.traceEnd();
+ if (context.getResources().getBoolean(R.bool.config_enableGnssTimeUpdateService)) {
+ t.traceBegin("StartGnssTimeUpdateService");
+ try {
+ mSystemServiceManager.startService(GNSS_TIME_UPDATE_SERVICE_CLASS);
+ } catch (Throwable e) {
+ reportWtf("starting GnssTimeUpdateService service", e);
+ }
+ t.traceEnd();
+ }
+
if (!isWatch) {
t.traceBegin("StartSearchManagerService");
try {
@@ -1868,12 +2141,6 @@ public final class SystemServer {
t.traceEnd();
}
- // Grants default permissions and defines roles
- t.traceBegin("StartRoleManagerService");
- mSystemServiceManager.startService(new RoleManagerService(
- mSystemContext, new LegacyRoleResolutionPolicy(mSystemContext)));
- t.traceEnd();
-
// We need to always start this service, regardless of whether the
// FEATURE_VOICE_RECOGNIZERS feature is set, because it needs to take care
// of initializing various settings. It will internally modify its behavior
@@ -1996,7 +2263,7 @@ public final class SystemServer {
t.traceEnd();
t.traceBegin("StartMediaSessionService");
- mSystemServiceManager.startService(MediaSessionService.class);
+ mSystemServiceManager.startService(MEDIA_SESSION_SERVICE_CLASS);
t.traceEnd();
if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_HDMI_CEC)) {
@@ -2020,7 +2287,7 @@ public final class SystemServer {
if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_PICTURE_IN_PICTURE)) {
t.traceBegin("StartMediaResourceMonitor");
- mSystemServiceManager.startService(MediaResourceMonitorService.class);
+ mSystemServiceManager.startService(MEDIA_RESOURCE_MONITOR_SERVICE_CLASS);
t.traceEnd();
}
@@ -2046,9 +2313,12 @@ public final class SystemServer {
final boolean hasFeatureFingerprint
= mPackageManager.hasSystemFeature(PackageManager.FEATURE_FINGERPRINT);
+ final List<BiometricServiceCallback> biometricServiceCallback = new ArrayList<>();
if (hasFeatureFace) {
t.traceBegin("StartFaceSensor");
- mSystemServiceManager.startService(FaceService.class);
+ final FaceService faceService =
+ mSystemServiceManager.startService(FaceService.class);
+ biometricServiceCallback.add(faceService);
t.traceEnd();
}
@@ -2060,13 +2330,20 @@ public final class SystemServer {
if (hasFeatureFingerprint) {
t.traceBegin("StartFingerprintSensor");
- mSystemServiceManager.startService(FingerprintService.class);
+ final FingerprintService fingerprintService =
+ mSystemServiceManager.startService(FingerprintService.class);
+ biometricServiceCallback.add(fingerprintService);
t.traceEnd();
}
- // Start this service after all biometric services.
+ // Start this service after all biometric sensor services are started.
t.traceBegin("StartBiometricService");
mSystemServiceManager.startService(BiometricService.class);
+ for (BiometricServiceCallback service : biometricServiceCallback) {
+ Slog.d(TAG, "Notifying onBiometricServiceReady for: "
+ + service.getClass().getSimpleName());
+ service.onBiometricServiceReady();
+ }
t.traceEnd();
t.traceBegin("StartAuthService");
@@ -2120,6 +2397,10 @@ public final class SystemServer {
t.traceBegin("StartPeopleService");
mSystemServiceManager.startService(PeopleService.class);
t.traceEnd();
+
+ t.traceBegin("StartMediaMetricsManager");
+ mSystemServiceManager.startService(MediaMetricsManagerService.class);
+ t.traceEnd();
}
if (!isWatch) {
@@ -2163,12 +2444,6 @@ public final class SystemServer {
t.traceEnd();
}
- if (!disableCameraService) {
- t.traceBegin("StartCameraServiceProxy");
- mSystemServiceManager.startService(CameraServiceProxy.class);
- t.traceEnd();
- }
-
if (context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_EMBEDDED)) {
t.traceBegin("StartIoTSystemService");
mSystemServiceManager.startService(IOT_SERVICE_CLASS);
@@ -2181,6 +2456,12 @@ public final class SystemServer {
STATS_COMPANION_LIFECYCLE_CLASS, STATS_COMPANION_APEX_PATH);
t.traceEnd();
+ // Reboot Readiness
+ t.traceBegin("StartRebootReadinessManagerService");
+ mSystemServiceManager.startServiceFromJar(
+ REBOOT_READINESS_LIFECYCLE_CLASS, SCHEDULING_APEX_PATH);
+ t.traceEnd();
+
// Statsd pulled atoms
t.traceBegin("StartStatsPullAtomService");
mSystemServiceManager.startService(STATS_PULL_ATOM_SERVICE_CLASS);
@@ -2206,6 +2487,13 @@ public final class SystemServer {
t.traceEnd();
}
+ // Translation manager service
+ if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_TRANSLATION)) {
+ t.traceBegin("StartTranslationManagerService");
+ mSystemServiceManager.startService(TRANSLATION_MANAGER_SERVICE_CLASS);
+ t.traceEnd();
+ }
+
// NOTE: ClipboardService depends on ContentCapture and Autofill
t.traceBegin("StartClipboardService");
mSystemServiceManager.startService(ClipboardService.class);
@@ -2222,14 +2510,6 @@ public final class SystemServer {
// It is now time to start up the app processes...
- t.traceBegin("MakeVibratorServiceReady");
- try {
- vibrator.systemReady();
- } catch (Throwable e) {
- reportWtf("making Vibrator Service ready", e);
- }
- t.traceEnd();
-
t.traceBegin("MakeLockSettingsServiceReady");
if (lockSettings != null) {
try {
@@ -2327,10 +2607,22 @@ public final class SystemServer {
}
t.traceEnd();
+ t.traceBegin("GameManagerService");
+ mSystemServiceManager.startService(GAME_MANAGER_SERVICE_CLASS);
+ t.traceEnd();
+
t.traceBegin("StartBootPhaseDeviceSpecificServicesReady");
mSystemServiceManager.startBootPhase(t, SystemService.PHASE_DEVICE_SPECIFIC_SERVICES_READY);
t.traceEnd();
+ t.traceBegin("AppSearchManagerService");
+ mSystemServiceManager.startService(APP_SEARCH_MANAGER_SERVICE_CLASS);
+ t.traceEnd();
+
+ t.traceBegin("StartMediaCommunicationService");
+ mSystemServiceManager.startService(MEDIA_COMMUNICATION_SERVICE_CLASS);
+ t.traceEnd();
+
ConcurrentUtils.waitForFutureNoInterrupt(mBlobStoreServiceStart,
START_BLOB_STORE_SERVICE);
@@ -2387,7 +2679,14 @@ public final class SystemServer {
if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE)) {
t.traceBegin("StartCarServiceHelperService");
- mSystemServiceManager.startService(CAR_SERVICE_HELPER_SERVICE_CLASS);
+ final SystemService cshs = mSystemServiceManager
+ .startService(CAR_SERVICE_HELPER_SERVICE_CLASS);
+ if (cshs instanceof Dumpable) {
+ mDumper.addDumpable((Dumpable) cshs);
+ }
+ if (cshs instanceof DevicePolicySafetyChecker) {
+ dpms.setDevicePolicySafetyChecker((DevicePolicySafetyChecker) cshs);
+ }
t.traceEnd();
}
@@ -2619,6 +2918,13 @@ public final class SystemServer {
t.traceEnd();
}
+ private void startTextToSpeechManagerService(@NonNull Context context,
+ @NonNull TimingsTraceAndSlog t) {
+ t.traceBegin("StartTextToSpeechManagerService");
+ mSystemServiceManager.startService(TEXT_TO_SPEECH_MANAGER_SERVICE_CLASS);
+ t.traceEnd();
+ }
+
private void startContentCaptureService(@NonNull Context context,
@NonNull TimingsTraceAndSlog t) {
// First check if it was explicitly enabled by DeviceConfig
@@ -2666,6 +2972,19 @@ public final class SystemServer {
t.traceEnd();
}
+ private void startRotationResolverService(@NonNull Context context,
+ @NonNull TimingsTraceAndSlog t) {
+ if (!RotationResolverManagerService.isServiceConfigured(context)) {
+ Slog.d(TAG, "RotationResolverService is not configured on this device");
+ return;
+ }
+
+ t.traceBegin("StartRotationResolverService");
+ mSystemServiceManager.startService(RotationResolverManagerService.class);
+ t.traceEnd();
+
+ }
+
private static void startSystemUi(Context context, WindowManagerService windowManager) {
PackageManagerInternal pm = LocalServices.getService(PackageManagerInternal.class);
Intent intent = new Intent();