How to know when the system UI loads in
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.
SystemServeris "done" with the core system services, including
StatusBarManagerService*, it informs the 3rd party code that the system is ready and starts the system UI (line 870), or more precise,
SystemUIServiceis just an
Androidapplication component whose
onCreate()method starts/initializes UI components and stores references to the components in the
SystemUItype. The 1st element (
mServices) is either the status bar or system bar (status + nav bar).
BaseStatusBar, the implementation of the abstract
SystemUIclass, does some UI stuff (like adding views to
WindowManageretc.). Additionally it declares a range of abstract UI-related methods (e.g.
createAndAddWindows(): lines 127 - 133) to be implemented by subclasses, e.g.
TabletStatusBaretc. *** deal with multiple classes basically subclassed from
Viewwhose drawing (so does status bar's drawing) takes place in the
Activity's (the one with
onResume()method returns (and bootanimation exits) despite the fact all the views the status bar is composed of have already been drawn.