SystemUI启动,及其SystemUIService启动

Posted xhBruce

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了SystemUI启动,及其SystemUIService启动相关的知识,希望对你有一定的参考价值。

SystemUI启动,及其SystemUIService启动

android12-release


SystemServer.run() - startOtherServices - startSystemUi - context.startServiceAsUser - windowManager.onSystemUiStarted()


frameworks/base/core/res/res/values/config.xml

SystemUIService

com.android.systemui/com.android.systemui.SystemUIService
启动服务SystemUIService,运行在进程com.android.systemui
context.startServiceAsUser - SystemUIService.onCreate() - getApplication()).startServicesIfNeeded()


SystemUI服务要启动的类frameworks/base/packages/SystemUI/res/values/config.xml:config_systemUIServiceComponents

    <!-- SystemUI Services: The classes of the stuff to start. -->
    <string-array name="config_systemUIServiceComponents" translatable="false">
        <item>com.android.systemui.util.NotificationChannels</item>
        <item>com.android.systemui.keyguard.KeyguardViewMediator</item>
        <item>com.android.systemui.recents.Recents</item>
        <item>com.android.systemui.volume.VolumeUI</item>
        <item>com.android.systemui.statusbar.phone.StatusBar</item>
        <item>com.android.systemui.usb.StorageNotification</item>
        <item>com.android.systemui.power.PowerUI</item>
        <item>com.android.systemui.media.RingtonePlayer</item>
        <item>com.android.systemui.keyboard.KeyboardUI</item>
        <item>com.android.systemui.shortcut.ShortcutKeyDispatcher</item>
        <item>@string/config_systemUIVendorServiceComponent</item>
        <item>com.android.systemui.util.leak.GarbageMonitor$Service</item>
        <item>com.android.systemui.LatencyTester</item>
        <item>com.android.systemui.globalactions.GlobalActionsComponent</item>
        <item>com.android.systemui.ScreenDecorations</item>
        <item>com.android.systemui.biometrics.AuthController</item>
        <item>com.android.systemui.SliceBroadcastRelayHandler</item>
        <item>com.android.systemui.statusbar.notification.InstantAppNotifier</item>
        <item>com.android.systemui.theme.ThemeOverlayController</item>
        <item>com.android.systemui.accessibility.WindowMagnification</item>
        <item>com.android.systemui.accessibility.SystemActions</item>
        <item>com.android.systemui.toast.ToastUI</item>
        <item>com.android.systemui.wmshell.WMShell</item>
    </string-array>

例如com.android.systemui.statusbar.phone.StatusBar

startServicesIfNeeded - new StatusBar - StatusBar.start()

start():

  • createAndAddWindows(result) 添加状态栏
  • setUpPresenter() 设置初始通知状态NotificationsController.initialize
  • startKeyguard()
  • … …

流程图

以上是关于SystemUI启动,及其SystemUIService启动的主要内容,如果未能解决你的问题,请参考以下文章

android SystemUI 流程分析

Android 12系统源码_SystemUI系统状态栏StatusBar的创建流程

systemui.apk在啥位置

systemui.apk在哪

SystemUI之功能介绍和UI布局介绍

SystemUI之功能介绍和UI布局介绍