Fix invoking transient taskbar in desktop windowing prototypes

When transient taskbar is invoked, it starts the recents animation.
Recents animation triggers the launch of launcher activity. We need to
ensure that after recents animation is cancelled (since the gesture was
only for taskbar), we bring the desktop tasks back to front.

When the transient taskbar gesture finishes, we need to ensure that
launcher state is restored to normal. With fullscreen tasks, launcher
activity in stopped after gesture finishes as a fullscreen task is on
top. This stop triggers the launcher state to return to normal.
When freeform tasks are visible on top of launcher, launcher activity is
not stopped. This means we have to manually move launcher to normal
state after transient taskbar gesture finishes.

Bug: 267364407
Test: enable proto 1, switch to desktop mode and open some tasks, swipe
  up for transient taskbar, swipe up to recents view
Test: enable proto 2, move a task to desktop, swipe up for transient
  taskbar, swipe up to recents view
Change-Id: I712bc5086407c26779638d824f34674f7db1ff51
This commit is contained in:
Ats Jenk
2023-02-08 15:16:43 -08:00
parent f4fa65db39
commit d9f6d4e31c
6 changed files with 72 additions and 3 deletions
@@ -41,8 +41,10 @@ import com.android.launcher3.uioverrides.QuickstepLauncher;
import com.android.launcher3.util.PendingSplitSelectInfo;
import com.android.launcher3.util.SplitConfigurationOptions;
import com.android.launcher3.util.SplitConfigurationOptions.SplitSelectSource;
import com.android.quickstep.GestureState;
import com.android.quickstep.LauncherActivityInterface;
import com.android.quickstep.RotationTouchHelper;
import com.android.quickstep.SystemUiProxy;
import com.android.quickstep.util.SplitSelectStateController;
import com.android.systemui.shared.recents.model.Task;
@@ -222,11 +224,23 @@ public class LauncherRecentsView extends RecentsView<QuickstepLauncher, Launcher
@Override
public void onGestureAnimationEnd() {
DesktopVisibilityController desktopVisibilityController = null;
boolean showDesktopApps = false;
if (DesktopTaskView.DESKTOP_MODE_SUPPORTED) {
desktopVisibilityController = mActivity.getDesktopVisibilityController();
if (mCurrentGestureEndTarget == GestureState.GestureEndTarget.LAST_TASK
&& desktopVisibilityController.areFreeformTasksVisible()) {
// Recents gesture was cancelled and we are returning to the previous task.
// After super class has handled clean up, show desktop apps on top again
showDesktopApps = true;
}
}
super.onGestureAnimationEnd();
DesktopVisibilityController desktopVisibilityController =
mActivity.getDesktopVisibilityController();
if (desktopVisibilityController != null) {
desktopVisibilityController.setGestureInProgress(false);
}
if (showDesktopApps) {
SystemUiProxy.INSTANCE.get(mActivity).showDesktopApps();
}
}
}