AMS remveTask function learning summary

Background to the issue
based on the list of issues to address, understand the framework in the process kill process to be executed
Music + when playing music, generates two processes, the name
com.android.mediacenter: UI process
the process of playing music: com.android.mediacenter.localmusic .mediaplaybackservice
1removeTask timing diagram of
Here Insert Picture Description
the background music, click on the recent app in the "one key clear" button, all of the task will be remove; it is how to implement the Framework layer? After clicking "a key to clear" button, the call AMS of removeTask interfaces, the individual apk kill off the process, see the following timing diagram of specific implementation;

2 illustrate each step
2.11 to 3 steps
Kill off music UI process, passing the flag parameter values, such killProcesses is true, and the process for the case setSchedGroup UI Process.THREAD_GROUP_BG_NONINTERACTIVE, thus the kill;
2.24 ~ step. 8
received UI process after being kill the message, triggers the AMS inner class AppDeathRecipient binderDied function; died off after performing the UI process, the process-related processing, for example, at this time there is no associated service needs kill off, or with associated broadcast needed removed; music + that is playing in the background of the service needs to be processed;
2.39 to 12 steps
in the step 10, will ServiceRecord ProcessRecord belongs (i.e. main process) attribute r.app.execServicesFg = false is set to false;
the call to compute

Guess you like

Origin blog.csdn.net/qq_42894864/article/details/104075551