Move taskbar clean up so that it only gets called when user swipes up to go home.

This fixes the bug where the flag gets set when user taps on nav handle, which
results in the taskbar animation playing.

Flag: N/A
Test: open app
      wait for taskbar to finish stashing*
      tap on nav handle
      nothing happens (desired affect)
      * I will address tapping on taskbar while its animating in a separate change
Bug: 292108880
Change-Id: I75870050225bdd951c69224d272d0bd5a3d6d4ea
This commit is contained in:
Jon Miranda
2023-12-12 16:48:01 -08:00
committed by Jon @
parent 4266fa49e2
commit 20fdc7b508
6 changed files with 59 additions and 8 deletions
@@ -205,13 +205,6 @@ public class TaskbarLauncherStateController {
public void onStateTransitionComplete(LauncherState finalState) {
mLauncherState = finalState;
updateStateForFlag(FLAG_LAUNCHER_IN_STATE_TRANSITION, false);
// TODO(b/279514548) Cleans up bad state that can occur when user interacts with
// taskbar on top of transparent activity.
if (!FeatureFlags.enableHomeTransitionListener()
&& finalState == LauncherState.NORMAL
&& mLauncher.hasBeenResumed()) {
updateStateForFlag(FLAG_VISIBLE, true);
}
applyState();
boolean disallowLongClick =
FeatureFlags.enableSplitContextually()
@@ -223,6 +216,21 @@ public class TaskbarLauncherStateController {
}
};
/**
* Callback for when launcher state transition completes after user swipes to home.
* @param finalState The final state of the transition.
*/
public void onStateTransitionCompletedAfterSwipeToHome(LauncherState finalState) {
// TODO(b/279514548) Cleans up bad state that can occur when user interacts with
// taskbar on top of transparent activity.
if (!FeatureFlags.enableHomeTransitionListener()
&& (finalState == LauncherState.NORMAL)
&& mLauncher.hasBeenResumed()) {
updateStateForFlag(FLAG_VISIBLE, true);
applyState();
}
}
/** Initializes the controller instance, and applies the initial state immediately. */
public void init(TaskbarControllers controllers, QuickstepLauncher launcher,
int sysuiStateFlags) {