diff options
11 files changed, 113 insertions, 12 deletions
diff --git a/libs/WindowManager/Shell/res/drawable/desktop_mode_ic_handle_menu_restart.xml b/libs/WindowManager/Shell/res/drawable/desktop_mode_ic_handle_menu_restart.xml new file mode 100644 index 000000000000..d407884d3fcf --- /dev/null +++ b/libs/WindowManager/Shell/res/drawable/desktop_mode_ic_handle_menu_restart.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ Copyright (C) 2025 The Android Open Source Project + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + --> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="20dp" + android:height="20dp" + android:viewportWidth="24" + android:viewportHeight="24"> + <path + android:fillColor="#1C1C14" + android:pathData="M6,13c0,-1.65 0.67,-3.15 1.76,-4.24L6.34,7.34C4.9,8.79 4,10.79 4,13c0,4.08 3.05,7.44 7,7.93v-2.02C8.17,18.43 6,15.97 6,13z"/> + <path + android:fillColor="#1C1C14" + android:pathData="M20,13c0,-4.42 -3.58,-8 -8,-8c-0.06,0 -0.12,0.01 -0.18,0.01v0l1.09,-1.09L11.5,2.5L8,6l3.5,3.5l1.41,-1.41l-1.08,-1.08C11.89,7.01 11.95,7 12,7c3.31,0 6,2.69 6,6c0,2.97 -2.17,5.43 -5,5.91v2.02C16.95,20.44 20,17.08 20,13z"/> +</vector> diff --git a/libs/WindowManager/Shell/res/layout/desktop_mode_window_decor_handle_menu.xml b/libs/WindowManager/Shell/res/layout/desktop_mode_window_decor_handle_menu.xml index c33669636be4..30acf1ac6eda 100644 --- a/libs/WindowManager/Shell/res/layout/desktop_mode_window_decor_handle_menu.xml +++ b/libs/WindowManager/Shell/res/layout/desktop_mode_window_decor_handle_menu.xml @@ -163,6 +163,13 @@ android:text="@string/change_aspect_ratio_text" android:src="@drawable/desktop_mode_ic_handle_menu_change_aspect_ratio" style="@style/DesktopModeHandleMenuActionButton"/> + + <com.android.wm.shell.windowdecor.HandleMenuActionButton + android:id="@+id/handle_menu_restart_button" + android:contentDescription="@string/handle_menu_restart_text" + android:text="@string/handle_menu_restart_text" + android:src="@drawable/desktop_mode_ic_handle_menu_restart" + style="@style/DesktopModeHandleMenuActionButton"/> </LinearLayout> <LinearLayout diff --git a/libs/WindowManager/Shell/res/values/dimen.xml b/libs/WindowManager/Shell/res/values/dimen.xml index e68680219349..733f3bb8d6d0 100644 --- a/libs/WindowManager/Shell/res/values/dimen.xml +++ b/libs/WindowManager/Shell/res/values/dimen.xml @@ -534,10 +534,10 @@ pill elevation. --> <dimen name="desktop_mode_handle_menu_width">218dp</dimen> - <!-- The maximum height of the handle menu in desktop mode. Three pills at 52dp each plus - additional actions pill 208dp plus 2dp spacing between them plus 4dp top padding - plus 2dp bottom padding: 52*3 + 52*4 + (4-1)*2 + 4 + 2 = 376 --> - <dimen name="desktop_mode_handle_menu_height">376dp</dimen> + <!-- The maximum height of the handle menu in desktop mode. Three pills at 52dp each, + additional actions pill 260dp, plus 2dp spacing between them plus 4dp top padding. + 52*3 + 52*5 + (5-1)*2 + 4 = 428 --> + <dimen name="desktop_mode_handle_menu_height">428dp</dimen> <!-- The elevation set on the handle menu pills. --> <dimen name="desktop_mode_handle_menu_pill_elevation">1dp</dimen> @@ -566,6 +566,9 @@ <!-- The height of the handle menu's "Change aspect ratio" pill in desktop mode. --> <dimen name="desktop_mode_handle_menu_change_aspect_ratio_height">52dp</dimen> + <!-- The height of the handle menu's "Optimize View" pill in desktop mode. --> + <dimen name="desktop_mode_handle_menu_restart_button_height">52dp</dimen> + <!-- The margin between pills of the handle menu in desktop mode. --> <dimen name="desktop_mode_handle_menu_pill_spacing_margin">2dp</dimen> diff --git a/libs/WindowManager/Shell/res/values/strings.xml b/libs/WindowManager/Shell/res/values/strings.xml index 5ef83826840b..1fd4704f7814 100644 --- a/libs/WindowManager/Shell/res/values/strings.xml +++ b/libs/WindowManager/Shell/res/values/strings.xml @@ -314,6 +314,8 @@ <string name="manage_windows_text">Manage Windows</string> <!-- Accessibility text for the handle menu change aspect ratio button [CHAR LIMIT=NONE] --> <string name="change_aspect_ratio_text">Change aspect ratio</string> + <!-- Accessibility text for the handle menu restart button [CHAR LIMIT=NONE] --> + <string name="handle_menu_restart_text">Optimize View</string> <!-- Accessibility text for the handle menu close button [CHAR LIMIT=NONE] --> <string name="close_text">Close</string> <!-- Accessibility text for the handle menu close menu button [CHAR LIMIT=NONE] --> diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellModule.java b/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellModule.java index 613e78753b66..0edab006cb66 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellModule.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellModule.java @@ -79,6 +79,7 @@ import com.android.wm.shell.common.SyncTransactionQueue; import com.android.wm.shell.common.TaskStackListenerImpl; import com.android.wm.shell.common.UserProfileContexts; import com.android.wm.shell.common.split.SplitState; +import com.android.wm.shell.compatui.api.CompatUIHandler; import com.android.wm.shell.compatui.letterbox.LetterboxCommandHandler; import com.android.wm.shell.compatui.letterbox.LetterboxTransitionObserver; import com.android.wm.shell.crashhandling.ShellCrashHandler; @@ -1044,7 +1045,8 @@ public abstract class WMShellModule { RecentsTransitionHandler recentsTransitionHandler, DesktopModeCompatPolicy desktopModeCompatPolicy, DesktopTilingDecorViewModel desktopTilingDecorViewModel, - MultiDisplayDragMoveIndicatorController multiDisplayDragMoveIndicatorController + MultiDisplayDragMoveIndicatorController multiDisplayDragMoveIndicatorController, + Optional<CompatUIHandler> compatUI ) { if (!DesktopModeStatus.canEnterDesktopModeOrShowAppHandle(context)) { return Optional.empty(); @@ -1062,7 +1064,7 @@ public abstract class WMShellModule { activityOrientationChangeHandler, focusTransitionObserver, desktopModeEventLogger, desktopModeUiEventLogger, taskResourceLoader, recentsTransitionHandler, desktopModeCompatPolicy, desktopTilingDecorViewModel, - multiDisplayDragMoveIndicatorController)); + multiDisplayDragMoveIndicatorController, compatUI.orElse(null))); } @WMSingleton diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java index 800faca830f4..07b385bdb045 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java @@ -108,6 +108,8 @@ import com.android.wm.shell.common.MultiInstanceHelper; import com.android.wm.shell.common.ShellExecutor; import com.android.wm.shell.common.SyncTransactionQueue; import com.android.wm.shell.compatui.CompatUIController; +import com.android.wm.shell.compatui.api.CompatUIHandler; +import com.android.wm.shell.compatui.impl.CompatUIRequests; import com.android.wm.shell.desktopmode.DesktopActivityOrientationChangeHandler; import com.android.wm.shell.desktopmode.DesktopImmersiveController; import com.android.wm.shell.desktopmode.DesktopModeEventLogger; @@ -266,6 +268,7 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, private final DesktopTilingDecorViewModel mDesktopTilingDecorViewModel; private final MultiDisplayDragMoveIndicatorController mMultiDisplayDragMoveIndicatorController; private final LatencyTracker mLatencyTracker; + private final CompatUIHandler mCompatUI; public DesktopModeWindowDecorViewModel( Context context, @@ -306,7 +309,8 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, RecentsTransitionHandler recentsTransitionHandler, DesktopModeCompatPolicy desktopModeCompatPolicy, DesktopTilingDecorViewModel desktopTilingDecorViewModel, - MultiDisplayDragMoveIndicatorController multiDisplayDragMoveIndicatorController) { + MultiDisplayDragMoveIndicatorController multiDisplayDragMoveIndicatorController, + CompatUIHandler compatUI) { this( context, shellExecutor, @@ -353,7 +357,8 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, recentsTransitionHandler, desktopModeCompatPolicy, desktopTilingDecorViewModel, - multiDisplayDragMoveIndicatorController); + multiDisplayDragMoveIndicatorController, + compatUI); } @VisibleForTesting @@ -403,7 +408,8 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, RecentsTransitionHandler recentsTransitionHandler, DesktopModeCompatPolicy desktopModeCompatPolicy, DesktopTilingDecorViewModel desktopTilingDecorViewModel, - MultiDisplayDragMoveIndicatorController multiDisplayDragMoveIndicatorController) { + MultiDisplayDragMoveIndicatorController multiDisplayDragMoveIndicatorController, + CompatUIHandler compatUI) { mContext = context; mMainExecutor = shellExecutor; mMainHandler = mainHandler; @@ -444,6 +450,7 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, mActivityOrientationChangeHandler = activityOrientationChangeHandler; mAssistContentRequester = assistContentRequester; mWindowDecorViewHostSupplier = windowDecorViewHostSupplier; + mCompatUI = compatUI; mOnDisplayChangingListener = (displayId, fromRotation, toRotation, displayAreaInfo, t) -> { DesktopModeWindowDecoration decoration; RunningTaskInfo taskInfo; @@ -1864,6 +1871,11 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, CompatUIController.launchUserAspectRatioSettings(mContext, taskInfo); return Unit.INSTANCE; }); + windowDecoration.setOnRestartClickListener(() -> { + mCompatUI.sendCompatUIRequest(new CompatUIRequests.DisplayCompatShowRestartDialog( + taskInfo.taskId)); + return Unit.INSTANCE; + }); windowDecoration.setOnMaximizeHoverListener(() -> { if (!windowDecoration.isMaximizeMenuActive()) { mDesktopModeUiEventLogger.log(taskInfo, diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java index ae103895d56b..49c380a1a736 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java @@ -163,6 +163,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin private Function0<Unit> mOnNewWindowClickListener; private Function0<Unit> mOnManageWindowsClickListener; private Function0<Unit> mOnChangeAspectRatioClickListener; + private Function0<Unit> mOnRestartClickListener; private Function0<Unit> mOnMaximizeHoverListener; private DragPositioningCallback mDragPositioningCallback; private DragResizeInputListener mDragResizeListener; @@ -408,6 +409,11 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin mOnChangeAspectRatioClickListener = listener; } + /** Registers a listener to be called when the aspect ratio action is triggered. */ + void setOnRestartClickListener(Function0<Unit> listener) { + mOnRestartClickListener = listener; + } + /** Registers a listener to be called when the maximize header button is hovered. */ void setOnMaximizeHoverListener(Function0<Unit> listener) { mOnMaximizeHoverListener = listener; @@ -1461,6 +1467,8 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin && mMinimumInstancesFound; final boolean shouldShowChangeAspectRatioButton = HandleMenu.Companion .shouldShowChangeAspectRatioButton(mTaskInfo); + final boolean shouldShowRestartButton = HandleMenu.Companion + .shouldShowRestartButton(mTaskInfo); final boolean inDesktopImmersive = mDesktopUserRepositories.getProfile(mTaskInfo.userId) .isTaskInFullImmersiveState(mTaskInfo.taskId); final boolean isBrowserApp = isBrowserApp(); @@ -1477,6 +1485,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin shouldShowManageWindowsButton, shouldShowChangeAspectRatioButton, isDesktopModeSupportedOnDisplay(mContext, mDisplay), + shouldShowRestartButton, isBrowserApp, isBrowserApp ? getAppLink() : getBrowserLink(), mResult.mCaptionWidth, @@ -1513,6 +1522,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin } return Unit.INSTANCE; }, + /* onRestartClickListener= */ mOnRestartClickListener, /* onCloseMenuClickListener= */ () -> { closeHandleMenu(); return Unit.INSTANCE; diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/HandleMenu.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/HandleMenu.kt index 5f13ba907831..f64b0d8695d2 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/HandleMenu.kt +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/HandleMenu.kt @@ -94,6 +94,7 @@ class HandleMenu( private val shouldShowManageWindowsButton: Boolean, private val shouldShowChangeAspectRatioButton: Boolean, private val shouldShowDesktopModeButton: Boolean, + private val shouldShowRestartButton: Boolean, private val isBrowserApp: Boolean, private val openInAppOrBrowserIntent: Intent?, private val captionWidth: Int, @@ -138,7 +139,8 @@ class HandleMenu( private val shouldShowMoreActionsPill: Boolean get() = SHOULD_SHOW_SCREENSHOT_BUTTON || shouldShowNewWindowButton || - shouldShowManageWindowsButton || shouldShowChangeAspectRatioButton + shouldShowManageWindowsButton || shouldShowChangeAspectRatioButton || + shouldShowRestartButton private var loadAppInfoJob: Job? = null @@ -156,6 +158,7 @@ class HandleMenu( onChangeAspectRatioClickListener: () -> Unit, openInAppOrBrowserClickListener: (Intent) -> Unit, onOpenByDefaultClickListener: () -> Unit, + onRestartClickListener: () -> Unit, onCloseMenuClickListener: () -> Unit, onOutsideTouchListener: () -> Unit, forceShowSystemBars: Boolean = false, @@ -175,6 +178,7 @@ class HandleMenu( onChangeAspectRatioClickListener = onChangeAspectRatioClickListener, openInAppOrBrowserClickListener = openInAppOrBrowserClickListener, onOpenByDefaultClickListener = onOpenByDefaultClickListener, + onRestartClickListener = onRestartClickListener, onCloseMenuClickListener = onCloseMenuClickListener, onOutsideTouchListener = onOutsideTouchListener, forceShowSystemBars = forceShowSystemBars, @@ -197,6 +201,7 @@ class HandleMenu( onChangeAspectRatioClickListener: () -> Unit, openInAppOrBrowserClickListener: (Intent) -> Unit, onOpenByDefaultClickListener: () -> Unit, + onRestartClickListener: () -> Unit, onCloseMenuClickListener: () -> Unit, onOutsideTouchListener: () -> Unit, forceShowSystemBars: Boolean = false, @@ -211,6 +216,7 @@ class HandleMenu( shouldShowManageWindowsButton = shouldShowManageWindowsButton, shouldShowChangeAspectRatioButton = shouldShowChangeAspectRatioButton, shouldShowDesktopModeButton = shouldShowDesktopModeButton, + shouldShowRestartButton = shouldShowRestartButton, isBrowserApp = isBrowserApp ).apply { bind(taskInfo, shouldShowMoreActionsPill) @@ -224,6 +230,7 @@ class HandleMenu( this.onOpenInAppOrBrowserClickListener = { openInAppOrBrowserClickListener.invoke(openInAppOrBrowserIntent!!) } + this.onRestartClickListener = onRestartClickListener this.onOpenByDefaultClickListener = onOpenByDefaultClickListener this.onCloseMenuClickListener = onCloseMenuClickListener this.onOutsideTouchListener = onOutsideTouchListener @@ -430,6 +437,10 @@ class HandleMenu( R.dimen.desktop_mode_handle_menu_change_aspect_ratio_height ) } + if (!shouldShowRestartButton) { + menuHeight -= loadDimensionPixelSize( + R.dimen.desktop_mode_handle_menu_restart_button_height) + } if (!shouldShowMoreActionsPill) { menuHeight -= pillTopMargin } @@ -472,6 +483,7 @@ class HandleMenu( private val shouldShowManageWindowsButton: Boolean, private val shouldShowChangeAspectRatioButton: Boolean, private val shouldShowDesktopModeButton: Boolean, + private val shouldShowRestartButton: Boolean, private val isBrowserApp: Boolean ) { val rootView = LayoutInflater.from(context) @@ -549,6 +561,8 @@ class HandleMenu( .requireViewById<HandleMenuActionButton>(R.id.manage_windows_button) private val changeAspectRatioBtn = moreActionsPill .requireViewById<HandleMenuActionButton>(R.id.change_aspect_ratio_button) + private val restartBtn = moreActionsPill + .requireViewById<HandleMenuActionButton>(R.id.handle_menu_restart_button) // Open in Browser/App Pill. private val openInAppOrBrowserPill = rootView.requireViewById<View>( @@ -574,6 +588,7 @@ class HandleMenu( var onChangeAspectRatioClickListener: (() -> Unit)? = null var onOpenInAppOrBrowserClickListener: (() -> Unit)? = null var onOpenByDefaultClickListener: (() -> Unit)? = null + var onRestartClickListener: (() -> Unit)? = null var onCloseMenuClickListener: (() -> Unit)? = null var onOutsideTouchListener: (() -> Unit)? = null @@ -590,6 +605,7 @@ class HandleMenu( newWindowBtn.setOnClickListener { onNewWindowClickListener?.invoke() } manageWindowBtn.setOnClickListener { onManageWindowsClickListener?.invoke() } changeAspectRatioBtn.setOnClickListener { onChangeAspectRatioClickListener?.invoke() } + restartBtn.setOnClickListener { onRestartClickListener?.invoke() } rootView.setOnTouchListener { _, event -> if (event.actionMasked == ACTION_OUTSIDE) { @@ -808,6 +824,7 @@ class HandleMenu( newWindowBtn to shouldShowNewWindowButton, manageWindowBtn to shouldShowManageWindowsButton, changeAspectRatioBtn to shouldShowChangeAspectRatioButton, + restartBtn to shouldShowRestartButton, ).forEach { (button, shouldShow) -> button.apply { isGone = !shouldShow @@ -872,6 +889,13 @@ class HandleMenu( fun shouldShowChangeAspectRatioButton(taskInfo: RunningTaskInfo): Boolean = taskInfo.appCompatTaskInfo.eligibleForUserAspectRatioButton() && taskInfo.windowingMode == WindowConfiguration.WINDOWING_MODE_FULLSCREEN + + /** + * Returns whether the restart button should be shown for the task. It usually means that + * the task has moved to a different display. + */ + fun shouldShowRestartButton(taskInfo: RunningTaskInfo): Boolean = + taskInfo.appCompatTaskInfo.isRestartMenuEnabledForDisplayMove } } @@ -890,6 +914,7 @@ interface HandleMenuFactory { shouldShowManageWindowsButton: Boolean, shouldShowChangeAspectRatioButton: Boolean, shouldShowDesktopModeButton: Boolean, + shouldShowRestartButton: Boolean, isBrowserApp: Boolean, openInAppOrBrowserIntent: Intent?, captionWidth: Int, @@ -914,6 +939,7 @@ object DefaultHandleMenuFactory : HandleMenuFactory { shouldShowManageWindowsButton: Boolean, shouldShowChangeAspectRatioButton: Boolean, shouldShowDesktopModeButton: Boolean, + shouldShowRestartButton: Boolean, isBrowserApp: Boolean, openInAppOrBrowserIntent: Intent?, captionWidth: Int, @@ -934,6 +960,7 @@ object DefaultHandleMenuFactory : HandleMenuFactory { shouldShowManageWindowsButton, shouldShowChangeAspectRatioButton, shouldShowDesktopModeButton, + shouldShowRestartButton, isBrowserApp, openInAppOrBrowserIntent, captionWidth, diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModelTestsBase.kt b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModelTestsBase.kt index 4c9c2f14d805..ed69d912c4ef 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModelTestsBase.kt +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModelTestsBase.kt @@ -55,6 +55,7 @@ import com.android.wm.shell.common.DisplayLayout import com.android.wm.shell.common.MultiDisplayDragMoveIndicatorController import com.android.wm.shell.common.MultiInstanceHelper import com.android.wm.shell.common.SyncTransactionQueue +import com.android.wm.shell.compatui.api.CompatUIHandler import com.android.wm.shell.desktopmode.DesktopActivityOrientationChangeHandler import com.android.wm.shell.desktopmode.DesktopImmersiveController import com.android.wm.shell.desktopmode.DesktopModeEventLogger @@ -144,6 +145,7 @@ open class DesktopModeWindowDecorViewModelTestsBase : ShellTestCase() { mock<DesktopActivityOrientationChangeHandler>() protected val mockMultiDisplayDragMoveIndicatorController = mock<MultiDisplayDragMoveIndicatorController>() + protected val mockCompatUIHandler = mock<CompatUIHandler>() protected val mockInputManager = mock<InputManager>() private val mockTaskPositionerFactory = mock<DesktopModeWindowDecorViewModel.TaskPositionerFactory>() @@ -243,6 +245,7 @@ open class DesktopModeWindowDecorViewModelTestsBase : ShellTestCase() { desktopModeCompatPolicy, mockTilingWindowDecoration, mockMultiDisplayDragMoveIndicatorController, + mockCompatUIHandler, ) desktopModeWindowDecorViewModel.setSplitScreenController(mockSplitScreenController) whenever(mockDisplayController.getDisplayLayout(any())).thenReturn(mockDisplayLayout) diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorationTests.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorationTests.java index dd777a5ed270..77513adf0088 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorationTests.java +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorationTests.java @@ -303,7 +303,7 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase { doReturn(mInsetsState).when(mMockDisplayController).getInsetsState(anyInt()); when(mMockHandleMenuFactory.create(any(), any(), any(), any(), any(), anyInt(), any(), anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean(), - any(), anyInt(), anyInt(), anyInt(), anyInt())) + anyBoolean(), any(), anyInt(), anyInt(), anyInt(), anyInt())) .thenReturn(mMockHandleMenu); when(mMockMultiInstanceHelper.supportsMultiInstanceSplit(any(), anyInt())) .thenReturn(false); @@ -1450,6 +1450,7 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase { any(), any(), any(), + any(), anyBoolean() ); // Run runnable to set captured link to used @@ -1487,6 +1488,7 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase { any(), any(), any(), + any(), anyBoolean() ); openInBrowserCaptor.getValue().invoke(new Intent(Intent.ACTION_MAIN, TEST_URI1)); @@ -1519,6 +1521,7 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase { any(), any(), any(), + any(), anyBoolean() ); @@ -1584,6 +1587,7 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase { any(), any(), any(), + any(), closeClickListener.capture(), any(), anyBoolean() @@ -1617,6 +1621,7 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase { any(), any(), any(), + any(), /* forceShowSystemBars= */ eq(true) ); } @@ -1790,7 +1795,7 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase { private void verifyHandleMenuCreated(@Nullable Uri uri) { verify(mMockHandleMenuFactory).create(any(), any(), any(), any(), any(), anyInt(), any(), anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean(), - anyBoolean(), argThat(intent -> + anyBoolean(), anyBoolean(), argThat(intent -> (uri == null && intent == null) || intent.getData().equals(uri)), anyInt(), anyInt(), anyInt(), anyInt()); } diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/HandleMenuTest.kt b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/HandleMenuTest.kt index 2e46f6312d03..e4b897264883 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/HandleMenuTest.kt +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/HandleMenuTest.kt @@ -287,6 +287,7 @@ class HandleMenuTest : ShellTestCase() { shouldShowManageWindowsButton = false, shouldShowChangeAspectRatioButton = false, shouldShowDesktopModeButton = true, + shouldShowRestartButton = true, isBrowserApp = false, null /* openInAppOrBrowserIntent */, captionWidth = HANDLE_WIDTH, @@ -304,6 +305,7 @@ class HandleMenuTest : ShellTestCase() { onChangeAspectRatioClickListener = mock(), openInAppOrBrowserClickListener = mock(), onOpenByDefaultClickListener = mock(), + onRestartClickListener = mock(), onCloseMenuClickListener = mock(), onOutsideTouchListener = mock(), forceShowSystemBars = forceShowSystemBars |