Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 34c6b871 authored by Brian Isganitis's avatar Brian Isganitis
Browse files

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
parent 7bae2b82
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -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();
        }
    };