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

Commit 59f7c179 authored by Sudheer Shanka's avatar Sudheer Shanka Committed by Android (Google) Code Review
Browse files

Merge "Log a wtf if mRunningColdStart is not cleared before it is demoted." into main

parents c986d323 781af5eb
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -810,7 +810,7 @@ class BroadcastProcessQueue {
     * Return the broadcast being actively dispatched in this process.
     */
    public @NonNull BroadcastRecord getActive() {
        return Objects.requireNonNull(mActive);
        return Objects.requireNonNull(mActive, toString());
    }

    /**
@@ -818,7 +818,7 @@ class BroadcastProcessQueue {
     * being actively dispatched in this process.
     */
    public int getActiveIndex() {
        Objects.requireNonNull(mActive);
        Objects.requireNonNull(mActive, toString());
        return mActiveIndex;
    }

+11 −7
Original line number Diff line number Diff line
@@ -606,8 +606,9 @@ class BroadcastQueueImpl extends BroadcastQueue {
        } else {
            mRunningColdStart.reEnqueueActiveBroadcast();
        }
        demoteFromRunningLocked(mRunningColdStart);
        final BroadcastProcessQueue queue = mRunningColdStart;
        clearRunningColdStart();
        demoteFromRunningLocked(queue);
        enqueueUpdateRunningList();
    }

@@ -1527,6 +1528,15 @@ class BroadcastQueueImpl extends BroadcastQueue {

        final int cookie = traceBegin("demoteFromRunning");
        // We've drained running broadcasts; maybe move back to runnable
        if (mRunningColdStart == queue) {
            // TODO: b/399020479 - Remove wtf log once we identify the case where mRunningColdStart
            // is not getting cleared.
            // If this queue is mRunningColdStart, then it should have been cleared before
            // it is demoted. Log a wtf if this isn't the case.
            Slog.wtf(TAG, "mRunningColdStart has not been cleared; mRunningColdStart.app: "
                    + mRunningColdStart.app + " , queue.app: " + queue.app,
                            new IllegalStateException());
        }
        queue.makeActiveIdle();
        queue.traceProcessEnd();

@@ -2330,12 +2340,6 @@ class BroadcastQueueImpl extends BroadcastQueue {
        return null;
    }

    @VisibleForTesting
    @GuardedBy("mService")
    @Nullable BroadcastProcessQueue removeProcessQueue(@NonNull ProcessRecord app) {
        return removeProcessQueue(app.processName, app.info.uid);
    }

    @VisibleForTesting
    @GuardedBy("mService")
    @Nullable BroadcastProcessQueue removeProcessQueue(@NonNull String processName,