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

Commit 6fef5f85 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Prevent launching app in split if task split is unsupported" into...

Merge "Prevent launching app in split if task split is unsupported" into sc-v2-dev am: ce597d78 am: 9531506a

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/16124504

Change-Id: I08a3f1b2aa478bf1439c67e011f59ac9492517e8
parents cc1e19c3 9531506a
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -193,6 +193,8 @@
    <string name="action_split">Split</string>
    <!-- Label for toast with instructions for split screen selection mode. [CHAR_LIMIT=50] -->
    <string name="toast_split_select_app">Tap another app to use splitscreen</string>
    <!-- Label for toast when app selected for split isn't supported. [CHAR_LIMIT=50] -->
    <string name="toast_split_app_unsupported">App does not support split-screen.</string>
    <!-- Message shown when an action is blocked by a policy enforced by the app or the organization managing the device. [CHAR_LIMIT=NONE] -->
    <string name="blocked_by_policy">This action isn\'t allowed by the app or your organization</string>

+8 −0
Original line number Diff line number Diff line
@@ -599,6 +599,8 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
    private SplitConfigurationOptions.StagedSplitBounds mSplitBoundsConfig;
    private final Toast mSplitToast = Toast.makeText(getContext(),
            R.string.toast_split_select_app, Toast.LENGTH_SHORT);
    private final Toast mSplitUnsupportedToast = Toast.makeText(getContext(),
            R.string.toast_split_app_unsupported, Toast.LENGTH_SHORT);

    /**
     * Keeps track of the index of the TaskView that split screen was initialized with so we know
@@ -3878,6 +3880,11 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T

    public void confirmSplitSelect(TaskView taskView) {
        mSplitToast.cancel();
        if (!taskView.getTask().isDockable) {
            // Task not split screen supported
            mSplitUnsupportedToast.show();
            return;
        }
        RectF secondTaskStartingBounds = new RectF();
        Rect secondTaskEndingBounds = new Rect();
        // TODO(194414938) starting bounds seem slightly off, investigate
@@ -3920,6 +3927,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
        int duration = mActivity.getStateManager().getState().getTransitionDuration(getContext());
        PendingAnimation pendingAnim = new PendingAnimation(duration);
        mSplitToast.cancel();
        mSplitUnsupportedToast.cancel();
        if (!animate) {
            resetFromSplitSelectionState();
            return pendingAnim;