Null check on BroadcastRecord's receivers list.
Bug: 227729678 Test: adb shell "am broadcast -a android.intent.action.BOOT_COMPLETED -n com.android.providers.media/.MediaScannerReceiver" Change-Id: If3c74a11ba76fa025a8dff0a7fc807e4bfa86119
This commit is contained in:
@@ -580,6 +580,11 @@ public class BroadcastDispatcher {
|
|||||||
// ----------------------------------
|
// ----------------------------------
|
||||||
// BroadcastQueue operation support
|
// BroadcastQueue operation support
|
||||||
void enqueueOrderedBroadcastLocked(BroadcastRecord r) {
|
void enqueueOrderedBroadcastLocked(BroadcastRecord r) {
|
||||||
|
if (r.receivers == null || r.receivers.isEmpty()) {
|
||||||
|
mOrderedBroadcasts.add(r);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (Intent.ACTION_LOCKED_BOOT_COMPLETED.equals(r.intent.getAction())) {
|
if (Intent.ACTION_LOCKED_BOOT_COMPLETED.equals(r.intent.getAction())) {
|
||||||
// Create one BroadcastRecord for each UID that can be deferred.
|
// Create one BroadcastRecord for each UID that can be deferred.
|
||||||
final SparseArray<BroadcastRecord> deferred =
|
final SparseArray<BroadcastRecord> deferred =
|
||||||
|
|||||||
@@ -414,6 +414,10 @@ final class BroadcastRecord extends Binder {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (receivers == null) {
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
final String action = intent.getAction();
|
final String action = intent.getAction();
|
||||||
if (!Intent.ACTION_LOCKED_BOOT_COMPLETED.equals(action)
|
if (!Intent.ACTION_LOCKED_BOOT_COMPLETED.equals(action)
|
||||||
&& !Intent.ACTION_BOOT_COMPLETED.equals(action)) {
|
&& !Intent.ACTION_BOOT_COMPLETED.equals(action)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user