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

Commit 605bc568 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Android (Google) Code Review
Browse files

Merge changes from topic "oct26b"

* changes:
  Enable "modern" BroadcastQueue by default; take three.
  Subtle fix when queue becomes unrunnable.
parents e7b79aec cd334a08
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -133,7 +133,7 @@ public class BroadcastConstants {
     */
    public boolean MODERN_QUEUE_ENABLED = DEFAULT_MODERN_QUEUE_ENABLED;
    private static final String KEY_MODERN_QUEUE_ENABLED = "modern_queue_enabled";
    private static final boolean DEFAULT_MODERN_QUEUE_ENABLED = false;
    private static final boolean DEFAULT_MODERN_QUEUE_ENABLED = true;

    /**
     * For {@link BroadcastQueueModernImpl}: Maximum number of process queues to
+5 −1
Original line number Diff line number Diff line
@@ -831,7 +831,7 @@ class BroadcastProcessQueue {

    @NeverCompile
    public void dumpLocked(@UptimeMillisLong long now, @NonNull IndentingPrintWriter pw) {
        if ((mActive == null) && mPending.isEmpty()) return;
        if ((mActive == null) && isEmpty()) return;

        pw.print(toShortString());
        if (isRunnable()) {
@@ -847,6 +847,10 @@ class BroadcastProcessQueue {
        if (mActive != null) {
            dumpRecord(now, pw, mActive, mActiveIndex, mActiveBlockedUntilTerminalCount);
        }
        for (SomeArgs args : mPendingUrgent) {
            final BroadcastRecord r = (BroadcastRecord) args.arg1;
            dumpRecord(now, pw, r, args.argi1, args.argi2);
        }
        for (SomeArgs args : mPending) {
            final BroadcastRecord r = (BroadcastRecord) args.arg1;
            dumpRecord(now, pw, r, args.argi1, args.argi2);
+7 −0
Original line number Diff line number Diff line
@@ -365,6 +365,13 @@ class BroadcastQueueModernImpl extends BroadcastQueue {
            BroadcastProcessQueue nextQueue = queue.runnableAtNext;
            final long runnableAt = queue.getRunnableAt();

            // When broadcasts are skipped or failed during list traversal, we
            // might encounter a queue that is no longer runnable; skip it
            if (!queue.isRunnable()) {
                queue = nextQueue;
                continue;
            }

            // If queues beyond this point aren't ready to run yet, schedule
            // another pass when they'll be runnable
            if (runnableAt > now && !waitingFor) {