1 Introduction
In the system development of 10.0, during the startup stage of the system, after the first startup animation is played, some products will have a black screen. At this time, it is necessary to judge whether the current Launcher has been started, and then do related processing. Next
, Let's analyze the source code analysis on judging whether the launcher is started
2. The core class of the source code analysis that monitors whether the launcher is started during the startup process of the framework
frameworks/base/core/java/android/app/ActivityThread.java
frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
frameworks/base/core/java/android/os/MessageQueue.java
3. The functional analysis and implementation of the source code analysis that monitors whether the launcher is started during the startup process of the framework
In the system, the AMS, namely ActivityManagerService.java, is responsible for starting the Launcher. After the Launcher is started, that is, after the Activity onResume, it will send a start-up completion broadcast, indicating that the current
system is started. In the onResume method of the Launcher's Activity,
the handleResumeActivity method is executed. After the window is loaded in the handleResumeActivity, the IdleHandler implemented by itself is added to its own message queue.