Loading core/res/res/values/config.xml +3 −0 Original line number Diff line number Diff line Loading @@ -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> Loading core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -1755,6 +1755,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" /> Loading libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java +0 −4 Original line number Diff line number Diff line Loading @@ -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)) { Loading libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java +19 −41 Original line number Diff line number Diff line Loading @@ -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) { Loading Loading @@ -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) { Loading Loading @@ -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. Loading @@ -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. Loading Loading @@ -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) { Loading Loading @@ -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. */ Loading Loading @@ -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); Loading Loading @@ -1926,7 +1903,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, } if (mMainStageListener.mHasChildren && mSideStageListener.mHasChildren) { mShouldUpdateRecents = true; mSplitRequest = null; clearRequestIfPresented(); updateRecentTasksSplitPair(); if (!mLogger.hasStartedSession()) { Loading Loading @@ -2565,6 +2542,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, } }); mShouldUpdateRecents = false; mSplitRequest = null; // Update local states. setSplitsVisible(false); Loading libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageTaskListener.java +7 −12 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -267,6 +259,9 @@ class StageTaskListener implements ShellTaskOrganizer.TaskListener { return; } sendStatusChanged(); } else { throw new IllegalArgumentException(this + "\n Unknown task: " + taskInfo + "\n mRootTaskInfo: " + mRootTaskInfo); } } Loading Loading
core/res/res/values/config.xml +3 −0 Original line number Diff line number Diff line Loading @@ -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> Loading
core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -1755,6 +1755,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" /> Loading
libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java +0 −4 Original line number Diff line number Diff line Loading @@ -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)) { Loading
libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java +19 −41 Original line number Diff line number Diff line Loading @@ -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) { Loading Loading @@ -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) { Loading Loading @@ -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. Loading @@ -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. Loading Loading @@ -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) { Loading Loading @@ -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. */ Loading Loading @@ -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); Loading Loading @@ -1926,7 +1903,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, } if (mMainStageListener.mHasChildren && mSideStageListener.mHasChildren) { mShouldUpdateRecents = true; mSplitRequest = null; clearRequestIfPresented(); updateRecentTasksSplitPair(); if (!mLogger.hasStartedSession()) { Loading Loading @@ -2565,6 +2542,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, } }); mShouldUpdateRecents = false; mSplitRequest = null; // Update local states. setSplitsVisible(false); Loading
libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageTaskListener.java +7 −12 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -267,6 +259,9 @@ class StageTaskListener implements ShellTaskOrganizer.TaskListener { return; } sendStatusChanged(); } else { throw new IllegalArgumentException(this + "\n Unknown task: " + taskInfo + "\n mRootTaskInfo: " + mRootTaskInfo); } } Loading