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

Commit 8215d8be authored by Brian Isganitis's avatar Brian Isganitis
Browse files

Close overlay onTaskStackChanged when All Apps is visible.

We have too many cases where All Apps can relaunch the current task
behind it to the point where it will not be sustainable to manually
close AFVs in all of these cases.

Test: Manual
Fix: 299169192
Fix: 299169075
Fix: 299169073
Flag: No
Change-Id: If3d9aa756ff5e5d6fbaf5f91d2ccc0c5c11a5c23
parent e6747e4c
Loading
Loading
Loading
Loading
+16 −2
Original line number Diff line number Diff line
@@ -70,6 +70,18 @@ public final class TaskbarOverlayController {
            // New front task will be below existing overlay, so move out of the way.
            hideWindow();
        }

        @Override
        public void onTaskStackChanged() {
            // The other callbacks are insufficient for All Apps, because there are many cases where
            // it can relaunch the same task already behind it. However, this callback needs to be a
            // no-op when only EDU is shown, because going between the EDU steps invokes this
            // callback.
            if (mControllers.getSharedState() != null
                    && mControllers.getSharedState().allAppsVisible) {
                hideWindow();
            }
        }
    };

    private DeviceProfile mLauncherDeviceProfile;
@@ -199,9 +211,11 @@ public final class TaskbarOverlayController {

        @Override
        protected void handleClose(boolean animate) {
            if (mIsOpen) {
                mTaskbarContext.getDragLayer().removeView(this);
                Optional.ofNullable(mOverlayContext).ifPresent(c -> closeAllOpenViews(c, animate));
            }
        }

        @Override
        protected boolean isOfType(int type) {