Loading libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeVisualIndicator.java +9 −24 Original line number Diff line number Diff line Loading @@ -17,6 +17,8 @@ package com.android.wm.shell.desktopmode; import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM; import static android.view.WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE; import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION; import static com.android.wm.shell.desktopmode.EnterDesktopTaskTransitionHandler.FINAL_FREEFORM_SCALE; Loading Loading @@ -86,7 +88,6 @@ public class DesktopModeVisualIndicator { mTaskSurface = taskSurface; mRootTdaOrganizer = taskDisplayAreaOrganizer; mCurrentType = IndicatorType.NO_INDICATOR; createView(); } /** Loading Loading @@ -127,34 +128,15 @@ public class DesktopModeVisualIndicator { mView = new View(mContext); final SurfaceControl.Builder builder = new SurfaceControl.Builder(); mRootTdaOrganizer.attachToDisplayArea(mTaskInfo.displayId, builder); String description; switch (mCurrentType) { case TO_DESKTOP_INDICATOR: description = "Desktop indicator"; break; case TO_FULLSCREEN_INDICATOR: description = "Fullscreen indicator"; break; case TO_SPLIT_LEFT_INDICATOR: description = "Split Left indicator"; break; case TO_SPLIT_RIGHT_INDICATOR: description = "Split Right indicator"; break; default: description = "Invalid indicator"; break; } mLeash = builder .setName(description) .setName("Desktop Mode Visual Indicator") .setContainerLayer() .build(); t.show(mLeash); final WindowManager.LayoutParams lp = new WindowManager.LayoutParams(screenWidth, screenHeight, WindowManager.LayoutParams.TYPE_APPLICATION, WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, PixelFormat.TRANSPARENT); lp.setTitle(description + " for Task=" + mTaskInfo.taskId); new WindowManager.LayoutParams(screenWidth, screenHeight, TYPE_APPLICATION, FLAG_NOT_FOCUSABLE, PixelFormat.TRANSPARENT); lp.setTitle("Desktop Mode Visual Indicator"); lp.setTrustedOverlay(); final WindowlessWindowManager windowManager = new WindowlessWindowManager( mTaskInfo.configuration, mLeash, Loading Loading @@ -201,6 +183,9 @@ public class DesktopModeVisualIndicator { */ private void transitionIndicator(IndicatorType newType) { if (mCurrentType == newType) return; if (mView == null) { createView(); } if (mCurrentType == IndicatorType.NO_INDICATOR) { fadeInIndicator(newType); } else if (newType == IndicatorType.NO_INDICATOR) { Loading libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt +7 −2 Original line number Diff line number Diff line Loading @@ -919,22 +919,27 @@ class DesktopTasksController( } if (taskBounds.top <= transitionAreaHeight) { moveToFullscreenWithAnimation(taskInfo, position) return } if (inputCoordinate.x <= transitionAreaWidth) { releaseVisualIndicator() var wct = WindowContainerTransaction() val wct = WindowContainerTransaction() addMoveToSplitChanges(wct, taskInfo) splitScreenController.requestEnterSplitSelect(taskInfo, wct, SPLIT_POSITION_TOP_OR_LEFT, taskBounds) return } if (inputCoordinate.x >= (displayController.getDisplayLayout(taskInfo.displayId)?.width() ?.minus(transitionAreaWidth) ?: return)) { releaseVisualIndicator() var wct = WindowContainerTransaction() val wct = WindowContainerTransaction() addMoveToSplitChanges(wct, taskInfo) splitScreenController.requestEnterSplitSelect(taskInfo, wct, SPLIT_POSITION_BOTTOM_OR_RIGHT, taskBounds) return } // A freeform drag-move ended, remove the indicator immediately. releaseVisualIndicator() } /** Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DragResizeInputListener.java +4 −2 Original line number Diff line number Diff line Loading @@ -353,6 +353,7 @@ class DragResizeInputListener implements AutoCloseable { private boolean mShouldHandleEvents; private int mLastCursorType = PointerIcon.TYPE_DEFAULT; private Rect mDragStartTaskBounds; private final Rect mTmpRect = new Rect(); private TaskResizeInputEventReceiver( InputChannel inputChannel, Handler handler, Choreographer choreographer) { Loading Loading @@ -477,14 +478,15 @@ class DragResizeInputListener implements AutoCloseable { } private void updateInputSinkRegionForDrag(Rect taskBounds) { mTmpRect.set(taskBounds); final DisplayLayout layout = mDisplayController.getDisplayLayout(mDisplayId); final Region dragTouchRegion = new Region(-taskBounds.left, -taskBounds.top, -taskBounds.left + layout.width(), -taskBounds.top + layout.height()); // Remove the localized task bounds from the touch region. taskBounds.offsetTo(0, 0); dragTouchRegion.op(taskBounds, Region.Op.DIFFERENCE); mTmpRect.offsetTo(0, 0); dragTouchRegion.op(mTmpRect, Region.Op.DIFFERENCE); updateSinkInputChannel(dragTouchRegion); } Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeVisualIndicator.java +9 −24 Original line number Diff line number Diff line Loading @@ -17,6 +17,8 @@ package com.android.wm.shell.desktopmode; import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM; import static android.view.WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE; import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION; import static com.android.wm.shell.desktopmode.EnterDesktopTaskTransitionHandler.FINAL_FREEFORM_SCALE; Loading Loading @@ -86,7 +88,6 @@ public class DesktopModeVisualIndicator { mTaskSurface = taskSurface; mRootTdaOrganizer = taskDisplayAreaOrganizer; mCurrentType = IndicatorType.NO_INDICATOR; createView(); } /** Loading Loading @@ -127,34 +128,15 @@ public class DesktopModeVisualIndicator { mView = new View(mContext); final SurfaceControl.Builder builder = new SurfaceControl.Builder(); mRootTdaOrganizer.attachToDisplayArea(mTaskInfo.displayId, builder); String description; switch (mCurrentType) { case TO_DESKTOP_INDICATOR: description = "Desktop indicator"; break; case TO_FULLSCREEN_INDICATOR: description = "Fullscreen indicator"; break; case TO_SPLIT_LEFT_INDICATOR: description = "Split Left indicator"; break; case TO_SPLIT_RIGHT_INDICATOR: description = "Split Right indicator"; break; default: description = "Invalid indicator"; break; } mLeash = builder .setName(description) .setName("Desktop Mode Visual Indicator") .setContainerLayer() .build(); t.show(mLeash); final WindowManager.LayoutParams lp = new WindowManager.LayoutParams(screenWidth, screenHeight, WindowManager.LayoutParams.TYPE_APPLICATION, WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, PixelFormat.TRANSPARENT); lp.setTitle(description + " for Task=" + mTaskInfo.taskId); new WindowManager.LayoutParams(screenWidth, screenHeight, TYPE_APPLICATION, FLAG_NOT_FOCUSABLE, PixelFormat.TRANSPARENT); lp.setTitle("Desktop Mode Visual Indicator"); lp.setTrustedOverlay(); final WindowlessWindowManager windowManager = new WindowlessWindowManager( mTaskInfo.configuration, mLeash, Loading Loading @@ -201,6 +183,9 @@ public class DesktopModeVisualIndicator { */ private void transitionIndicator(IndicatorType newType) { if (mCurrentType == newType) return; if (mView == null) { createView(); } if (mCurrentType == IndicatorType.NO_INDICATOR) { fadeInIndicator(newType); } else if (newType == IndicatorType.NO_INDICATOR) { Loading
libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt +7 −2 Original line number Diff line number Diff line Loading @@ -919,22 +919,27 @@ class DesktopTasksController( } if (taskBounds.top <= transitionAreaHeight) { moveToFullscreenWithAnimation(taskInfo, position) return } if (inputCoordinate.x <= transitionAreaWidth) { releaseVisualIndicator() var wct = WindowContainerTransaction() val wct = WindowContainerTransaction() addMoveToSplitChanges(wct, taskInfo) splitScreenController.requestEnterSplitSelect(taskInfo, wct, SPLIT_POSITION_TOP_OR_LEFT, taskBounds) return } if (inputCoordinate.x >= (displayController.getDisplayLayout(taskInfo.displayId)?.width() ?.minus(transitionAreaWidth) ?: return)) { releaseVisualIndicator() var wct = WindowContainerTransaction() val wct = WindowContainerTransaction() addMoveToSplitChanges(wct, taskInfo) splitScreenController.requestEnterSplitSelect(taskInfo, wct, SPLIT_POSITION_BOTTOM_OR_RIGHT, taskBounds) return } // A freeform drag-move ended, remove the indicator immediately. releaseVisualIndicator() } /** Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DragResizeInputListener.java +4 −2 Original line number Diff line number Diff line Loading @@ -353,6 +353,7 @@ class DragResizeInputListener implements AutoCloseable { private boolean mShouldHandleEvents; private int mLastCursorType = PointerIcon.TYPE_DEFAULT; private Rect mDragStartTaskBounds; private final Rect mTmpRect = new Rect(); private TaskResizeInputEventReceiver( InputChannel inputChannel, Handler handler, Choreographer choreographer) { Loading Loading @@ -477,14 +478,15 @@ class DragResizeInputListener implements AutoCloseable { } private void updateInputSinkRegionForDrag(Rect taskBounds) { mTmpRect.set(taskBounds); final DisplayLayout layout = mDisplayController.getDisplayLayout(mDisplayId); final Region dragTouchRegion = new Region(-taskBounds.left, -taskBounds.top, -taskBounds.left + layout.width(), -taskBounds.top + layout.height()); // Remove the localized task bounds from the touch region. taskBounds.offsetTo(0, 0); dragTouchRegion.op(taskBounds, Region.Op.DIFFERENCE); mTmpRect.offsetTo(0, 0); dragTouchRegion.op(mTmpRect, Region.Op.DIFFERENCE); updateSinkInputChannel(dragTouchRegion); } Loading