Merge "Null check on BroadcastRecord's receivers list." into tm-dev

This commit is contained in:
Hui Yu
2022-04-07 16:34:16 +00:00
committed by Android (Google) Code Review
2 changed files with 9 additions and 0 deletions

View File

@@ -580,6 +580,11 @@ public class BroadcastDispatcher {
// ----------------------------------
// BroadcastQueue operation support
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())) {
// Create one BroadcastRecord for each UID that can be deferred.
final SparseArray<BroadcastRecord> deferred =

View File

@@ -414,6 +414,10 @@ final class BroadcastRecord extends Binder {
return ret;
}
if (receivers == null) {
return ret;
}
final String action = intent.getAction();
if (!Intent.ACTION_LOCKED_BOOT_COMPLETED.equals(action)
&& !Intent.ACTION_BOOT_COMPLETED.equals(action)) {