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

Commit 41e0e65b authored by Vinit Nayak's avatar Vinit Nayak Committed by Android (Google) Code Review
Browse files

Merge "Call setOverviewDragState() whenever taskbar is recreated" into 24D1-dev

parents c22b39a3 3b63408a
Loading
Loading
Loading
Loading
+18 −8
Original line number Diff line number Diff line
@@ -205,13 +205,7 @@ public class TaskbarLauncherStateController {
                    mLauncherState = finalState;
                    updateStateForFlag(FLAG_LAUNCHER_IN_STATE_TRANSITION, false);
                    applyState();
                    boolean disallowLongClick =
                            FeatureFlags.enableSplitContextually()
                                    ? mLauncher.isSplitSelectionActive()
                                    : finalState == LauncherState.OVERVIEW_SPLIT_SELECT;
                    com.android.launcher3.taskbar.Utilities.setOverviewDragState(
                            mControllers, finalState.disallowTaskbarGlobalDrag(),
                            disallowLongClick, finalState.allowTaskbarInitialSplitSelection());
                    updateOverviewDragState(finalState);
                }
            };

@@ -256,6 +250,7 @@ public class TaskbarLauncherStateController {

        mCanSyncViews = true;
        mLauncher.addOnDeviceProfileChangeListener(mOnDeviceProfileChangeListener);
        updateOverviewDragState(mLauncherState);
    }

    public void onDestroy() {
@@ -357,6 +352,21 @@ public class TaskbarLauncherStateController {
        }
    }

    /**
     * Updates overview drag state on various controllers based on {@link #mLauncherState}.
     *
     * @param launcherState The current state launcher is in
     */
    private void updateOverviewDragState(LauncherState launcherState) {
        boolean disallowLongClick =
                FeatureFlags.enableSplitContextually()
                        ? mLauncher.isSplitSelectionActive()
                        : launcherState == LauncherState.OVERVIEW_SPLIT_SELECT;
        com.android.launcher3.taskbar.Utilities.setOverviewDragState(
                mControllers, launcherState.disallowTaskbarGlobalDrag(),
                disallowLongClick, launcherState.allowTaskbarInitialSplitSelection());
    }

    /**
     * Updates the proper flag to change the state of the task bar.
     *