Source code analysis of monitoring whether the launcher is started during the boot process in the Android 11.0 framework

1 Introduction

In the system development of 11.0, during the system startup stage, after the first startup animation is played, some products will have a black screen. In order to solve the black screen problem, 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 android system, in the system startup process, AMS (ActivityManagerService.java) is mainly responsible for starting the Launcher. After the Launcher is started, that is, after the Activity onResume, it will send a boot completion broadcast, indicating that the current system startup is complete
. 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.

3.1 ActivityThr

Guess you like

Origin blog.csdn.net/baidu_41666295/article/details/131504680