-
前台广播和后台广播
Android的广播有前台广播和后台广播的区别,他们分别对应一个队列,前台广播对应的是前台队列,后台广播对应的是后台队列。这两个队列在Android源码中定义于/frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
/**
91 * Lists of all active broadcasts that are to be executed immediately
92 * (without waiting for another broadcast to finish). Currently this only
93 * contains broadcasts to registered receivers, to avoid spinning up
94 * a bunch of processes to execute IntentReceiver components. Background-
95 * and foreground-priority broadcasts are queued separately.
96 */
97 final ArrayList<BroadcastRecord> mParallelBroadcasts = new ArrayList<>();
98
99 /**
100 * List of all active broadcasts that are to be executed one at a time.
101 * The o