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

Commit 50d7af97 authored by Jerry Chang's avatar Jerry Chang
Browse files

Remove legacy involveSplitScreen API

The onSplitScreenInvoked was used to notify system ui to reset the
divider position before entering split screen. With
SplitScreenTaskOrganizer, WM Shell library could know the exact time
when entering/leaving split screen mode now, so removes the API and
deals with the divider bar position in WM Shell library scope directly.

Resets mRatioPositionBeforeMinimized when dismission split screen since
the informaiton is no longer needed, it will leverage the creation flow
of DividerVew to assign the default target to the new divider bar.

This change will also make sure to reset the divider bar target even
when users are not triggering split screen from recents app shortcut.

Fix: 168869136
Test: atest WMShellUnitTests
Test: atest SystemUITests
Test: manual check the split screen behavior
Change-Id: Icd84a8c1559d0f5f0f99b22445410112fa517efe
parent d5d39ae2
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -1319,10 +1319,6 @@ public class DividerView extends FrameLayout implements OnTouchListener,
                mBackground.getRight(), mBackground.getBottom(), Op.UNION);
    }

    void onDockedFirstAnimationFrame() {
        saveSnapTargetBeforeMinimized(mSplitLayout.getSnapAlgorithm().getMiddleTarget());
    }

    void onDockedTopTask() {
        mState.animateAfterRecentsDrawn = true;
        startDragging(false /* animate */, false /* touching */);
+0 −3
Original line number Diff line number Diff line
@@ -68,9 +68,6 @@ public interface SplitScreen {
    /** Called when there's a task undocking. */
    void onUndockingTask();

    /** Called when the first docked animation frame rendered. */
    void onDockedFirstAnimationFrame();

    /** Called when top task docked. */
    void onDockedTopTask();

+3 −7
Original line number Diff line number Diff line
@@ -426,13 +426,6 @@ public class SplitScreenController implements SplitScreen,
        }
    }

    /** Called when the first docked animation frame rendered. */
    public void onDockedFirstAnimationFrame() {
        if (mView != null) {
            mView.onDockedFirstAnimationFrame();
        }
    }

    /** Called when top task docked. */
    public void onDockedTopTask() {
        if (mView != null) {
@@ -502,6 +495,9 @@ public class SplitScreenController implements SplitScreen,
        mWindowManagerProxy.applyDismissSplit(mSplits, mSplitLayout, true /* dismissOrMaximize */);
        updateVisibility(false /* visible */);
        mMinimized = false;
        // Resets divider bar position to undefined, so new divider bar will apply default position
        // next time entering split mode.
        mDividerState.mRatioPositionBeforeMinimized = 0;
        removeDivider();
        mImePositionProcessor.reset();
    }
+0 −5
Original line number Diff line number Diff line
@@ -43,11 +43,6 @@ interface ISystemUiProxy {
     */
    void startScreenPinning(int taskId) = 1;

    /**
     * Notifies SystemUI that split screen has been invoked.
     */
    void onSplitScreenInvoked() = 5;

    /**
     * Notifies SystemUI that Overview is shown.
     */
+0 −15
Original line number Diff line number Diff line
@@ -231,21 +231,6 @@ public class OverviewProxyService extends CurrentUserTracker implements
            }
        }

        @Override
        public void onSplitScreenInvoked() {
            if (!verifyCaller("onSplitScreenInvoked")) {
                return;
            }
            long token = Binder.clearCallingIdentity();
            try {
                mSplitScreenOptional.ifPresent(splitScreen -> {
                    splitScreen.onDockedFirstAnimationFrame();
                });
            } finally {
                Binder.restoreCallingIdentity(token);
            }
        }

        @Override
        public void onOverviewShown(boolean fromHome) {
            if (!verifyCaller("onOverviewShown")) {