From 0606773905ca2541a62e44acf216d94fb47f55ba Mon Sep 17 00:00:00 2001 From: Tony Wickham Date: Fri, 10 Dec 2021 18:20:13 +0000 Subject: [PATCH] Fix taskbar being empty We set mIconAlignmentForResumedState in endGestureStateOverride(), but then we call applyState() which might aniamte mIAFRS to a different value. To avoid this, set it after applyState() instead. Specific repro: 1. Open Calculator 2. Go to Overview 3. Dismiss Calculator 3a. This calls endGestureStateOverride() because the running tile ends 3b. Previously, we called mIAFRS.updateValue(1) but then applyState() animated it to 0 because we're still in Overview which is an unstashed state. Now the animation to 0 is before setting explicitly to 1. 4. Go home (this sets mIconAlignmentForLauncherState = 1) 5. Open Calculator again. Previously, mIAFRS was already 0 so animating to 0 was ignored. Now, mIAFRS starts at 1 (which is right since launcher is resumed). Test: see above Fixes: 210109500 Change-Id: I13f40908f8636291d63ef4b885ac9d08bbf4d393 --- .../launcher3/taskbar/TaskbarLauncherStateController.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java index 593bfd8038..e2ba459068 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java @@ -375,12 +375,12 @@ import java.util.function.Supplier; // Update the resumed state immediately to ensure a seamless handoff boolean launcherResumed = !finishedToApp; - mIconAlignmentForResumedState.updateValue(launcherResumed ? 1 : 0); - updateStateForFlag(FLAG_RECENTS_ANIMATION_RUNNING, false); updateStateForFlag(FLAG_RESUMED, launcherResumed); applyState(); - + // Set this last because applyState() might also animate it. + mIconAlignmentForResumedState.cancelAnimation(); + mIconAlignmentForResumedState.updateValue(launcherResumed ? 1 : 0); TaskbarStashController controller = mControllers.taskbarStashController; controller.updateStateForFlag(FLAG_IN_APP, finishedToApp);