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

Commit 84fbec0b authored by Brian Isganitis's avatar Brian Isganitis
Browse files

Prevent meta shortcut from cancelling split select state.

There are two things that need to be changed for this to work:

1. Make the isInOverview condition check for any Overview UI (including
   the split select state, modal, etc.)
2. Toggle Home All Apps directly, because firing the intent will cause
   Launcher to pause and resume before the intent is handled. We
misinterpret the pause as a request to cancel split screen. Since
TaskbarManager has a reference to Launcher, we might as well call the
method directly.

Test: Manual
Fix: 319076403
Flag: N/A
Change-Id: Ib8899188f593a168a054a16717df4a95be098557
parent be2a18d3
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -425,14 +425,14 @@ public class LauncherTaskbarUIController extends TaskbarUIController {
    }

    @Override
    protected boolean isInOverview() {
        return mTaskbarLauncherStateController.isInOverview();
    protected boolean isInOverviewUi() {
        return mTaskbarLauncherStateController.isInOverviewUi();
    }

    @Override
    protected boolean canToggleHomeAllApps() {
        return mLauncher.isResumed()
                && !mTaskbarLauncherStateController.isInOverview()
                && !mTaskbarLauncherStateController.isInOverviewUi()
                && !mLauncher.areFreeformTasksVisible();
    }

+1 −1
Original line number Diff line number Diff line
@@ -665,7 +665,7 @@ public class TaskbarActivityContext extends BaseTaskbarContext {

        LauncherAtom.TaskBarContainer.Builder taskbarBuilder =
                LauncherAtom.TaskBarContainer.newBuilder();
        if (mControllers.uiController.isInOverview()) {
        if (mControllers.uiController.isInOverviewUi()) {
            taskbarBuilder.setTaskSwitcherContainer(
                    LauncherAtom.TaskSwitcherContainer.newBuilder());
        }
+1 −1
Original line number Diff line number Diff line
@@ -375,7 +375,7 @@ class TaskbarInsetsController(val context: TaskbarActivityContext) : LoggableTas
        ) {
            // Taskbar has some touchable elements, take over the full taskbar area
            if (
                controllers.uiController.isInOverview &&
                controllers.uiController.isInOverviewUi &&
                    DisplayController.isTransientTaskbar(context)
            ) {
                val region =
+2 −2
Original line number Diff line number Diff line
@@ -666,8 +666,8 @@ public class TaskbarLauncherStateController {
                && !mLauncher.getWorkspace().isOverlayShown();
    }

    boolean isInOverview() {
        return mLauncherState == LauncherState.OVERVIEW;
    boolean isInOverviewUi() {
        return mLauncherState.overviewUi;
    }

    private void playStateTransitionAnim(AnimatorSet animatorSet, long duration,
+5 −4
Original line number Diff line number Diff line
@@ -58,6 +58,7 @@ import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;

import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherAppState;
import com.android.launcher3.anim.AnimatorPlaybackController;
import com.android.launcher3.statemanager.StatefulActivity;
@@ -339,12 +340,12 @@ public class TaskbarManager {

    /**
     * Toggles All Apps for Taskbar or Launcher depending on the current state.
     *
     * @param homeAllAppsIntent Intent used if Taskbar is not enabled or Launcher is resumed.
     */
    public void toggleAllApps(Intent homeAllAppsIntent) {
    public void toggleAllApps() {
        if (mTaskbarActivityContext == null || mTaskbarActivityContext.canToggleHomeAllApps()) {
            mContext.startActivity(homeAllAppsIntent);
            // Home All Apps should be toggled from this class, because the controllers are not
            // initialized when Taskbar is disabled (i.e. TaskbarActivityContext is null).
            if (mActivity instanceof Launcher l) l.toggleAllAppsSearch();
        } else {
            mTaskbarActivityContext.toggleAllAppsSearch();
        }
Loading