忙碌之中,抽了点空更新SystemUI 定制化开发系列(2) 之 状态栏介绍,状态栏主要用于手机信息 (时间日期、电池电量等)和显示图标(SIM卡、通知、系统图标等)
SystemUI要启动的所有组件都是在数组 config_systemUIServiceComponents中定义的,路径如下:
- com.android.systemui.util.NotificationChannels
- com.android.systemui.keyguard.KeyguardViewMediator
- com.android.systemui.recents.Recents
- com.android.systemui.volume.VolumeUI
- com.android.systemui.statusbar.phone.StatusBar
- com.android.systemui.usb.StorageNotification
- com.android.systemui.power.PowerUI
- com.android.systemui.media.RingtonePlayer
- com.android.systemui.keyboard.KeyboardUI
- com.android.systemui.shortcut.ShortcutKeyDispatcher
- @string/config_systemUIVendorServiceComponent
- com.android.systemui.util.leak.GarbageMonitor$Service
- com.android.systemui.LatencyTester
- com.android.systemui.globalactions.GlobalActionsComponent
- com.android.systemui.ScreenDecorations
- com.android.systemui.biometrics.AuthController
- com.android.systemui.SliceBroadcastRelayHandler
- com.android.systemui.statusbar.notification.InstantAppNotifier
- com.android.systemui.theme.ThemeOverlayController
- com.android.systemui.accessibility.WindowMagnification
- com.android.systemui.accessibility.SystemActions
- com.android.systemui.toast.ToastUI
- com.android.systemui.wmshell.WMShell
关于锁屏状态栏所有显示逻辑实现都是在 NotificationPanelViewController.java中, 路径如下:
vendor/mediatek/proprietary/packages/apps/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java
显示布局 : keyguard_status_bar.xml 路径如下:
vendor/mediatek/proprietary/packages/apps/SystemUI/res/layout/keyguard_status_bar.xml
解锁后显示效果布局: status_bar.xml
路径如下:
vendor/mediatek/proprietary/packages/apps/SystemUI/res/layout/status_bar.xml
对应的逻辑类: PhoneStatusBarView.java
路径如下:
vendor/mediatek/proprietary/packages/apps/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java
主要在 QuickStatusBarHeader.java 类中控制,路径如下:
vendor/mediatek/proprietary/packages/apps/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
顶部日期显示布局: quick_status_bar_header_date_privacy.xml 路径如下:
vendor/mediatek/proprietary/packages/apps/SystemUI/res/layout/quick_status_bar_header_date_privacy.xml
显示系统时间和图标布局: quick_qs_status_icon.xml 路径如下:
vendor/mediatek/proprietary/packages/apps/SystemUI/res/layout/quick_qs_status_icons.xml
PS: 下一期我打算把 status_bar.xml 单独用一期详解下, 这个布局嵌套很深,网上基本找不到详解这个布局的, 但这个布局 个人觉得很重要,对小白很有帮助或维护SystemUI的同僚多少都会有点帮助吧!
(创作不易,要是感觉对大家有用的话,就帮点个赞吧!多谢。。。)