从SystemServer开始:
SystemServer-----》SystemUIService-----》SystemUIApplication.startServicesIfNeeded()
startServicesIfNeeded()方法会遍历一个固定数组,分别调用数组中相应的start()方法,其中包括SystemBars.start()方法!
然后SystemBars.start()----》ServiceMonitor.start()
在ServiceMonitor.start()中会通过发送MSG_START_SERVICE消息执行startService()方法,startService()又去回调onNoService(),其实现是在SystemBars里面:SystemBars.onNoService()-----》createStatusBarFromConfig()
在createStatusBarFromConfig里面获得PhoneStatusBar的对象,调用其start()方法;
PhoneStatusBar.start()---》BaseStatusBar.start()----》createAndAddWindows()----》addStatusBarWindow()----》makeStatusBarView()
在makeStatusBarView()中加载了SystemUI的总布局文件super_status_bar.xml,
最外层的是StatusBarWindowView,里面包含了:
BackDropView:
ScrimView:scrim_behind 后遮罩
statusbar: 状态栏 PhoneStatusBarView继承PanelBar
brightness_mirror:亮度调节
PanelHolder:包含NotificationPanelView,其继承自PanelView
ScrimView:scrim_in_front 前遮罩