当SystemUI在Android Boot中加载时 [英] When SystemUI loads in Android Boot
问题描述
如何知道何时在 Android
引导过程中加载系统UI?
状态栏和导航栏视图在哪里绘制?
由于 SystemUI
是特权应用程序,因此它是否在启动应用程序(主屏幕)启动之前加载?
我不确定。欢迎提出任何建议。
How to know when the system UI loads in Android
boot process?
Where exactly the status bar and navigation bar view draws?
As SystemUI
is a privileged app so is it loading before the start of a launcher app (Home screen)?
I am not sure. Any suggestion is welcome.
推荐答案
下面是一连串简短说明的步骤,希望可以阐明一些步骤。在引导时加载系统UI组件。我将在 Android
4.2上进行演示,尽管其他版本的序列非常相似。
Below is a chain of briefly explained steps that hopefully shed some light on the sequence of "loading" the system UI components at boot time. I'll demonstrate it on Android
4.2, although the sequence is quite similar for the other versions.
- 当
SystemServer
与核心系统服务完成时,包括StatusBarManagerService
*,它通知第三方代码系统已准备就绪并启动系统用户界面(第870行)或更准确地说,com.android.systemui
中的SystemUIService
包**。 -
SystemUIService
只是一个Android
应用程序组件,其onCreate()
方法启动/初始化UI组件并将对组件的引用存储在mServices [] 数组中/java/ext/com.google.android/android/4.2.1_r1.2/com/android/systemui/SystemUI.java#25 rel = noreferrer> SystemUI
类型。第一个元素(mServices [0]
)是状态栏或系统栏(状态+导航栏)。 -
BaseStatusBar
,是抽象SystemUI
类的实现,它可以执行一些UI内容(例如将视图添加到WindowManager
等)。另外,它声明了一系列与UI相关的抽象方法(例如createAndAddWindows()
)由子类实现,例如PhoneStatusBar
。 - 状态栏和导航栏不是由单个视图组成。
BaseStatusBar
这样的子类,例如PhoneStatusBar
,TabletStatusBar
等。* **处理基本上从View $继承的多个类c $ c>
的图形(状态栏的图形也是如此)发生在onDraw()
方法。 - 重要说明: 在系统启动时,状态栏(和软件导航栏)直到启动器
Activity
(带有android.intent.category.HOME
)onResume()
方法返回(并且退出动画退出),尽管状态栏所组成的所有视图均已布局。
- When
SystemServer
is "done" with the core system services, includingStatusBarManagerService
*, it informs the 3rd party code that the system is ready and starts the system UI (line 870), or more precise,SystemUIService
in thecom.android.systemui
package **. SystemUIService
is just anAndroid
application component whoseonCreate()
method starts/initializes UI components and stores references to the components in themServices[]
array ofSystemUI
type. The 1st element (mServices[0]
) is either the status bar or system bar (status + nav bar).BaseStatusBar
, the implementation of the abstractSystemUI
class, does some UI stuff (like adding views toWindowManager
etc.). Additionally it declares a range of abstract UI-related methods (e.g.createAndAddWindows()
) to be implemented by subclasses, e.g.PhoneStatusBar
.- The status bar and navigation bar aren't composed of a single view. Such subclasses of
BaseStatusBar
asPhoneStatusBar
,TabletStatusBar
etc. *** deal with multiple classes basically subclassed fromView
whose drawing (so does status bar's drawing) takes place in theonDraw()
method. - Important note: on system boot the status bar (and software navigation bar) won't be visible until the launcher
Activity
's (the one withandroid.intent.category.HOME
)onResume()
method returns (and bootanimation exits) despite the fact all the views the status bar is composed of have already been laid out.
AOSP :
* frameworks / base /服务/ java / com / android / server /
** frameworks / base / packages / SystemUI / src / com / android / systemui / SystemUIService.java < br> *** frameworks / base / packages / SystemUI / src / com / android / systemui / statusbar /
这篇关于当SystemUI在Android Boot中加载时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!