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

Commit e53fb866 authored by Chavi Weingarten's avatar Chavi Weingarten Committed by Automerger Merge Worker
Browse files

Merge "Force reportResized when useBlastSync enabled" into rvc-dev am: d91929d9 am: 7ca41f9c

Change-Id: I6897ad996f0ede0c1d8aea03adf0109c63cd8ea4
parents 060f5e19 7ca41f9c
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -334,6 +334,8 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
    private boolean mDragResizing;
    private boolean mDragResizingChangeReported = true;
    private int mResizeMode;
    private boolean mResizeForBlastSyncReported;

    /**
     * Special mode that is intended only for the rounded corner overlay: during rotation
     * transition, we un-rotate the window token such that the window appears as it did before the
@@ -1370,11 +1372,14 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        // variables, because mFrameSizeChanged only tracks the width and height changing.
        updateLastFrames();

        // Add a window that is using blastSync to the resizing list if it hasn't been reported
        // already. This because the window is waiting on a finishDrawing from the client.
        if (didFrameInsetsChange
                || winAnimator.mSurfaceResized
                || configChanged
                || dragResizingChanged
                || mReportOrientationChanged) {
                || mReportOrientationChanged
                || requestResizeForBlastSync()) {
            ProtoLog.v(WM_DEBUG_RESIZE,
                        "Resize reasons for w=%s:  %s surfaceResized=%b configChanged=%b "
                                + "dragResizingChanged=%b reportOrientationChanged=%b",
@@ -3483,6 +3488,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        mReportOrientationChanged = false;
        mDragResizingChangeReported = true;
        mWinAnimator.mSurfaceResized = false;
        mResizeForBlastSyncReported = true;
        mWindowFrames.resetInsetsChanged();

        final Rect frame = mWindowFrames.mCompatFrame;
@@ -5733,6 +5739,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        if (!willSync) {
            return false;
        }
        mResizeForBlastSyncReported = false;

        mLocalSyncId = mBLASTSyncEngine.startSyncSet(this);
        addChildrenToSyncSet(mLocalSyncId);
@@ -5777,4 +5784,8 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        mWaitingListener = null;
        return mWinAnimator.finishDrawingLocked(null);
    }

    private boolean requestResizeForBlastSync() {
        return useBLASTSync() && !mResizeForBlastSyncReported;
    }
}
+23 −0
Original line number Diff line number Diff line
@@ -602,6 +602,29 @@ public class WindowStateTests extends WindowTestsBase {
        assertFalse(win.getOrientationChanging());
    }

    @Test
    public void testRequestResizeForBlastSync() {
        final WindowState win = mChildAppWindowAbove;
        makeWindowVisible(win, win.getParentWindow());
        win.mLayoutSeq = win.getDisplayContent().mLayoutSeq;
        win.reportResized();
        win.updateResizingWindowIfNeeded();
        assertThat(mWm.mResizingWindows).doesNotContain(win);

        // Check that the window is in resizing if using blast sync.
        win.reportResized();
        win.prepareForSync(mock(BLASTSyncEngine.TransactionReadyListener.class), 1);
        win.updateResizingWindowIfNeeded();
        assertThat(mWm.mResizingWindows).contains(win);

        // Don't re-add the window again if it's been reported to the client and still waiting on
        // the client draw for blast sync.
        win.reportResized();
        mWm.mResizingWindows.remove(win);
        win.updateResizingWindowIfNeeded();
        assertThat(mWm.mResizingWindows).doesNotContain(win);
    }

    @Test
    public void testGetTransformationMatrix() {
        final int PARENT_WINDOW_OFFSET = 1;