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

Commit 235728ef authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Remove getState from InsetsAnimationControlCallbacks

No longer needed since we either show or hide all the types when
finishing an animation.

Test: WindowInsetsActivity
Bug: 118118435
Change-Id: I2323403d375cdf781b34b4d2107d3151299eb995
parent 069dc427
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -51,12 +51,6 @@ public interface InsetsAnimationControlCallbacks {
     */
    void notifyFinished(InsetsAnimationControlImpl controller, boolean shown);

    /**
     * Get the description of the insets state.
     * @return {@link InsetsState} for adjusting corresponding {@link InsetsSource}.
     */
    InsetsState getState();

    /**
     * Apply the new params to the surface.
     * @param params The {@link android.view.SyncRtSurfaceTransactionApplier.SurfaceParams} to
+1 −7
Original line number Diff line number Diff line
@@ -191,13 +191,7 @@ public class InsetsAnimationControlImpl implements WindowInsetsAnimationControll
        if (mCancelled) {
            return;
        }
        InsetsState state = new InsetsState(mController.getState());
        for (int i = mControls.size() - 1; i >= 0; i--) {
            InsetsSourceControl control = mControls.valueAt(i);
            state.getSource(control.getType()).setVisible(shown);
        }
        Insets insets = getInsetsFromState(state, mFrame, null /* typeSideMap */);
        setInsetsAndAlpha(insets, 1f /* alpha */, 1f /* fraction */);
        setInsetsAndAlpha(shown ? mShownInsets : mHiddenInsets, 1f /* alpha */, 1f /* fraction */);
        mFinished = true;
        mShownOnFinish = shown;
    }
+0 −2
Original line number Diff line number Diff line
@@ -176,8 +176,6 @@ public class InsetsAnimationControlImplTest {
        when(mMockController.getState()).thenReturn(mInsetsState);
        mController.finish(true /* shown */);
        mController.applyChangeInsets(mInsetsState);
        assertTrue(mInsetsState.getSource(ITYPE_STATUS_BAR).isVisible());
        assertTrue(mInsetsState.getSource(ITYPE_NAVIGATION_BAR).isVisible());
        assertEquals(Insets.of(0, 100, 100, 0), mController.getCurrentInsets());
        verify(mMockController).notifyFinished(eq(mController), eq(true /* shown */));
    }