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

Commit a08548e0 authored by Tracy Zhou's avatar Tracy Zhou
Browse files

Skip stash animation when destroying LauncherTaskbarUIController

Follow up to ag/28978773
It seems like mControllers == null doesn't work when folding. The launcher visibility change still triggers the stash animation from onLauncherVisibilityChanged
by LauncherTaskbarUIController#onDestroy

Bug: 362713428
Test: manually make sure that the stash animation isn't triggered from folding
Flag: EXEMPT bugfix
Change-Id: I04539e7a31d6c329eacb54946e3b3c211e47a709
parent 5b569e76
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -127,7 +127,7 @@ public class LauncherTaskbarUIController extends TaskbarUIController {

    @Override
    protected void onDestroy() {
        onLauncherVisibilityChanged(false);
        onLauncherVisibilityChanged(false /* isVisible */, true /* fromInitOrDestroy */);
        super.onDestroy();
        mTaskbarLauncherStateController.onDestroy();

@@ -217,10 +217,10 @@ public class LauncherTaskbarUIController extends TaskbarUIController {
        onLauncherVisibilityChanged(isVisible, false /* fromInit */);
    }

    private void onLauncherVisibilityChanged(boolean isVisible, boolean fromInit) {
    private void onLauncherVisibilityChanged(boolean isVisible, boolean fromInitOrDestroy) {
        onLauncherVisibilityChanged(
                isVisible,
                fromInit,
                fromInitOrDestroy,
                /* startAnimation= */ true,
                DisplayController.isTransientTaskbar(mLauncher)
                        ? TRANSIENT_TASKBAR_TRANSITION_DURATION
@@ -231,7 +231,7 @@ public class LauncherTaskbarUIController extends TaskbarUIController {

    @Nullable
    private Animator onLauncherVisibilityChanged(
            boolean isVisible, boolean fromInit, boolean startAnimation, int duration) {
            boolean isVisible, boolean fromInitOrDestroy, boolean startAnimation, int duration) {
        // Launcher is resumed during the swipe-to-overview gesture under shell-transitions, so
        // avoid updating taskbar state in that situation (when it's non-interactive -- or
        // "background") to avoid premature animations.
@@ -249,7 +249,7 @@ public class LauncherTaskbarUIController extends TaskbarUIController {
        }

        mTaskbarLauncherStateController.updateStateForFlag(FLAG_VISIBLE, isVisible);
        if (fromInit || mControllers == null) {
        if (fromInitOrDestroy) {
            duration = 0;
        }
        return mTaskbarLauncherStateController.applyState(duration, startAnimation);