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

Commit fae3e276 authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Fix tests

Test: atest InsetsAnimationControlImplTest
Bug: 118118435
Change-Id: I92f5a91b24d3441c092c9dab55d9340b7da3ab14
parent 98c75651
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -122,7 +122,8 @@ public class InsetsAnimationControlImpl implements WindowInsetsAnimationControll
        mController.scheduleApplyChangeInsets();
    }

    void applyChangeInsets(InsetsState state) {
    @VisibleForTesting
    public void applyChangeInsets(InsetsState state) {
        final Insets offset = Insets.subtract(mShownInsets, mPendingInsets);
        ArrayList<SurfaceParams> params = new ArrayList<>();
        if (offset.left != 0) {
+6 −3
Original line number Diff line number Diff line
@@ -223,15 +223,18 @@ public class InsetsController implements WindowInsetsController {
        mState.dump(prefix + "  ", pw);
    }

    void dispatchAnimationStarted(WindowInsetsAnimationListener.InsetsAnimation animation) {
    @VisibleForTesting
    public void dispatchAnimationStarted(WindowInsetsAnimationListener.InsetsAnimation animation) {
        mViewRoot.mView.dispatchWindowInsetsAnimationStarted(animation);
    }

    void dispatchAnimationFinished(WindowInsetsAnimationListener.InsetsAnimation animation) {
    @VisibleForTesting
    public void dispatchAnimationFinished(WindowInsetsAnimationListener.InsetsAnimation animation) {
        mViewRoot.mView.dispatchWindowInsetsAnimationFinished(animation);
    }

    void scheduleApplyChangeInsets() {
    @VisibleForTesting
    public void scheduleApplyChangeInsets() {
        if (!mAnimCallbackScheduled) {
            mViewRoot.mChoreographer.postCallback(Choreographer.CALLBACK_INSETS_ANIMATION,
                    mAnimCallback, null /* token*/);
+1 −0
Original line number Diff line number Diff line
@@ -98,6 +98,7 @@ public class InsetsAnimationControlImplTest {
    @Test
    public void testChangeInsets() {
        mController.changeInsets(Insets.of(0, 30, 40, 0));
        mController.applyChangeInsets(new InsetsState());
        assertEquals(Insets.of(0, 30, 40, 0), mController.getCurrentInsets());

        ArgumentCaptor<SurfaceParams> captor = ArgumentCaptor.forClass(SurfaceParams.class);