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

Commit 65ced1b1 authored by Andy Wickham's avatar Andy Wickham
Browse files

Dismisses system overlays for Home intent.

Test: Used Facebook chatheads (not system bubble).
Before the change, Home gesture didn't work. After
the change, it does work :)
Fixes: 146593239

Change-Id: Ib9c85de2f83f99d1ef53fb17fde5d0b3c514849a
parent 9099dfcf
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ import static com.android.launcher3.allapps.DiscoveryBounce.HOME_BOUNCE_SEEN;
import static com.android.launcher3.allapps.DiscoveryBounce.SHELF_BOUNCE_COUNT;
import static com.android.launcher3.allapps.DiscoveryBounce.SHELF_BOUNCE_SEEN;
import static com.android.quickstep.SysUINavigationMode.removeShelfFromOverview;
import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SYSTEM_WINDOWS_REASON_HOME_KEY;

import android.animation.AnimatorSet;
import android.animation.ValueAnimator;
@@ -229,6 +230,13 @@ public abstract class BaseQuickstepLauncher extends Launcher
        }
    }

    @Override
    protected void closeOpenViews(boolean animate) {
        super.closeOpenViews(animate);
        ActivityManagerWrapper.getInstance()
                .closeSystemWindows(CLOSE_SYSTEM_WINDOWS_REASON_HOME_KEY);
    }

    @Override
    protected StateHandler[] createStateHandlers() {
        return new StateHandler[] {
+11 −3
Original line number Diff line number Diff line
@@ -1466,7 +1466,7 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
        if (isActionMain) {
            if (!internalStateHandled) {
                // In all these cases, only animate if we're already on home
                AbstractFloatingView.closeAllOpenViews(this, isStarted());
                closeOpenViews(isStarted());

                if (!isInState(NORMAL)) {
                    // Only change state, if not already the same. This prevents cancelling any
@@ -2207,7 +2207,7 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
                mWorkspace.postDelayed(new Runnable() {
                    public void run() {
                        if (mWorkspace != null) {
                            AbstractFloatingView.closeAllOpenViews(Launcher.this, false);
                            closeOpenViews(false);

                            mWorkspace.snapToPage(newScreenIndex);
                            mWorkspace.postDelayed(startBounceAnimRunnable,
@@ -2695,7 +2695,7 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
            if (!mDragController.isDragging() && !mWorkspace.isSwitchingState() &&
                    isInState(NORMAL)) {
                // Close any open floating views.
                AbstractFloatingView.closeAllOpenViews(this);
                closeOpenViews();

                // Setting the touch point to (-1, -1) will show the options popup in the center of
                // the screen.
@@ -2735,6 +2735,14 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
        getStateManager().goToState(LauncherState.NORMAL);
    }

    private void closeOpenViews() {
        closeOpenViews(true);
    }

    protected void closeOpenViews(boolean animate) {
        AbstractFloatingView.closeAllOpenViews(this, animate);
    }

    public Stream<SystemShortcut.Factory> getSupportedShortcuts() {
        return Stream.of(APP_INFO, WIDGETS, INSTALL);
    }