Loading core/java/android/view/WindowManagerPolicyConstants.java +37 −0 Original line number Diff line number Diff line Loading @@ -209,4 +209,41 @@ public interface WindowManagerPolicyConstants { return Integer.toString(why); } } /** * How much to multiply the policy's type layer, to reserve room * for multiple windows of the same type and Z-ordering adjustment * with TYPE_LAYER_OFFSET. */ int TYPE_LAYER_MULTIPLIER = 10000; /** * Offset from TYPE_LAYER_MULTIPLIER for moving a group of windows above * or below others in the same layer. */ int TYPE_LAYER_OFFSET = 1000; /** * How much to increment the layer for each window, to reserve room * for effect surfaces between them. */ int WINDOW_LAYER_MULTIPLIER = 5; /** * Animation thumbnail is as far as possible below the window above * the thumbnail (or in other words as far as possible above the window * below it). */ int LAYER_OFFSET_THUMBNAIL = WINDOW_LAYER_MULTIPLIER - 1; int SPLIT_DIVIDER_LAYER = TYPE_LAYER_MULTIPLIER * 3; int WATERMARK_LAYER = TYPE_LAYER_MULTIPLIER * 100; int STRICT_MODE_LAYER = TYPE_LAYER_MULTIPLIER * 101; int WINDOW_FREEZE_LAYER = TYPE_LAYER_MULTIPLIER * 200; /** * Layers for screen rotation animation. We put these layers above * WINDOW_FREEZE_LAYER so that screen freeze will cover all windows. */ int SCREEN_FREEZE_LAYER_BASE = WINDOW_FREEZE_LAYER + TYPE_LAYER_MULTIPLIER; } libs/WindowManager/Shell/src/com/android/wm/shell/apppairs/AppPair.java +2 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.wm.shell.apppairs; import static android.app.ActivityTaskManager.INVALID_TASK_ID; import static android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW; import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED; import static android.view.WindowManagerPolicyConstants.SPLIT_DIVIDER_LAYER; import static com.android.wm.shell.common.split.SplitLayout.SPLIT_POSITION_BOTTOM_OR_RIGHT; import static com.android.wm.shell.common.split.SplitLayout.SPLIT_POSITION_TOP_OR_LEFT; Loading Loading @@ -181,7 +182,7 @@ class AppPair implements ShellTaskOrganizer.TaskListener, SplitLayout.SplitLayou // TODO: Is there more we need to do here? mSyncQueue.runInSync(t -> { t.setLayer(dividerLeash, Integer.MAX_VALUE) t.setLayer(dividerLeash, SPLIT_DIVIDER_LAYER) .setPosition(mTaskLeash1, mTaskInfo1.positionInParent.x, mTaskInfo1.positionInParent.y) .setPosition(mTaskLeash2, mTaskInfo2.positionInParent.x, Loading libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java +2 −1 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import static android.view.WindowManager.DOCKED_INVALID; import static android.view.WindowManager.DOCKED_LEFT; import static android.view.WindowManager.DOCKED_RIGHT; import static android.view.WindowManager.DOCKED_TOP; import static android.view.WindowManagerPolicyConstants.SPLIT_DIVIDER_LAYER; import static com.android.internal.policy.DividerSnapAlgorithm.SnapTarget.FLAG_DISMISS_END; import static com.android.internal.policy.DividerSnapAlgorithm.SnapTarget.FLAG_DISMISS_START; Loading Loading @@ -365,7 +366,7 @@ public final class SplitLayout { if (dividerLeash != null) { t.setPosition(dividerLeash, mDividerBounds.left, mDividerBounds.top); // Resets layer of divider bar to make sure it is always on top. t.setLayer(dividerLeash, Integer.MAX_VALUE); t.setLayer(dividerLeash, SPLIT_DIVIDER_LAYER); } t.setPosition(leash1, mBounds1.left, mBounds1.top) .setWindowCrop(leash1, mBounds1.width(), mBounds1.height()); Loading libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java +3 −3 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import static android.view.WindowManager.TRANSIT_OPEN; import static android.view.WindowManager.TRANSIT_TO_BACK; import static android.view.WindowManager.TRANSIT_TO_FRONT; import static android.view.WindowManager.transitTypeToString; import static android.view.WindowManagerPolicyConstants.SPLIT_DIVIDER_LAYER; import static com.android.internal.util.FrameworkStatsLog.SPLITSCREEN_UICHANGED__EXIT_REASON__APP_DOES_NOT_SUPPORT_MULTIWINDOW; import static com.android.internal.util.FrameworkStatsLog.SPLITSCREEN_UICHANGED__EXIT_REASON__APP_FINISHED; Loading Loading @@ -88,7 +89,6 @@ import com.android.wm.shell.common.SyncTransactionQueue; import com.android.wm.shell.common.TransactionPool; import com.android.wm.shell.common.split.SplitLayout; import com.android.wm.shell.common.split.SplitLayout.SplitPosition; import com.android.wm.shell.common.split.SplitWindowManager; import com.android.wm.shell.protolog.ShellProtoLogGroup; import com.android.wm.shell.transition.Transitions; Loading Loading @@ -696,7 +696,7 @@ class StageCoordinator implements SplitLayout.SplitLayoutHandler, if (mDividerVisible) { t.show(dividerLeash) .setLayer(dividerLeash, Integer.MAX_VALUE) .setLayer(dividerLeash, SPLIT_DIVIDER_LAYER) .setPosition(dividerLeash, mSplitLayout.getDividerBounds().left, mSplitLayout.getDividerBounds().top); Loading Loading @@ -1133,7 +1133,7 @@ class StageCoordinator implements SplitLayout.SplitLayoutHandler, // Be default, make it visible. The remote animator can adjust alpha if it plans to animate. if (show) { t.setAlpha(leash, 1.f); t.setLayer(leash, Integer.MAX_VALUE); t.setLayer(leash, SPLIT_DIVIDER_LAYER); t.setPosition(leash, bounds.left, bounds.top); t.show(leash); } Loading libs/WindowManager/Shell/src/com/android/wm/shell/transition/ScreenRotationAnimation.java +1 −13 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.wm.shell.transition; import static android.hardware.HardwareBuffer.RGBA_8888; import static android.hardware.HardwareBuffer.USAGE_PROTECTED_CONTENT; import static android.util.RotationUtils.deltaRotation; import static android.view.WindowManagerPolicyConstants.SCREEN_FREEZE_LAYER_BASE; import static com.android.wm.shell.transition.DefaultTransitionHandler.startSurfaceAnimation; import static com.android.wm.shell.transition.Transitions.TAG; Loading Loading @@ -81,19 +82,6 @@ import java.util.Arrays; * </ul> */ class ScreenRotationAnimation { /** How much to multiply the policy's type layer, to reserve room * for multiple windows of the same type and Z-ordering adjustment * with TYPE_LAYER_OFFSET. */ static final int TYPE_LAYER_MULTIPLIER = 10000; static final int WINDOW_FREEZE_LAYER = TYPE_LAYER_MULTIPLIER * 200; /* * Layers for screen rotation animation. We put these layers above * WINDOW_FREEZE_LAYER so that screen freeze will cover all windows. */ private static final int SCREEN_FREEZE_LAYER_BASE = WINDOW_FREEZE_LAYER + TYPE_LAYER_MULTIPLIER; static final int MAX_ANIMATION_DURATION = 10 * 1000; private final Context mContext; Loading Loading
core/java/android/view/WindowManagerPolicyConstants.java +37 −0 Original line number Diff line number Diff line Loading @@ -209,4 +209,41 @@ public interface WindowManagerPolicyConstants { return Integer.toString(why); } } /** * How much to multiply the policy's type layer, to reserve room * for multiple windows of the same type and Z-ordering adjustment * with TYPE_LAYER_OFFSET. */ int TYPE_LAYER_MULTIPLIER = 10000; /** * Offset from TYPE_LAYER_MULTIPLIER for moving a group of windows above * or below others in the same layer. */ int TYPE_LAYER_OFFSET = 1000; /** * How much to increment the layer for each window, to reserve room * for effect surfaces between them. */ int WINDOW_LAYER_MULTIPLIER = 5; /** * Animation thumbnail is as far as possible below the window above * the thumbnail (or in other words as far as possible above the window * below it). */ int LAYER_OFFSET_THUMBNAIL = WINDOW_LAYER_MULTIPLIER - 1; int SPLIT_DIVIDER_LAYER = TYPE_LAYER_MULTIPLIER * 3; int WATERMARK_LAYER = TYPE_LAYER_MULTIPLIER * 100; int STRICT_MODE_LAYER = TYPE_LAYER_MULTIPLIER * 101; int WINDOW_FREEZE_LAYER = TYPE_LAYER_MULTIPLIER * 200; /** * Layers for screen rotation animation. We put these layers above * WINDOW_FREEZE_LAYER so that screen freeze will cover all windows. */ int SCREEN_FREEZE_LAYER_BASE = WINDOW_FREEZE_LAYER + TYPE_LAYER_MULTIPLIER; }
libs/WindowManager/Shell/src/com/android/wm/shell/apppairs/AppPair.java +2 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.wm.shell.apppairs; import static android.app.ActivityTaskManager.INVALID_TASK_ID; import static android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW; import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED; import static android.view.WindowManagerPolicyConstants.SPLIT_DIVIDER_LAYER; import static com.android.wm.shell.common.split.SplitLayout.SPLIT_POSITION_BOTTOM_OR_RIGHT; import static com.android.wm.shell.common.split.SplitLayout.SPLIT_POSITION_TOP_OR_LEFT; Loading Loading @@ -181,7 +182,7 @@ class AppPair implements ShellTaskOrganizer.TaskListener, SplitLayout.SplitLayou // TODO: Is there more we need to do here? mSyncQueue.runInSync(t -> { t.setLayer(dividerLeash, Integer.MAX_VALUE) t.setLayer(dividerLeash, SPLIT_DIVIDER_LAYER) .setPosition(mTaskLeash1, mTaskInfo1.positionInParent.x, mTaskInfo1.positionInParent.y) .setPosition(mTaskLeash2, mTaskInfo2.positionInParent.x, Loading
libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java +2 −1 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import static android.view.WindowManager.DOCKED_INVALID; import static android.view.WindowManager.DOCKED_LEFT; import static android.view.WindowManager.DOCKED_RIGHT; import static android.view.WindowManager.DOCKED_TOP; import static android.view.WindowManagerPolicyConstants.SPLIT_DIVIDER_LAYER; import static com.android.internal.policy.DividerSnapAlgorithm.SnapTarget.FLAG_DISMISS_END; import static com.android.internal.policy.DividerSnapAlgorithm.SnapTarget.FLAG_DISMISS_START; Loading Loading @@ -365,7 +366,7 @@ public final class SplitLayout { if (dividerLeash != null) { t.setPosition(dividerLeash, mDividerBounds.left, mDividerBounds.top); // Resets layer of divider bar to make sure it is always on top. t.setLayer(dividerLeash, Integer.MAX_VALUE); t.setLayer(dividerLeash, SPLIT_DIVIDER_LAYER); } t.setPosition(leash1, mBounds1.left, mBounds1.top) .setWindowCrop(leash1, mBounds1.width(), mBounds1.height()); Loading
libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java +3 −3 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import static android.view.WindowManager.TRANSIT_OPEN; import static android.view.WindowManager.TRANSIT_TO_BACK; import static android.view.WindowManager.TRANSIT_TO_FRONT; import static android.view.WindowManager.transitTypeToString; import static android.view.WindowManagerPolicyConstants.SPLIT_DIVIDER_LAYER; import static com.android.internal.util.FrameworkStatsLog.SPLITSCREEN_UICHANGED__EXIT_REASON__APP_DOES_NOT_SUPPORT_MULTIWINDOW; import static com.android.internal.util.FrameworkStatsLog.SPLITSCREEN_UICHANGED__EXIT_REASON__APP_FINISHED; Loading Loading @@ -88,7 +89,6 @@ import com.android.wm.shell.common.SyncTransactionQueue; import com.android.wm.shell.common.TransactionPool; import com.android.wm.shell.common.split.SplitLayout; import com.android.wm.shell.common.split.SplitLayout.SplitPosition; import com.android.wm.shell.common.split.SplitWindowManager; import com.android.wm.shell.protolog.ShellProtoLogGroup; import com.android.wm.shell.transition.Transitions; Loading Loading @@ -696,7 +696,7 @@ class StageCoordinator implements SplitLayout.SplitLayoutHandler, if (mDividerVisible) { t.show(dividerLeash) .setLayer(dividerLeash, Integer.MAX_VALUE) .setLayer(dividerLeash, SPLIT_DIVIDER_LAYER) .setPosition(dividerLeash, mSplitLayout.getDividerBounds().left, mSplitLayout.getDividerBounds().top); Loading Loading @@ -1133,7 +1133,7 @@ class StageCoordinator implements SplitLayout.SplitLayoutHandler, // Be default, make it visible. The remote animator can adjust alpha if it plans to animate. if (show) { t.setAlpha(leash, 1.f); t.setLayer(leash, Integer.MAX_VALUE); t.setLayer(leash, SPLIT_DIVIDER_LAYER); t.setPosition(leash, bounds.left, bounds.top); t.show(leash); } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/transition/ScreenRotationAnimation.java +1 −13 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.wm.shell.transition; import static android.hardware.HardwareBuffer.RGBA_8888; import static android.hardware.HardwareBuffer.USAGE_PROTECTED_CONTENT; import static android.util.RotationUtils.deltaRotation; import static android.view.WindowManagerPolicyConstants.SCREEN_FREEZE_LAYER_BASE; import static com.android.wm.shell.transition.DefaultTransitionHandler.startSurfaceAnimation; import static com.android.wm.shell.transition.Transitions.TAG; Loading Loading @@ -81,19 +82,6 @@ import java.util.Arrays; * </ul> */ class ScreenRotationAnimation { /** How much to multiply the policy's type layer, to reserve room * for multiple windows of the same type and Z-ordering adjustment * with TYPE_LAYER_OFFSET. */ static final int TYPE_LAYER_MULTIPLIER = 10000; static final int WINDOW_FREEZE_LAYER = TYPE_LAYER_MULTIPLIER * 200; /* * Layers for screen rotation animation. We put these layers above * WINDOW_FREEZE_LAYER so that screen freeze will cover all windows. */ private static final int SCREEN_FREEZE_LAYER_BASE = WINDOW_FREEZE_LAYER + TYPE_LAYER_MULTIPLIER; static final int MAX_ANIMATION_DURATION = 10 * 1000; private final Context mContext; Loading