Loading libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/desktopmode/DesktopModeFlags.kt +3 −1 Original line number Diff line number Diff line Loading @@ -44,7 +44,9 @@ enum class DesktopModeFlags( TASK_STACK_OBSERVER_IN_SHELL(Flags::enableTaskStackObserverInShell, true), SIZE_CONSTRAINTS(Flags::enableDesktopWindowingSizeConstraints, true), DYNAMIC_INITIAL_BOUNDS(Flags::enableWindowingDynamicInitialBounds, true), ENABLE_DESKTOP_WINDOWING_TASK_LIMIT(Flags::enableDesktopWindowingTaskLimit, true); ENABLE_DESKTOP_WINDOWING_TASK_LIMIT(Flags::enableDesktopWindowingTaskLimit, true), BACK_NAVIGATION(Flags::enableDesktopWindowingBackNavigation, true), EDGE_DRAG_RESIZE(Flags::enableWindowingEdgeDragResize, true); /** * Determines state of flag based on the actual flag and desktop mode developer option overrides. Loading libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt +3 −3 Original line number Diff line number Diff line Loading @@ -54,7 +54,6 @@ import com.android.internal.jank.Cuj.CUJ_DESKTOP_MODE_ENTER_APP_HANDLE_DRAG_RELE import com.android.internal.jank.InteractionJankMonitor import com.android.internal.policy.ScreenDecorationsUtils import com.android.internal.protolog.ProtoLog import com.android.window.flags.Flags import com.android.wm.shell.RootTaskDisplayAreaOrganizer import com.android.wm.shell.ShellTaskOrganizer import com.android.wm.shell.common.DisplayController Loading Loading @@ -982,7 +981,7 @@ class DesktopTasksController( } taskRepository.addClosingTask(task.displayId, task.taskId) // If a CLOSE or TO_BACK is triggered on a desktop task, remove the task. if (Flags.enableDesktopWindowingBackNavigation() && if (DesktopModeFlags.BACK_NAVIGATION.isEnabled(context) && taskRepository.isVisibleTask(task.taskId)) { wct.removeTask(task.token) } Loading Loading @@ -1488,7 +1487,8 @@ class DesktopTasksController( } override fun hideStashedDesktopApps(displayId: Int) { ProtoLog.w(WM_SHELL_DESKTOP_MODE, "IDesktopModeImpl: hideStashedDesktopApps is deprecated") ProtoLog.w(WM_SHELL_DESKTOP_MODE, "IDesktopModeImpl: hideStashedDesktopApps is deprecated") } override fun getVisibleTaskCount(displayId: Int): Int { Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/CaptionWindowDecoration.java +1 −1 Original line number Diff line number Diff line Loading @@ -279,7 +279,7 @@ public class CaptionWindowDecoration extends WindowDecoration<WindowDecorLinearL final Resources res = mResult.mRootView.getResources(); mDragResizeListener.setGeometry(new DragResizeWindowGeometry(0 /* taskCornerRadius */, new Size(mResult.mWidth, mResult.mHeight), getResizeEdgeHandleSize(res), new Size(mResult.mWidth, mResult.mHeight), getResizeEdgeHandleSize(mContext, res), getFineResizeCornerSize(res), getLargeResizeCornerSize(res)), touchSlop); } Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java +3 −2 Original line number Diff line number Diff line Loading @@ -492,8 +492,9 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin final Resources res = mResult.mRootView.getResources(); if (mDragResizeListener.setGeometry( new DragResizeWindowGeometry(mRelayoutParams.mCornerRadius, new Size(mResult.mWidth, mResult.mHeight), getResizeEdgeHandleSize(res), getFineResizeCornerSize(res), getLargeResizeCornerSize(res)), touchSlop) new Size(mResult.mWidth, mResult.mHeight), getResizeEdgeHandleSize(mContext, res), getFineResizeCornerSize(res), getLargeResizeCornerSize(res)), touchSlop) || !mTaskInfo.positionInParent.equals(mPositionInParent)) { updateExclusionRegion(); } Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DragResizeInputListener.java +10 −7 Original line number Diff line number Diff line Loading @@ -81,6 +81,7 @@ class DragResizeInputListener implements AutoCloseable { private final InputChannel mInputChannel; private final TaskResizeInputEventReceiver mInputEventReceiver; private final Context mContext; private final SurfaceControl mInputSinkSurface; private final IBinder mSinkClientToken; private final InputChannel mSinkInputChannel; Loading @@ -97,6 +98,7 @@ class DragResizeInputListener implements AutoCloseable { Supplier<SurfaceControl.Builder> surfaceControlBuilderSupplier, Supplier<SurfaceControl.Transaction> surfaceControlTransactionSupplier, DisplayController displayController) { mContext = context; mSurfaceControlTransactionSupplier = surfaceControlTransactionSupplier; mDisplayId = displayId; mDecorationSurface = decorationSurface; Loading Loading @@ -180,7 +182,7 @@ class DragResizeInputListener implements AutoCloseable { mTouchRegion.setEmpty(); // Apply the geometry to the touch region. geometry.union(mTouchRegion); geometry.union(mContext, mTouchRegion); mInputEventReceiver.setGeometry(geometry); mInputEventReceiver.setTouchRegion(mTouchRegion); Loading Loading @@ -354,7 +356,7 @@ class DragResizeInputListener implements AutoCloseable { */ @NonNull Region getCornersRegion() { Region region = new Region(); mDragResizeWindowGeometry.union(region); mDragResizeWindowGeometry.union(mContext, region); return region; } Loading Loading @@ -395,7 +397,7 @@ class DragResizeInputListener implements AutoCloseable { // Touch events are tracked in four corners. Other events are tracked in resize edges. switch (e.getActionMasked()) { case MotionEvent.ACTION_DOWN: { mShouldHandleEvents = mDragResizeWindowGeometry.shouldHandleEvent(e, mShouldHandleEvents = mDragResizeWindowGeometry.shouldHandleEvent(mContext, e, new Point() /* offset */); if (mShouldHandleEvents) { // Save the id of the pointer for this drag interaction; we will use the Loading @@ -405,8 +407,9 @@ class DragResizeInputListener implements AutoCloseable { float y = e.getY(0); float rawX = e.getRawX(0); float rawY = e.getRawY(0); final int ctrlType = mDragResizeWindowGeometry.calculateCtrlType( isEventFromTouchscreen(e), isEdgeResizePermitted(e), x, y); final int ctrlType = mDragResizeWindowGeometry.calculateCtrlType(mContext, isEventFromTouchscreen(e), isEdgeResizePermitted(mContext, e), x, y); ProtoLog.d(WM_SHELL_DESKTOP_MODE, "%s: Handling action down, update ctrlType to %d", TAG, ctrlType); mDragStartTaskBounds = mCallback.onDragPositioningStart(ctrlType, Loading Loading @@ -496,7 +499,7 @@ class DragResizeInputListener implements AutoCloseable { // Since we are handling cursor, we know that this is not a touchscreen event, and // that edge resizing should always be allowed. @DragPositioningCallback.CtrlType int ctrlType = mDragResizeWindowGeometry.calculateCtrlType(/* isTouchscreen= */ mDragResizeWindowGeometry.calculateCtrlType(mContext, /* isTouchscreen= */ false, /* isEdgeResizePermitted= */ true, x, y); int cursorType = PointerIcon.TYPE_DEFAULT; Loading Loading @@ -537,7 +540,7 @@ class DragResizeInputListener implements AutoCloseable { } private boolean shouldHandleEvent(MotionEvent e, Point offset) { return mDragResizeWindowGeometry.shouldHandleEvent(e, offset); return mDragResizeWindowGeometry.shouldHandleEvent(mContext, e, offset); } } } Loading
libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/desktopmode/DesktopModeFlags.kt +3 −1 Original line number Diff line number Diff line Loading @@ -44,7 +44,9 @@ enum class DesktopModeFlags( TASK_STACK_OBSERVER_IN_SHELL(Flags::enableTaskStackObserverInShell, true), SIZE_CONSTRAINTS(Flags::enableDesktopWindowingSizeConstraints, true), DYNAMIC_INITIAL_BOUNDS(Flags::enableWindowingDynamicInitialBounds, true), ENABLE_DESKTOP_WINDOWING_TASK_LIMIT(Flags::enableDesktopWindowingTaskLimit, true); ENABLE_DESKTOP_WINDOWING_TASK_LIMIT(Flags::enableDesktopWindowingTaskLimit, true), BACK_NAVIGATION(Flags::enableDesktopWindowingBackNavigation, true), EDGE_DRAG_RESIZE(Flags::enableWindowingEdgeDragResize, true); /** * Determines state of flag based on the actual flag and desktop mode developer option overrides. Loading
libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt +3 −3 Original line number Diff line number Diff line Loading @@ -54,7 +54,6 @@ import com.android.internal.jank.Cuj.CUJ_DESKTOP_MODE_ENTER_APP_HANDLE_DRAG_RELE import com.android.internal.jank.InteractionJankMonitor import com.android.internal.policy.ScreenDecorationsUtils import com.android.internal.protolog.ProtoLog import com.android.window.flags.Flags import com.android.wm.shell.RootTaskDisplayAreaOrganizer import com.android.wm.shell.ShellTaskOrganizer import com.android.wm.shell.common.DisplayController Loading Loading @@ -982,7 +981,7 @@ class DesktopTasksController( } taskRepository.addClosingTask(task.displayId, task.taskId) // If a CLOSE or TO_BACK is triggered on a desktop task, remove the task. if (Flags.enableDesktopWindowingBackNavigation() && if (DesktopModeFlags.BACK_NAVIGATION.isEnabled(context) && taskRepository.isVisibleTask(task.taskId)) { wct.removeTask(task.token) } Loading Loading @@ -1488,7 +1487,8 @@ class DesktopTasksController( } override fun hideStashedDesktopApps(displayId: Int) { ProtoLog.w(WM_SHELL_DESKTOP_MODE, "IDesktopModeImpl: hideStashedDesktopApps is deprecated") ProtoLog.w(WM_SHELL_DESKTOP_MODE, "IDesktopModeImpl: hideStashedDesktopApps is deprecated") } override fun getVisibleTaskCount(displayId: Int): Int { Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/CaptionWindowDecoration.java +1 −1 Original line number Diff line number Diff line Loading @@ -279,7 +279,7 @@ public class CaptionWindowDecoration extends WindowDecoration<WindowDecorLinearL final Resources res = mResult.mRootView.getResources(); mDragResizeListener.setGeometry(new DragResizeWindowGeometry(0 /* taskCornerRadius */, new Size(mResult.mWidth, mResult.mHeight), getResizeEdgeHandleSize(res), new Size(mResult.mWidth, mResult.mHeight), getResizeEdgeHandleSize(mContext, res), getFineResizeCornerSize(res), getLargeResizeCornerSize(res)), touchSlop); } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java +3 −2 Original line number Diff line number Diff line Loading @@ -492,8 +492,9 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin final Resources res = mResult.mRootView.getResources(); if (mDragResizeListener.setGeometry( new DragResizeWindowGeometry(mRelayoutParams.mCornerRadius, new Size(mResult.mWidth, mResult.mHeight), getResizeEdgeHandleSize(res), getFineResizeCornerSize(res), getLargeResizeCornerSize(res)), touchSlop) new Size(mResult.mWidth, mResult.mHeight), getResizeEdgeHandleSize(mContext, res), getFineResizeCornerSize(res), getLargeResizeCornerSize(res)), touchSlop) || !mTaskInfo.positionInParent.equals(mPositionInParent)) { updateExclusionRegion(); } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DragResizeInputListener.java +10 −7 Original line number Diff line number Diff line Loading @@ -81,6 +81,7 @@ class DragResizeInputListener implements AutoCloseable { private final InputChannel mInputChannel; private final TaskResizeInputEventReceiver mInputEventReceiver; private final Context mContext; private final SurfaceControl mInputSinkSurface; private final IBinder mSinkClientToken; private final InputChannel mSinkInputChannel; Loading @@ -97,6 +98,7 @@ class DragResizeInputListener implements AutoCloseable { Supplier<SurfaceControl.Builder> surfaceControlBuilderSupplier, Supplier<SurfaceControl.Transaction> surfaceControlTransactionSupplier, DisplayController displayController) { mContext = context; mSurfaceControlTransactionSupplier = surfaceControlTransactionSupplier; mDisplayId = displayId; mDecorationSurface = decorationSurface; Loading Loading @@ -180,7 +182,7 @@ class DragResizeInputListener implements AutoCloseable { mTouchRegion.setEmpty(); // Apply the geometry to the touch region. geometry.union(mTouchRegion); geometry.union(mContext, mTouchRegion); mInputEventReceiver.setGeometry(geometry); mInputEventReceiver.setTouchRegion(mTouchRegion); Loading Loading @@ -354,7 +356,7 @@ class DragResizeInputListener implements AutoCloseable { */ @NonNull Region getCornersRegion() { Region region = new Region(); mDragResizeWindowGeometry.union(region); mDragResizeWindowGeometry.union(mContext, region); return region; } Loading Loading @@ -395,7 +397,7 @@ class DragResizeInputListener implements AutoCloseable { // Touch events are tracked in four corners. Other events are tracked in resize edges. switch (e.getActionMasked()) { case MotionEvent.ACTION_DOWN: { mShouldHandleEvents = mDragResizeWindowGeometry.shouldHandleEvent(e, mShouldHandleEvents = mDragResizeWindowGeometry.shouldHandleEvent(mContext, e, new Point() /* offset */); if (mShouldHandleEvents) { // Save the id of the pointer for this drag interaction; we will use the Loading @@ -405,8 +407,9 @@ class DragResizeInputListener implements AutoCloseable { float y = e.getY(0); float rawX = e.getRawX(0); float rawY = e.getRawY(0); final int ctrlType = mDragResizeWindowGeometry.calculateCtrlType( isEventFromTouchscreen(e), isEdgeResizePermitted(e), x, y); final int ctrlType = mDragResizeWindowGeometry.calculateCtrlType(mContext, isEventFromTouchscreen(e), isEdgeResizePermitted(mContext, e), x, y); ProtoLog.d(WM_SHELL_DESKTOP_MODE, "%s: Handling action down, update ctrlType to %d", TAG, ctrlType); mDragStartTaskBounds = mCallback.onDragPositioningStart(ctrlType, Loading Loading @@ -496,7 +499,7 @@ class DragResizeInputListener implements AutoCloseable { // Since we are handling cursor, we know that this is not a touchscreen event, and // that edge resizing should always be allowed. @DragPositioningCallback.CtrlType int ctrlType = mDragResizeWindowGeometry.calculateCtrlType(/* isTouchscreen= */ mDragResizeWindowGeometry.calculateCtrlType(mContext, /* isTouchscreen= */ false, /* isEdgeResizePermitted= */ true, x, y); int cursorType = PointerIcon.TYPE_DEFAULT; Loading Loading @@ -537,7 +540,7 @@ class DragResizeInputListener implements AutoCloseable { } private boolean shouldHandleEvent(MotionEvent e, Point offset) { return mDragResizeWindowGeometry.shouldHandleEvent(e, offset); return mDragResizeWindowGeometry.shouldHandleEvent(mContext, e, offset); } } }