Source code analysis of monitoring whether the launcher is started during the startup process in Android 9.0 framework

1 Introduction

In the system development of 9.0, during the system startup phase, after the first startup animation is played, some products will have a black screen. At this time, it is necessary to determine whether the current Launcher has been started, and then do related processing. Next
, Let’s analyze the source code analysis to determine whether the launcher has been started.

2. The core class that monitors whether the launcher starts the completed source code analysis during the startup process in 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

3. Functional analysis and implementation of source code analysis to monitor whether the launcher is started during the startup process in the framework

In the system framework layer, ActivityThread.java manages the execution of the main thread of the application process (equivalent to the main entry function of an ordinary Java program), and according to the requirements of AMS (through the IApplicationThread interface, AMS is Client, ActivityThread.ApplicationThread is Server
) Responsible for scheduling and executing activities, broadcasts and other operations

In the system, AMS (ActivityManagerService.java) is responsible for starting the Launcher. After the Launcher is started, that is, after Activity onResume, a boot completion broadcast will be sent, indicating that the current
system has been started. And in Launcher's Activity in the onResume method&#x

Guess you like

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