Add a missing NULL check for postActivityStartTokenRemoval()

* filter.receiverList.app can actually be null here. Don't pass
   a null ProcessRecord to postActivityStartTokenRemoval().

Change-Id: I923f424fcb05b3956bf14728e9d0c0e48666294d
This commit is contained in:
Wang Han
2021-02-18 05:04:55 +00:00
parent 4ea84f0b97
commit aaad5deb32

View File

@@ -809,7 +809,8 @@ public final class BroadcastQueue {
r.resultExtras, r.ordered, r.initialSticky, r.userId);
// parallel broadcasts are fire-and-forget, not bookended by a call to
// finishReceiverLocked(), so we manage their activity-start token here
if (r.allowBackgroundActivityStarts && !r.ordered) {
if (filter.receiverList.app != null
&& r.allowBackgroundActivityStarts && !r.ordered) {
postActivityStartTokenRemoval(filter.receiverList.app, r);
}
}