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
Merged-In: I75f75de3299210ed9d88b3be7dbaa81abb7db2e1
Change-Id: I75f75de3299210ed9d88b3be7dbaa81abb7db2e1
(cherry picked from commit 87edbcd0bc)
This commit is contained in:
@@ -353,6 +353,7 @@ public class AccessibilityFloatingMenuView extends FrameLayout
|
||||
}
|
||||
|
||||
mIsShowing = false;
|
||||
mDragAnimator.cancel();
|
||||
mWindowManager.removeView(this);
|
||||
|
||||
setOnApplyWindowInsetsListener(null);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user