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

Commit 0ddbc3bc authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Merge cherrypicks of ['googleplex-android-review.googlesource.com/22791220',...

Merge cherrypicks of ['googleplex-android-review.googlesource.com/22791220', 'googleplex-android-review.googlesource.com/22569796', 'googleplex-android-review.googlesource.com/22670803', 'googleplex-android-review.googlesource.com/22901260', 'googleplex-android-review.googlesource.com/23053887', 'googleplex-android-review.googlesource.com/23054378', 'googleplex-android-review.googlesource.com/23103421', 'googleplex-android-review.googlesource.com/23048037', 'googleplex-android-review.googlesource.com/22733606', 'googleplex-android-review.googlesource.com/23428200', 'googleplex-android-review.googlesource.com/23479325', 'googleplex-android-review.googlesource.com/22912038', 'googleplex-android-review.googlesource.com/22915981', 'googleplex-android-review.googlesource.com/23511619'] into sparse-10750268-L94100000962880297.
SPARSE_CHANGE: I7bc69ddf1c1742bd800eea4068ce268dfd96d0e3
SPARSE_CHANGE: Ib3240c0b5037a3a20692c83e2daa8cd858125ca7
SPARSE_CHANGE: Ibd6d9a8377e4b5327a473f8b9adf4e569e826172
SPARSE_CHANGE: Ie12843d00c5336e5a472624205e4e4b9ec881cc5
SPARSE_CHANGE: I98618477a828eb72b2173af6988e804471139e81
SPARSE_CHANGE: Ic7b1c4b40960fd04de9efbf4f6d7abee45c93025
SPARSE_CHANGE: Ib4eef40a0f59512c669b069532e55d36293f9e1c
SPARSE_CHANGE: I62e829555c43136080ee4909f7dcf8c388165e9f
SPARSE_CHANGE: I1c51c6f66cd6967651068de1ffc2e6e8566f5a46
SPARSE_CHANGE: I02ddaa5e823379510e9c81a8d803d5269e6d85ad
SPARSE_CHANGE: If1c14cc0a4e3fbdfbed2c105d37ece9a866f18ed
SPARSE_CHANGE: I35ba4652a125c8c83e18138f0fb0a51f3ef65b73
SPARSE_CHANGE: I2bfdc7801cec1b3aaa44f841d8a821214c6cb801
SPARSE_CHANGE: Ide3143558c906ab650e6a295e805adae81eff9bb

Change-Id: If8b71b4135a215b0a1edf81b64b300980161ba49
parents 292f8964 79589458
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -572,6 +572,9 @@
         docked if the dock is configured to enable the accelerometer. -->
    <bool name="config_supportAutoRotation">true</bool>

    <!-- If true, allows rotation resolver service to help resolve screen rotation. -->
    <bool name="config_allowRotationResolver">true</bool>

    <!-- If true, the screen can be rotated via the accelerometer in all 4
         rotations as the default behavior. -->
    <bool name="config_allowAllRotations">false</bool>
+1 −0
Original line number Diff line number Diff line
@@ -1754,6 +1754,7 @@
  <java-symbol type="bool" name="config_perDisplayFocusEnabled" />
  <java-symbol type="bool" name="config_showNavigationBar" />
  <java-symbol type="bool" name="config_supportAutoRotation" />
  <java-symbol type="bool" name="config_allowRotationResolver" />
  <java-symbol type="bool" name="config_dockedStackDividerFreeSnapMode" />
  <java-symbol type="dimen" name="docked_stack_divider_thickness" />
  <java-symbol type="dimen" name="docked_stack_divider_insets" />
+0 −4
Original line number Diff line number Diff line
@@ -727,10 +727,6 @@ public final class SplitLayout implements DisplayInsetsController.OnInsetsChange
        getRefBounds2(mTempRect);
        t.setPosition(leash2, mTempRect.left, mTempRect.top)
                .setWindowCrop(leash2, mTempRect.width(), mTempRect.height());
        // Make right or bottom side surface always higher than left or top side to avoid weird
        // animation when dismiss split. e.g. App surface fling above on decor surface.
        t.setLayer(leash1, 1);
        t.setLayer(leash2, 2);

        if (mImePositionProcessor.adjustSurfaceLayoutForIme(
                t, dividerLeash, leash1, leash2, dimLayer1, dimLayer2)) {
+19 −41
Original line number Diff line number Diff line
@@ -468,26 +468,10 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
                    RemoteAnimationTarget[] wallpapers,
                    RemoteAnimationTarget[] nonApps,
                    final IRemoteAnimationFinishedCallback finishedCallback) {
                boolean openingToSide = false;
                if (apps != null) {
                    for (int i = 0; i < apps.length; ++i) {
                        if (apps[i].mode == MODE_OPENING
                                && mSideStage.containsTask(apps[i].taskId)) {
                            openingToSide = true;
                            break;
                        }
                    }
                } else if (mSideStage.getChildCount() != 0) {
                    // There are chances the entering app transition got canceled by performing
                    // rotation transition. Checks if there is any child task existed in split
                    // screen before fallback to cancel entering flow.
                    openingToSide = true;
                }

                if (isEnteringSplit && !openingToSide) {
                if (isEnteringSplit && mSideStage.getChildCount() == 0) {
                    mMainExecutor.execute(() -> exitSplitScreen(
                            mSideStage.getChildCount() == 0 ? mMainStage : mSideStage,
                            EXIT_REASON_UNKNOWN));
                            null /* childrenToTop */, EXIT_REASON_UNKNOWN));
                    mSplitUnsupportedToast.show();
                }

                if (finishedCallback != null) {
@@ -572,26 +556,10 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
                    RemoteAnimationTarget[] wallpapers, RemoteAnimationTarget[] nonApps,
                    IRemoteAnimationFinishedCallback finishedCallback,
                    SurfaceControl.Transaction t) {
                boolean openingToSide = false;
                if (apps != null) {
                    for (int i = 0; i < apps.length; ++i) {
                        if (apps[i].mode == MODE_OPENING
                                && mSideStage.containsTask(apps[i].taskId)) {
                            openingToSide = true;
                            break;
                        }
                    }
                } else if (mSideStage.getChildCount() != 0) {
                    // There are chances the entering app transition got canceled by performing
                    // rotation transition. Checks if there is any child task existed in split
                    // screen before fallback to cancel entering flow.
                    openingToSide = true;
                }

                if (isEnteringSplit && !openingToSide && apps != null) {
                if (isEnteringSplit && mSideStage.getChildCount() == 0) {
                    mMainExecutor.execute(() -> exitSplitScreen(
                            mSideStage.getChildCount() == 0 ? mMainStage : mSideStage,
                            EXIT_REASON_UNKNOWN));
                            null /* childrenToTop */, EXIT_REASON_UNKNOWN));
                    mSplitUnsupportedToast.show();
                }

                if (apps != null) {
@@ -1034,7 +1002,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
    private void onRemoteAnimationFinishedOrCancelled(WindowContainerTransaction evictWct) {
        mIsDividerRemoteAnimating = false;
        mShouldUpdateRecents = true;
        mSplitRequest = null;
        clearRequestIfPresented();
        // If any stage has no child after animation finished, it means that split will display
        // nothing, such status will happen if task and intent is same app but not support
        // multi-instance, we should exit split and expand that app as full screen.
@@ -1054,7 +1022,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
    private void onRemoteAnimationFinished(RemoteAnimationTarget[] apps) {
        mIsDividerRemoteAnimating = false;
        mShouldUpdateRecents = true;
        mSplitRequest = null;
        clearRequestIfPresented();
        // If any stage has no child after finished animation, that side of the split will display
        // nothing. This might happen if starting the same app on the both sides while not
        // supporting multi-instance. Exit the split screen and expand that app to full screen.
@@ -1320,6 +1288,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
        });
        mShouldUpdateRecents = false;
        mIsDividerRemoteAnimating = false;
        mSplitRequest = null;

        mSplitLayout.getInvisibleBounds(mTempRect1);
        if (childrenToTop == null || childrenToTop.getTopVisibleChildTaskId() == INVALID_TASK_ID) {
@@ -1412,6 +1381,13 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
        }
    }

    private void clearRequestIfPresented() {
        if (mSideStageListener.mVisible && mSideStageListener.mHasChildren
                && mMainStageListener.mVisible && mSideStageListener.mHasChildren) {
            mSplitRequest = null;
        }
    }

    /**
     * Returns whether the split pair in the recent tasks list should be broken.
     */
@@ -1776,6 +1752,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
                    true /* setReparentLeafTaskIfRelaunch */);
            setRootForceTranslucent(true, wct);
        } else {
            clearRequestIfPresented();
            wct.setReparentLeafTaskIfRelaunch(mRootTaskInfo.token,
                    false /* setReparentLeafTaskIfRelaunch */);
            setRootForceTranslucent(false, wct);
@@ -1926,7 +1903,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
        }
        if (mMainStageListener.mHasChildren && mSideStageListener.mHasChildren) {
            mShouldUpdateRecents = true;
            mSplitRequest = null;
            clearRequestIfPresented();
            updateRecentTasksSplitPair();

            if (!mLogger.hasStartedSession()) {
@@ -2565,6 +2542,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
            }
        });
        mShouldUpdateRecents = false;
        mSplitRequest = null;

        // Update local states.
        setSplitsVisible(false);
+7 −12
Original line number Diff line number Diff line
@@ -220,20 +220,12 @@ class StageTaskListener implements ShellTaskOrganizer.TaskListener {
                mCallbacks.onNoLongerSupportMultiWindow();
                return;
            }
            if (taskInfo.topActivity == null && mChildrenTaskInfo.contains(taskInfo.taskId)
                    && mChildrenTaskInfo.get(taskInfo.taskId).topActivity != null) {
                // If top activity become null, it means the task is about to vanish, we use this
                // signal to remove it from children list earlier for smooth dismiss transition.
                mChildrenTaskInfo.remove(taskInfo.taskId);
                mChildrenLeashes.remove(taskInfo.taskId);
            } else {
            mChildrenTaskInfo.put(taskInfo.taskId, taskInfo);
            }
            mCallbacks.onChildTaskStatusChanged(taskInfo.taskId, true /* present */,
                    taskInfo.isVisible);
            if (!ENABLE_SHELL_TRANSITIONS && mChildrenLeashes.contains(taskInfo.taskId)) {
                updateChildTaskSurface(taskInfo, mChildrenLeashes.get(taskInfo.taskId),
                        false /* firstAppeared */);
            if (!ENABLE_SHELL_TRANSITIONS) {
                updateChildTaskSurface(
                        taskInfo, mChildrenLeashes.get(taskInfo.taskId), false /* firstAppeared */);
            }
        } else {
            throw new IllegalArgumentException(this + "\n Unknown task: " + taskInfo
@@ -267,6 +259,9 @@ class StageTaskListener implements ShellTaskOrganizer.TaskListener {
                return;
            }
            sendStatusChanged();
        } else {
            throw new IllegalArgumentException(this + "\n Unknown task: " + taskInfo
                    + "\n mRootTaskInfo: " + mRootTaskInfo);
        }
    }

Loading