The platform releases BOOT_COMPLETED broadcast reception

After android 3.1, the self-starting of boot is restricted, and there is no program that has been manually started, and the boot broadcast cannot be
received
. Modification method: add intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES to the place where AMS sends the BOOT_COMPLETED broadcast, and the application that has been stopped can also receive this)

Broadcast Notes:
1. The application installed on the sdcard cannot receive the broadcast, and the sdcard is mounted late
. 2. The system has turned on the Fast Boot mode, and the system will not send the BOOT_COMPLETED broadcast
. 3. Since the startup time is late, you can increase the broadcast reception Priority
<intent-filter android:priority="1000">
// The boot time can be advanced in advance -1000 ---- 1000
   <action android:name="android.intent.action.BOOT_COMPLETED" />
</intent- filter>

android:priority 
    The priority that should be given to the parent component with regard to handling intents of the type described by the filter. This attribute has meaning for both activities and broadcast receivers: 
    It provides information about how able an activity is to respond to an intent that matches the filter, relative to other activities that could also respond to the intent. When an intent could be handled by multiple activities with different priorities, Android will consider only those with higher priority values as potential targets for the intent. 
    It controls the order in which broadcast receivers are executed to receive broadcast messages. Those with higher priority values are called before those with lower values. (The order applies only to synchronous messages; it's ignored for asynchronous messages.) 
    Use this attribute only if you really need to impose a specific order in which the broadcasts are received, or want to force Android to prefer one activity over others. 
     
    The value must be an integer, such as "100". Higher numbers have a higher priority. The default value is 0. The value must be greater than -1000 and less than 1000. 
     
    Also see setPriority(). 


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326072918&siteId=291194637