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

Commit f72ad8d0 authored by Jorim Jaggi's avatar Jorim Jaggi Committed by Android (Google) Code Review
Browse files

Merge "Fix tests"

parents 38c8934b fae3e276
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
@@ -231,15 +231,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
@@ -101,6 +101,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);