Fix how task stack listener closes overlays on task changes.

Originally gated onTaskMovedToFront behind prototype because looked like
it was causing overlay to close when it shouldn't. However, it turns out
it was actually onTaskStackChanged that was doing this.

Additionally, changing onTaskMovedToFront to close with animation, because this will fire if swiping up from all apps (going to overview so Launcher is considered as the task moving to front). Also, registered onTaskCreated to be a bit more thorough.

Test: Manual (EDU, All Apps, and EDU + All Apps)
Fix: 283373523
Flag: none
Change-Id: I4cd3969f91a93bab190b764a656d9cfc03d1ce09
(cherry picked from commit 34c6b871af)
This commit is contained in:
Brian Isganitis
2023-05-26 21:04:19 +00:00
parent 55f38fb397
commit 0aa30e2292

View File

@@ -23,6 +23,7 @@ import static com.android.launcher3.AbstractFloatingView.TYPE_REBIND_SAFE;
import static com.android.launcher3.LauncherState.ALL_APPS;
import android.annotation.SuppressLint;
import android.content.ComponentName;
import android.content.Context;
import android.graphics.PixelFormat;
import android.view.Gravity;
@@ -36,7 +37,6 @@ import com.android.launcher3.AbstractFloatingView;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.taskbar.TaskbarActivityContext;
import com.android.launcher3.taskbar.TaskbarControllers;
import com.android.quickstep.views.DesktopTaskView;
import com.android.systemui.shared.system.TaskStackChangeListener;
import com.android.systemui.shared.system.TaskStackChangeListeners;
@@ -60,15 +60,15 @@ public final class TaskbarOverlayController {
private final TaskStackChangeListener mTaskStackListener = new TaskStackChangeListener() {
@Override
public void onTaskStackChanged() {
mProxyView.close(false);
public void onTaskCreated(int taskId, ComponentName componentName) {
// Created task will be below existing overlay, so move out of the way.
hideWindow();
}
@Override
public void onTaskMovedToFront(int taskId) {
if (DesktopTaskView.DESKTOP_MODE_SUPPORTED) {
mProxyView.close(false);
}
// New front task will be below existing overlay, so move out of the way.
hideWindow();
}
};