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

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

Default divider interaction to true if transition doesn't succeed

* Currently we disable interactions at the beginning of a resize
transition and then re-enable on success
* When the fold/unfold happens, the transition to resize gets
clobbered/consumed by another transition, so the success callback for
re-enabling never runs
* Prior to ag/25604240 this was never an issue since we unconditionally
enabled divider interaction

Fixes: 318759451
Test: Repro steps don't leave divider uninteractable
Flag: None
Change-Id: I6af18c8175ea3ec7070bda03ebc8fb9c08f78c17
parent f9efdbf5
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -388,6 +388,7 @@ class SplitScreenTransitions {

    IBinder startResizeTransition(WindowContainerTransaction wct,
            Transitions.TransitionHandler handler,
            @Nullable TransitionConsumedCallback consumedCallback,
            @Nullable TransitionFinishedCallback finishCallback) {
        if (mPendingResize != null) {
            mPendingResize.cancel(null);
@@ -396,13 +397,14 @@ class SplitScreenTransitions {
        }

        IBinder transition = mTransitions.startTransition(TRANSIT_CHANGE, wct, handler);
        setResizeTransition(transition, finishCallback);
        setResizeTransition(transition, consumedCallback, finishCallback);
        return transition;
    }

    void setResizeTransition(@NonNull IBinder transition,
            @Nullable TransitionConsumedCallback consumedCallback,
            @Nullable TransitionFinishedCallback finishCallback) {
        mPendingResize = new TransitSession(transition, null /* consumedCb */, finishCallback);
        mPendingResize = new TransitSession(transition, consumedCallback, finishCallback);
        ProtoLog.v(ShellProtoLogGroup.WM_SHELL_TRANSITIONS, "  splitTransition "
                + " deduced Resize split screen");
    }
+5 −2
Original line number Diff line number Diff line
@@ -2236,8 +2236,11 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
        sendOnBoundsChanged();
        if (ENABLE_SHELL_TRANSITIONS) {
            mSplitLayout.setDividerInteractive(false, false, "onSplitResizeStart");
            mSplitTransitions.startResizeTransition(wct, this, (finishWct, t) ->
                    mSplitLayout.setDividerInteractive(true, false, "onSplitResizeFinish"));
            mSplitTransitions.startResizeTransition(wct, this, (aborted) -> {
                mSplitLayout.setDividerInteractive(true, false, "onSplitResizeConsumed");
            }, (finishWct, t) -> {
                mSplitLayout.setDividerInteractive(true, false, "onSplitResizeFinish");
            });
        } else {
            // Only need screenshot for legacy case because shell transition should screenshot
            // itself during transition.