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

Commit 87edbcd0 authored by Peter_Liang's avatar Peter_Liang
Browse files

Fix the crash on animating the accessibility floating menu.

Root cause:
The menu had been animating and moving to the screen edge and hiding the menu in the meantime.

Solution:
Should cancel the animation before hiding the menu.

Bug: 237217858
Test: atest AccessibilityFloatingMenuViewTest
Change-Id: I75f75de3299210ed9d88b3be7dbaa81abb7db2e1
parent d50a2b4e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -353,6 +353,7 @@ public class AccessibilityFloatingMenuView extends FrameLayout
        }

        mIsShowing = false;
        mDragAnimator.cancel();
        mWindowManager.removeView(this);

        setOnApplyWindowInsetsListener(null);
+10 −0
Original line number Diff line number Diff line
@@ -190,6 +190,16 @@ public class AccessibilityFloatingMenuViewTest extends SysuiTestCase {
        verify(mWindowManager, times(1)).removeView(eq(mMenuView));
    }

    @Test
    public void hideMenuViewWhenStartingAnimation_animatorNotRunning() {
        mMenuView.show();

        mMenuView.mDragAnimator.start();
        mMenuView.hide();

        assertThat(mMenuView.mDragAnimator.isRunning()).isFalse();
    }

    @Test
    public void onTargetsChanged_singleTarget_expectedRadii() {
        final Position alignRightPosition = new Position(1.0f, 0.0f);