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

Commit 1e5db636 authored by Rob Carr's avatar Rob Carr Committed by Android (Google) Code Review
Browse files

Merge changes from topic "presubmit-am-402aa9e0c5db4b77854cdb590a812293"

* changes:
  [automerge] ViewRootImpl: Ensure seqId only increases 2p: 25bdf74a 2p: 1be469ea
  [automerge] ViewRootImpl: Ensure seqId only increases 2p: 25bdf74a
  ViewRootImpl: Ensure seqId only increases
parents 0399a6b2 484082db
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -1744,7 +1744,7 @@ public final class ViewRootImpl implements ViewParent,

        mForceNextWindowRelayout = forceNextWindowRelayout;
        mPendingAlwaysConsumeSystemBars = args.argi2 != 0;
        mSyncSeqId = args.argi4;
        mSyncSeqId = args.argi4 > mSyncSeqId ? args.argi4 : mSyncSeqId;

        if (msg == MSG_RESIZED_REPORT) {
            reportNextDraw();
@@ -7988,7 +7988,10 @@ public final class ViewRootImpl implements ViewParent,
                    insetsPending ? WindowManagerGlobal.RELAYOUT_INSETS_PENDING : 0,
                    mTmpFrames, mPendingMergedConfiguration, mSurfaceControl, mTempInsets,
                    mTempControls, mRelayoutBundle);
            mSyncSeqId = mRelayoutBundle.getInt("seqid");
            final int maybeSyncSeqId = mRelayoutBundle.getInt("seqid");
            if (maybeSyncSeqId > 0) {
                mSyncSeqId = maybeSyncSeqId;
            }

            if (mTranslator != null) {
                mTranslator.translateRectInScreenToAppWindow(mTmpFrames.frame);
+10 −3
Original line number Diff line number Diff line
@@ -6125,14 +6125,21 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
            applyHere = true;
        }

        for (int i = mDrawHandlers.size() - 1; i >= 0; i--) {
            DrawHandler h = mDrawHandlers.get(i);
        final List<DrawHandler> handlersToRemove = new ArrayList<>();
        // Iterate forwards to ensure we process in the same order
        // we added.
        for (int i = 0; i < mDrawHandlers.size(); i++) {
            final DrawHandler h = mDrawHandlers.get(i);
            if (h.mSeqId <= seqId) {
                h.mConsumer.accept(t);
                mDrawHandlers.remove(h);
                handlersToRemove.add(h);
                hadHandlers = true;
            }
        }
        for (int i = 0; i < handlersToRemove.size(); i++) {
            final DrawHandler h = handlersToRemove.get(i);
            mDrawHandlers.remove(h);
        }

        if (hadHandlers) {
            mWmService.mH.removeMessages(WINDOW_STATE_BLAST_SYNC_TIMEOUT, this);