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

Commit a11d1e29 authored by Vinit Nayak's avatar Vinit Nayak
Browse files

Disable gesture when split invoked from in-app taskbar

* Previously gesture was disabled when we started both apps
from launcher (overview, workspace, all apps etc)
* This handles the case when we start split from in-app taskbar,
in that case the transitions finishes much faster and launcher was
getting the disable flag turned off before the side animation finished.
* Now for enter transitions that are resizing, we delay turning the
disable flag off until after the animation completes
* Button nav version of this still needs to be handled (separate path
from sysui flags, I think?)

Bug: 290893291
Test: No longer able to swipe up after starting split from in-app
taskbar. Other swipe invocations are still disabled
Flag: EXEMPT bugfix

Change-Id: Ib489f2b63466c6552a4a2c9c13577844c4b71036
(cherry picked from commit cd6efea5)
Merged-In: Ib489f2b63466c6552a4a2c9c13577844c4b71036
parent b5a10ed9
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -620,10 +620,15 @@ public final class SplitLayout implements DisplayInsetsController.OnInsetsChange
    }

    /** Fling divider from current position to center position. */
    public void flingDividerToCenter() {
    public void flingDividerToCenter(@Nullable Runnable finishCallback) {
        final int pos = mDividerSnapAlgorithm.getMiddleTarget().position;
        flingDividePosition(getDividePosition(), pos, FLING_ENTER_DURATION,
                () -> setDividePosition(pos, true /* applyLayoutChange */));
                () -> {
                    setDividePosition(pos, true /* applyLayoutChange */);
                    if (finishCallback != null) {
                        finishCallback.run();
                    }
                });
    }

    @VisibleForTesting
+7 −4
Original line number Diff line number Diff line
@@ -2108,7 +2108,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
                    mSkipEvictingMainStageChildren = false;
                } else {
                    mShowDecorImmediately = true;
                    mSplitLayout.flingDividerToCenter();
                    mSplitLayout.flingDividerToCenter(/*finishCallback*/ null);
                }
            });
        }
@@ -2308,7 +2308,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
                    mSkipEvictingMainStageChildren = false;
                } else {
                    mShowDecorImmediately = true;
                    mSplitLayout.flingDividerToCenter();
                    mSplitLayout.flingDividerToCenter(/*finishCallback*/ null);
                }
            });
        }
@@ -3144,7 +3144,10 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
        final TransitionInfo.Change finalMainChild = mainChild;
        final TransitionInfo.Change finalSideChild = sideChild;
        enterTransition.setFinishedCallback((callbackWct, callbackT) -> {
            if (!enterTransition.mResizeAnim) {
                // If resizing, we'll call notify at the end of the resizing animation (below)
                notifySplitAnimationFinished();
            }
            if (finalMainChild != null) {
                if (!mainNotContainOpenTask) {
                    mMainStage.evictOtherChildren(callbackWct, finalMainChild.getTaskInfo().taskId);
@@ -3164,7 +3167,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
            }
            if (enterTransition.mResizeAnim) {
                mShowDecorImmediately = true;
                mSplitLayout.flingDividerToCenter();
                mSplitLayout.flingDividerToCenter(this::notifySplitAnimationFinished);
            }
            callbackWct.setReparentLeafTaskIfRelaunch(mRootTaskInfo.token, false);
            mPausingTasks.clear();