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

Commit 749cadd1 authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Fix no-op RelayoutPerfTest

The test has lost its functionality since [1].
Because the relayout invocation will be skipped if the
sequence number is old.

[1]: Ifb365789fa08103773fd3180e486ba1d92042fc5

Bug: 206872204
Test: atest RelayoutPerfTest
Change-Id: Ic8eb77a13a27a6c92279794cd7ed1981e1b03560
parent 4490339b
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -128,6 +128,7 @@ public class RelayoutPerfTest extends WindowManagerPerfTestBase
        final MergedConfiguration mOutMergedConfiguration = new MergedConfiguration();
        final InsetsState mOutInsetsState = new InsetsState();
        final InsetsSourceControl.Array mOutControls = new InsetsSourceControl.Array();
        final Bundle mOutBundle = new Bundle();
        final IWindow mWindow;
        final View mView;
        final WindowManager.LayoutParams mParams;
@@ -136,7 +137,7 @@ public class RelayoutPerfTest extends WindowManagerPerfTestBase
        final SurfaceControl mOutSurfaceControl;

        final IntSupplier mViewVisibility;

        int mRelayoutSeq;
        int mFlags;

        RelayoutRunner(Activity activity, IWindow window, IntSupplier visibilitySupplier) {
@@ -152,10 +153,11 @@ public class RelayoutPerfTest extends WindowManagerPerfTestBase
        void runBenchmark(BenchmarkState state) throws RemoteException {
            final IWindowSession session = WindowManagerGlobal.getWindowSession();
            while (state.keepRunning()) {
                mRelayoutSeq++;
                session.relayout(mWindow, mParams, mWidth, mHeight,
                        mViewVisibility.getAsInt(), mFlags, 0 /* seq */, 0 /* lastSyncSeqId */,
                        mViewVisibility.getAsInt(), mFlags, mRelayoutSeq, 0 /* lastSyncSeqId */,
                        mOutFrames, mOutMergedConfiguration, mOutSurfaceControl, mOutInsetsState,
                        mOutControls, new Bundle());
                        mOutControls, mOutBundle);
            }
        }
    }