From 1668aeca49b2a787322cd051b6fa242e4ee74414 Mon Sep 17 00:00:00 2001 From: Ats Jenk Date: Mon, 23 Jan 2023 16:59:54 -0800 Subject: [PATCH] Fix flicker when opening transient taskbar When transient taskbar is opened, launcher state updates to background and then quickswitch. Quickswitch launches the last task which is the DesktopTaskView when desktop tasks are visible. DesktopTaskView launchTasks is called which ensures that desktop tasks are visible on top again and launcher state updates to normal. If launcher state moves to normal with animation, the task views for any visible desktop task flicker on screen. To remove this flicker, stop animating state transitions when moving from DesktopTaskView back to home screen. This can be readdressed when implement a proper recents animation. Bug: 263264985 Test: enable transient taskbar, put some tasks on desktop, swipe up to show transient taskbar, observe no flicker Test: have some tasks on desktop, swipe up to overview, click on desktop tile, observe they are brought to front Change-Id: I6ee5c55d9b805d6ef6d58ea137e697ccd40cda29 --- .../src/com/android/quickstep/views/DesktopTaskView.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/quickstep/src/com/android/quickstep/views/DesktopTaskView.java b/quickstep/src/com/android/quickstep/views/DesktopTaskView.java index 858f6abbc1..44aa41a655 100644 --- a/quickstep/src/com/android/quickstep/views/DesktopTaskView.java +++ b/quickstep/src/com/android/quickstep/views/DesktopTaskView.java @@ -18,6 +18,7 @@ package com.android.quickstep.views; import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT; +import static com.android.launcher3.LauncherState.NORMAL; import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_UNDEFINED; import android.content.Context; @@ -35,6 +36,7 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.android.launcher3.DeviceProfile; +import com.android.launcher3.Launcher; import com.android.launcher3.Utilities; import com.android.launcher3.touch.PagedOrientationHandler; import com.android.launcher3.util.RunnableList; @@ -295,7 +297,7 @@ public class DesktopTaskView extends TaskView { @Override public RunnableList launchTasks() { SystemUiProxy.INSTANCE.get(getContext()).showDesktopApps(); - getRecentsView().startHome(); + Launcher.getLauncher(mActivity).getStateManager().goToState(NORMAL, false /* animated */); return null; }