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

Commit a7ac7192 authored by Winson Chung's avatar Winson Chung
Browse files

Fix issue with quickswitch not updating system bar flags

- Separate the calls to minimize split and to update the flags (we only
  want to minimize in split when swiping up, but we want to update the
  flags when quickswitching as well)

Bug: 155410195
Change-Id: I56308cc0fbaa8a855383012738f129671d72feff
parent 0199fa46
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -215,7 +215,7 @@ public final class FallbackActivityInterface implements
    }

    @Override
    public boolean shouldMinimizeSplitScreen() {
    public boolean allowMinimizeSplitScreen() {
        // TODO: Remove this once b/77875376 is fixed
        return false;
    }
+5 −2
Original line number Diff line number Diff line
@@ -250,8 +250,11 @@ public class FallbackSwipeHandler extends BaseSwipeUpHandler<RecentsActivity, Fa
    public void updateFinalShift() {
        mTransformParams.setProgress(mCurrentShift.value);
        if (mRecentsAnimationController != null) {
            mRecentsAnimationController.setWindowThresholdCrossed(!mInQuickSwitchMode
                    && (mCurrentShift.value > 1 - UPDATE_SYSUI_FLAGS_THRESHOLD));
            boolean swipeUpThresholdPassed = mCurrentShift.value > 1 - UPDATE_SYSUI_FLAGS_THRESHOLD;
            mRecentsAnimationController.setUseLauncherSystemBarFlags(mInQuickSwitchMode
                    || swipeUpThresholdPassed);
            mRecentsAnimationController.setSplitScreenMinimized(!mInQuickSwitchMode
                    && swipeUpThresholdPassed);
        }

        if (!mInQuickSwitchMode && !mDeviceState.isFullyGesturalNavMode()) {
+1 −1
Original line number Diff line number Diff line
@@ -408,7 +408,7 @@ public final class LauncherActivityInterface implements BaseActivityInterface<La
    }

    @Override
    public boolean shouldMinimizeSplitScreen() {
    public boolean allowMinimizeSplitScreen() {
        return true;
    }

+11 −7
Original line number Diff line number Diff line
@@ -630,17 +630,21 @@ public class LauncherSwipeHandler<T extends BaseDraggingActivity>
     * @param windowProgress 0 == app, 1 == overview
     */
    private void updateSysUiFlags(float windowProgress) {
        if (mRecentsView != null) {
        if (mRecentsAnimationController != null && mRecentsView != null) {
            TaskView runningTask = mRecentsView.getRunningTaskView();
            TaskView centermostTask = mRecentsView.getTaskViewNearestToCenterOfScreen();
            int centermostTaskFlags = centermostTask == null ? 0
                    : centermostTask.getThumbnail().getSysUiStatusNavFlags();
            boolean useHomeScreenFlags = windowProgress > 1 - UPDATE_SYSUI_FLAGS_THRESHOLD;
            boolean swipeUpThresholdPassed = windowProgress > 1 - UPDATE_SYSUI_FLAGS_THRESHOLD;
            boolean quickswitchThresholdPassed = centermostTask != runningTask;

            // We will handle the sysui flags based on the centermost task view.
            if (mRecentsAnimationController != null) {
                mRecentsAnimationController.setWindowThresholdCrossed(centermostTaskFlags != 0
                        && useHomeScreenFlags);
            }
            int sysuiFlags = useHomeScreenFlags ? 0 : centermostTaskFlags;
            mRecentsAnimationController.setUseLauncherSystemBarFlags(
                    (swipeUpThresholdPassed || quickswitchThresholdPassed)
                            && centermostTaskFlags != 0);
            mRecentsAnimationController.setSplitScreenMinimized(swipeUpThresholdPassed);

            int sysuiFlags = swipeUpThresholdPassed ? 0 : centermostTaskFlags;
            mActivity.getSystemUiController().updateUiState(UI_STATE_OVERVIEW, sysuiFlags);
        }
    }
+1 −1
Original line number Diff line number Diff line
@@ -105,7 +105,7 @@ public interface BaseActivityInterface<T extends BaseDraggingActivity> {

    Rect getOverviewWindowBounds(Rect homeBounds, RemoteAnimationTargetCompat target);

    boolean shouldMinimizeSplitScreen();
    boolean allowMinimizeSplitScreen();

    default boolean deferStartingActivity(RecentsAnimationDeviceState deviceState, MotionEvent ev) {
        return true;
Loading