Loading libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeVisualIndicator.java +6 −2 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import android.content.Context; import android.graphics.PointF; import android.graphics.Rect; import android.graphics.Region; import android.view.Display; import android.view.SurfaceControl; import android.window.DesktopModeFlags; Loading Loading @@ -114,6 +115,7 @@ public class DesktopModeVisualIndicator { private final Context mContext; private final DisplayController mDisplayController; private final ActivityManager.RunningTaskInfo mTaskInfo; private final Display mDisplay; private IndicatorType mCurrentType; private final DragStartState mDragStartState; Loading Loading @@ -145,9 +147,10 @@ public class DesktopModeVisualIndicator { mCurrentType = NO_INDICATOR; mDragStartState = dragStartState; mSnapEventHandler = snapEventHandler; mDisplay = mDisplayController.getDisplay(mTaskInfo.displayId); mVisualIndicatorViewContainer.createView( mContext, mDisplayController.getDisplay(mTaskInfo.displayId), mDisplay, mDisplayController.getDisplayLayout(mTaskInfo.displayId), mTaskInfo, taskSurface Loading Loading @@ -175,6 +178,7 @@ public class DesktopModeVisualIndicator { /** Start the fade-in animation. */ void fadeInIndicator() { if (mCurrentType == NO_INDICATOR) return; mVisualIndicatorViewContainer.fadeInIndicator( mDisplayController.getDisplayLayout(mTaskInfo.displayId), mCurrentType, mTaskInfo.displayId); Loading @@ -193,7 +197,7 @@ public class DesktopModeVisualIndicator { if (inputCoordinates.x > layout.width()) return TO_SPLIT_RIGHT_INDICATOR; IndicatorType result; if (BubbleAnythingFlagHelper.enableBubbleToFullscreen() && !DesktopModeStatus.canEnterDesktopMode(mContext)) { && !DesktopModeStatus.isDesktopModeSupportedOnDisplay(mContext, mDisplay)) { // If desktop is not available, default to "no indicator" result = NO_INDICATOR; } else { Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java +2 −1 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import static android.window.DesktopModeFlags.ENABLE_CAPTION_COMPAT_INSET_FORCE_ import static com.android.wm.shell.shared.desktopmode.DesktopModeStatus.canEnterDesktopMode; import static com.android.wm.shell.shared.desktopmode.DesktopModeStatus.canEnterDesktopModeOrShowAppHandle; import static com.android.wm.shell.shared.desktopmode.DesktopModeStatus.isDesktopModeSupportedOnDisplay; import static com.android.wm.shell.shared.desktopmode.DesktopModeTransitionSource.APP_HANDLE_MENU_BUTTON; import static com.android.wm.shell.shared.split.SplitScreenConstants.SPLIT_POSITION_BOTTOM_OR_RIGHT; import static com.android.wm.shell.windowdecor.DragPositioningCallbackUtility.DragEventListener; Loading Loading @@ -1410,7 +1411,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin supportsMultiInstance, shouldShowManageWindowsButton, shouldShowChangeAspectRatioButton, canEnterDesktopMode(mContext), isDesktopModeSupportedOnDisplay(mContext, mDisplay), isBrowserApp, isBrowserApp ? getAppLink() : getBrowserLink(), mResult.mCaptionWidth, Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopModeVisualIndicatorTest.kt +10 −9 Original line number Diff line number Diff line Loading @@ -24,7 +24,6 @@ import android.platform.test.annotations.DisableFlags import android.platform.test.annotations.EnableFlags import android.testing.AndroidTestingRunner import android.testing.TestableLooper.RunWithLooper import android.view.Display import android.view.SurfaceControl import androidx.test.filters.SmallTest import com.android.internal.policy.SystemBarUtils Loading Loading @@ -67,7 +66,6 @@ class DesktopModeVisualIndicatorTest : ShellTestCase() { private lateinit var taskInfo: RunningTaskInfo @Mock private lateinit var syncQueue: SyncTransactionQueue @Mock private lateinit var displayController: DisplayController @Mock private lateinit var display: Display @Mock private lateinit var taskSurface: SurfaceControl @Mock private lateinit var taskDisplayAreaOrganizer: RootTaskDisplayAreaOrganizer @Mock private lateinit var displayLayout: DisplayLayout Loading @@ -83,12 +81,20 @@ class DesktopModeVisualIndicatorTest : ShellTestCase() { whenever(displayLayout.width()).thenReturn(DISPLAY_BOUNDS.width()) whenever(displayLayout.height()).thenReturn(DISPLAY_BOUNDS.height()) whenever(displayLayout.stableInsets()).thenReturn(STABLE_INSETS) whenever(displayController.getDisplay(anyInt())).thenReturn(display) whenever(displayController.getDisplayLayout(anyInt())).thenReturn(displayLayout) whenever(displayController.getDisplay(anyInt())).thenReturn(mContext.display) whenever(bubbleBoundsProvider.getBubbleBarExpandedViewDropTargetBounds(any())) .thenReturn(Rect()) taskInfo = DesktopTestHelpers.createFullscreenTask() mContext.orCreateTestableResources.addOverride( com.android.internal.R.bool.config_isDesktopModeSupported, true, ) mContext.orCreateTestableResources.addOverride( com.android.internal.R.bool.config_canInternalDisplayHostDesktops, true, ) } @Test Loading Loading @@ -260,14 +266,9 @@ class DesktopModeVisualIndicatorTest : ShellTestCase() { ) fun testDefaultIndicatorWithNoDesktop() { mContext.orCreateTestableResources.addOverride( com.android.internal.R.bool.config_isDesktopModeSupported, com.android.internal.R.bool.config_canInternalDisplayHostDesktops, false, ) mContext.orCreateTestableResources.addOverride( com.android.internal.R.bool.config_isDesktopModeDevOptionSupported, false, ) // Fullscreen to center, no desktop indicator createVisualIndicator(DesktopModeVisualIndicator.DragStartState.FROM_FULLSCREEN) var result = visualIndicator.updateIndicatorType(PointF(500f, 500f)) Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeVisualIndicator.java +6 −2 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import android.content.Context; import android.graphics.PointF; import android.graphics.Rect; import android.graphics.Region; import android.view.Display; import android.view.SurfaceControl; import android.window.DesktopModeFlags; Loading Loading @@ -114,6 +115,7 @@ public class DesktopModeVisualIndicator { private final Context mContext; private final DisplayController mDisplayController; private final ActivityManager.RunningTaskInfo mTaskInfo; private final Display mDisplay; private IndicatorType mCurrentType; private final DragStartState mDragStartState; Loading Loading @@ -145,9 +147,10 @@ public class DesktopModeVisualIndicator { mCurrentType = NO_INDICATOR; mDragStartState = dragStartState; mSnapEventHandler = snapEventHandler; mDisplay = mDisplayController.getDisplay(mTaskInfo.displayId); mVisualIndicatorViewContainer.createView( mContext, mDisplayController.getDisplay(mTaskInfo.displayId), mDisplay, mDisplayController.getDisplayLayout(mTaskInfo.displayId), mTaskInfo, taskSurface Loading Loading @@ -175,6 +178,7 @@ public class DesktopModeVisualIndicator { /** Start the fade-in animation. */ void fadeInIndicator() { if (mCurrentType == NO_INDICATOR) return; mVisualIndicatorViewContainer.fadeInIndicator( mDisplayController.getDisplayLayout(mTaskInfo.displayId), mCurrentType, mTaskInfo.displayId); Loading @@ -193,7 +197,7 @@ public class DesktopModeVisualIndicator { if (inputCoordinates.x > layout.width()) return TO_SPLIT_RIGHT_INDICATOR; IndicatorType result; if (BubbleAnythingFlagHelper.enableBubbleToFullscreen() && !DesktopModeStatus.canEnterDesktopMode(mContext)) { && !DesktopModeStatus.isDesktopModeSupportedOnDisplay(mContext, mDisplay)) { // If desktop is not available, default to "no indicator" result = NO_INDICATOR; } else { Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java +2 −1 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import static android.window.DesktopModeFlags.ENABLE_CAPTION_COMPAT_INSET_FORCE_ import static com.android.wm.shell.shared.desktopmode.DesktopModeStatus.canEnterDesktopMode; import static com.android.wm.shell.shared.desktopmode.DesktopModeStatus.canEnterDesktopModeOrShowAppHandle; import static com.android.wm.shell.shared.desktopmode.DesktopModeStatus.isDesktopModeSupportedOnDisplay; import static com.android.wm.shell.shared.desktopmode.DesktopModeTransitionSource.APP_HANDLE_MENU_BUTTON; import static com.android.wm.shell.shared.split.SplitScreenConstants.SPLIT_POSITION_BOTTOM_OR_RIGHT; import static com.android.wm.shell.windowdecor.DragPositioningCallbackUtility.DragEventListener; Loading Loading @@ -1410,7 +1411,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin supportsMultiInstance, shouldShowManageWindowsButton, shouldShowChangeAspectRatioButton, canEnterDesktopMode(mContext), isDesktopModeSupportedOnDisplay(mContext, mDisplay), isBrowserApp, isBrowserApp ? getAppLink() : getBrowserLink(), mResult.mCaptionWidth, Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopModeVisualIndicatorTest.kt +10 −9 Original line number Diff line number Diff line Loading @@ -24,7 +24,6 @@ import android.platform.test.annotations.DisableFlags import android.platform.test.annotations.EnableFlags import android.testing.AndroidTestingRunner import android.testing.TestableLooper.RunWithLooper import android.view.Display import android.view.SurfaceControl import androidx.test.filters.SmallTest import com.android.internal.policy.SystemBarUtils Loading Loading @@ -67,7 +66,6 @@ class DesktopModeVisualIndicatorTest : ShellTestCase() { private lateinit var taskInfo: RunningTaskInfo @Mock private lateinit var syncQueue: SyncTransactionQueue @Mock private lateinit var displayController: DisplayController @Mock private lateinit var display: Display @Mock private lateinit var taskSurface: SurfaceControl @Mock private lateinit var taskDisplayAreaOrganizer: RootTaskDisplayAreaOrganizer @Mock private lateinit var displayLayout: DisplayLayout Loading @@ -83,12 +81,20 @@ class DesktopModeVisualIndicatorTest : ShellTestCase() { whenever(displayLayout.width()).thenReturn(DISPLAY_BOUNDS.width()) whenever(displayLayout.height()).thenReturn(DISPLAY_BOUNDS.height()) whenever(displayLayout.stableInsets()).thenReturn(STABLE_INSETS) whenever(displayController.getDisplay(anyInt())).thenReturn(display) whenever(displayController.getDisplayLayout(anyInt())).thenReturn(displayLayout) whenever(displayController.getDisplay(anyInt())).thenReturn(mContext.display) whenever(bubbleBoundsProvider.getBubbleBarExpandedViewDropTargetBounds(any())) .thenReturn(Rect()) taskInfo = DesktopTestHelpers.createFullscreenTask() mContext.orCreateTestableResources.addOverride( com.android.internal.R.bool.config_isDesktopModeSupported, true, ) mContext.orCreateTestableResources.addOverride( com.android.internal.R.bool.config_canInternalDisplayHostDesktops, true, ) } @Test Loading Loading @@ -260,14 +266,9 @@ class DesktopModeVisualIndicatorTest : ShellTestCase() { ) fun testDefaultIndicatorWithNoDesktop() { mContext.orCreateTestableResources.addOverride( com.android.internal.R.bool.config_isDesktopModeSupported, com.android.internal.R.bool.config_canInternalDisplayHostDesktops, false, ) mContext.orCreateTestableResources.addOverride( com.android.internal.R.bool.config_isDesktopModeDevOptionSupported, false, ) // Fullscreen to center, no desktop indicator createVisualIndicator(DesktopModeVisualIndicator.DragStartState.FROM_FULLSCREEN) var result = visualIndicator.updateIndicatorType(PointF(500f, 500f)) Loading