End any running taskbar animation in cleanup()

Test: Open an app, swipe to home and remove taskbar during animation,
ensure no crash
Fixes: 182163822

Change-Id: Ie92b4fdf03a23c8a205d1d7327a304cf1d996383
This commit is contained in:
Tony Wickham
2021-03-08 10:14:10 -08:00
parent 1f4a3414f1
commit 51b2453e30

View File

@@ -85,6 +85,7 @@ public class TaskbarController {
// Contains all loaded Hotseat items.
private ItemInfo[] mLatestLoadedHotseatItems;
private @Nullable Animator mAnimator;
private boolean mIsAnimatingToLauncher;
public TaskbarController(BaseQuickstepLauncher launcher,
@@ -245,6 +246,10 @@ public class TaskbarController {
mTaskbarVisibilityController.cleanup();
mHotseatController.cleanup();
mRecentsController.cleanup();
if (mAnimator != null) {
mAnimator.end();
}
}
private void removeFromWindowManager() {
@@ -287,13 +292,21 @@ public class TaskbarController {
*/
public void onLauncherResumedOrPaused(boolean isResumed) {
long duration = QuickstepAppTransitionManagerImpl.CONTENT_ALPHA_DURATION;
final Animator anim;
if (isResumed) {
anim = createAnimToLauncher(null, duration);
} else {
anim = createAnimToApp(duration);
if (mAnimator != null) {
mAnimator.cancel();
}
anim.start();
if (isResumed) {
mAnimator = createAnimToLauncher(null, duration);
} else {
mAnimator = createAnimToApp(duration);
}
mAnimator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
mAnimator = null;
}
});
mAnimator.start();
}
/**