Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6da3c3bc authored by Sudheer Shanka's avatar Sudheer Shanka
Browse files

Ignore demoteFromRunning requests if the process queue is not active.

Bug: 281662943
Test: atest services/tests/mockingservicestests/src/com/android/server/am/BroadcastQueueTest.java
Test: atest services/tests/mockingservicestests/src/com/android/server/am/BroadcastQueueModernImplTest.java
Change-Id: Id2e223a3e523142fbb9bc23a533ba3e0fa8d4982
parent 80566f8e
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1151,6 +1151,11 @@ class BroadcastQueueModernImpl extends BroadcastQueue {
     */
    @GuardedBy("mService")
    private void demoteFromRunningLocked(@NonNull BroadcastProcessQueue queue) {
        if (!queue.isActive()) {
            logw("Ignoring demoteFromRunning; no active broadcast for " + queue);
            return;
        }

        final int cookie = traceBegin("demoteFromRunning");
        // We've drained running broadcasts; maybe move back to runnable
        queue.makeActiveIdle();