systemserver jobDo

上面已经启动system_run那么本文主要介绍SystemServer 主要工作

main()
    ---->SystemServer().run()
          ------> 
                 traceBeginAndSlog("StartServices");
                 startBootstrapServices();
                 startCoreServices();
                 startOtherServices();
                 SystemServerInitThreadPool.shutdown();
                 Looper.loop();
system jobdo

frameworks/base/services/java/com/android/server/SystemServer.java

=================================================开始>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
SystemProperties.set("persist.sys.timezone", "GMT");---》时间设定
VMRuntime.getRuntime().clearGrowthLimit();--》more memory
Build.ensureFingerprintProperty();--》指纹property
Environment.setUserRequired(true);
BinderInternal.setMaxThreads(sMaxBinderThreads);--》max thread binder  限制
System.loadLibrary("android_servers");----》init native service , 加载
performPendingShutdown();
createSystemContext();
LocalServices.addService(SystemServiceManager.class, mSystemServiceManager);----->
-------->create load system service manager

SystemServerInitThreadPool.get();--->获取thread pool

========================================startBootstrapServices>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
StartInstaller
StartActivityManager
StartPowerManager
StartRecoverySystemService
StartLightsService
StartDisplayManager
-=========================================PHASE_WAIT_FOR_DEFAULT_DISPLAY=100>>>>>>>>>>>>>>>>
StartPackageManagerService
StartOtaDexOptService
StartUserManagerService
InitAttributerCache
SetSystemProcess---->mActivityManagerService.setSystemProcess();
StartOverlayManagerService

========================================startCoreServices>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
StartUsageService
StartBatteryService
StartWebViewUpdateService
StartBinderCallsStatsService
========================================startOtherServices>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
StartKeyAttestationApplicationIdProviderService
StartKeyChainSystemService
StartSchedulingPolicyService
StartTelecomLoaderService
StartTelephonyRegistry
StartEntropyMixer
StartAccountManagerService
StartContentService
InstallSystemProviders
StartDropBoxManager
StartVibratorService
StartAlarmManagerService
InitWatchdog
StartInputManagerService
StartWindowManagerService
SetWindowManagerService
WindowManagerServiceOnInitReady
StartVrManagerService
StartInputManager
StartBluetoothService
NetworkWatchlistService
StartAccessibilityManagerService
StartStorageManagerService
StartUiModeManager
StartLockSettingsService
StartPersistentDataBlock
StartDeviceIdleController
StartDevicePolicyManager
StartClipboardService
StartNetworkManagementService
StartIpSecService
StartTextServicesManager
StartConnectivityService
StartNsdService
StartAudioService
StartDockObserver
StartWiredAccessoryManager
StartUsbService
StartSerialService
StartJobScheduler
StartSoundTrigger
StartTrustManager
StartGestureLauncher
StartSensorNotification
StartContextHubSystemService
StartCommonTimeManagementService
StartDreamManager
StartPrintManager
StartRestrictionManager
StartMediaSessionService
StartHdmiControlService
StartTvInputManager
StartMediaResourceMonitor
StartMediaRouterService
StartFingerprintSensor
StartBackgroundDexOptService
StartShortcutServiceLifecycle
StartWearConfigService
StartCameraServiceProxy
StartMmsService
=========================PHASE_LOCK_SETTINGS_READY=480>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
StartBootPhaseSystemServicesReady
=========================PHASE_SYSTEM_SERVICES_READY=500>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
MakeWindowManagerServiceReady
MakePowerManagerServiceReady
MakePackageManagerServiceReady
MakeDisplayManagerServiceReady
StartDeviceSpecificServices
=========================PHASE_DEVICE_SPECIFIC_SERVICES_READY=520>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Making services ready
StartActivityManagerReadyPhase
=========================PHASE_ACTIVITY_MANAGER_READY=550>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
StartObservingNativeCrashes
WebViewFactoryPreparation
Zygote preload
StartCarServiceHelperService
StartSystemUI
MakeNetworkStatsServiceReady
MakeNetworkPolicyServiceReady
StartWatchdog
PhaseThirdPartyAppsCanStart
=========================PHASE_THIRD_PARTY_APPS_CAN_START=600>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
MakeLocationServiceReady
MakeCommonTimeManagementServiceReady
MakeInputManagerServiceReady
MakeMmsServiceReady
IncidentDaemonReady

PHASE_BOOT_COMPLETED=1000 发送时机

你可能感兴趣的:(systemserver jobDo)