Android 11.0 system starts up the third-party app automatically

1 Introduction

  In the 11.0 system rom customization development, because some third-party apps need to start the app after receiving the boot broadcast, but after 10.0, the third-party app cannot receive the boot broadcast. Only the system app can receive the boot broadcast
. Yes, so it is impossible to start automatically by receiving the start-up broadcast in the app. This requires adding the function of monitoring the start-up completion broadcast in the system, and then
starting the third-party app after receiving the start-up broadcast.

2. The system starts the core class of the third-party app automatically

 frameworks/base/services/core/java/com/android/server/policy/PhoneWindowManager.java

3. Analysis and implementation of the core functions of the third-party app since the system boots up
3.1 Common methods of receiving boot broadcasts in apps

             <receiver
                android:name=".receiver.StartSelfReceiver"
                android:enabled="true"
                android:exported="true"
                android:permission="android.permission.RECEIVE_BOOT_COMPLETED">
                <intent-filter android:priority="1000">
                    <action android:name="android.intent.action.BOOT_COMPLETED"/>
                    <category android:name="androi

Guess you like

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