Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java +15 −8 Original line number Diff line number Diff line Loading @@ -1215,7 +1215,7 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, if (id == R.id.caption_handle) { handleCaptionThroughStatusBar(e, decoration); final boolean wasDragging = mIsDragging; updateDragStatus(e.getActionMasked()); updateDragStatus(decoration, e); final boolean upOrCancel = e.getActionMasked() == ACTION_UP || e.getActionMasked() == ACTION_CANCEL; if (wasDragging && upOrCancel) { Loading @@ -1231,6 +1231,13 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, return false; } private void setIsDragging( @Nullable DesktopModeWindowDecoration decor, boolean isDragging) { mIsDragging = isDragging; if (decor == null) return; decor.setIsDragging(isDragging); } private boolean handleFreeformMotionEvent(DesktopModeWindowDecoration decoration, RunningTaskInfo taskInfo, View v, MotionEvent e) { final int id = v.getId(); Loading @@ -1250,7 +1257,7 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, final Rect initialBounds = mDragPositioningCallback.onDragPositioningStart( 0 /* ctrlType */, e.getDisplayId(), e.getRawX(0), e.getRawY(0)); updateDragStatus(e.getActionMasked()); updateDragStatus(decoration, e); mOnDragStartInitialBounds.set(initialBounds); } // Do not consume input event if a button is touched, otherwise it would Loading @@ -1277,7 +1284,7 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, newTaskBounds); // Flip mIsDragging only if the bounds actually changed. if (mIsDragging || !newTaskBounds.equals(mOnDragStartInitialBounds)) { updateDragStatus(e.getActionMasked()); updateDragStatus(decoration, e); } return true; } Loading Loading @@ -1310,7 +1317,7 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, // onClick call that results. return false; } else { updateDragStatus(e.getActionMasked()); updateDragStatus(decoration, e); return true; } } Loading @@ -1318,16 +1325,16 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, return true; } private void updateDragStatus(int eventAction) { switch (eventAction) { private void updateDragStatus(DesktopModeWindowDecoration decor, MotionEvent e) { switch (e.getActionMasked()) { case MotionEvent.ACTION_DOWN: case MotionEvent.ACTION_UP: case MotionEvent.ACTION_CANCEL: { mIsDragging = false; setIsDragging(decor, false /* isDragging */); break; } case MotionEvent.ACTION_MOVE: { mIsDragging = true; setIsDragging(decor, true /* isDragging */); break; } } Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java +16 −4 Original line number Diff line number Diff line Loading @@ -207,7 +207,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin private final WindowDecorCaptionHandleRepository mWindowDecorCaptionHandleRepository; private final DesktopUserRepositories mDesktopUserRepositories; private boolean mIsRecentsTransitionRunning = false; private boolean mIsDragging = false; private Runnable mLoadAppInfoRunnable; private Runnable mSetAppInfoRunnable; Loading Loading @@ -513,7 +513,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin updateRelayoutParams(mRelayoutParams, mContext, taskInfo, mSplitScreenController, applyStartTransactionOnDraw, shouldSetTaskVisibilityPositionAndCrop, mIsStatusBarVisible, mIsKeyguardVisibleAndOccluded, inFullImmersive, mDisplayController.getInsetsState(taskInfo.displayId), hasGlobalFocus, mIsDragging, mDisplayController.getInsetsState(taskInfo.displayId), hasGlobalFocus, displayExclusionRegion, mIsRecentsTransitionRunning, mDesktopModeCompatPolicy.shouldExcludeCaptionFromAppBounds(taskInfo)); Loading Loading @@ -911,6 +911,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin boolean isStatusBarVisible, boolean isKeyguardVisibleAndOccluded, boolean inFullImmersiveMode, boolean isDragging, @NonNull InsetsState displayInsetsState, boolean hasGlobalFocus, @NonNull Region displayExclusionRegion, Loading @@ -933,9 +934,13 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin relayoutParams.mAsyncViewHost = isAppHandle; final boolean showCaption; if (DesktopModeFlags.ENABLE_FULLY_IMMERSIVE_IN_DESKTOP.isTrue()) { if (DesktopModeFlags.ENABLE_DESKTOP_IMMERSIVE_DRAG_BUGFIX.isTrue() && isDragging) { // If the task is being dragged, the caption should not be hidden so that it continues // receiving input showCaption = true; } else if (DesktopModeFlags.ENABLE_FULLY_IMMERSIVE_IN_DESKTOP.isTrue()) { if (inFullImmersiveMode) { showCaption = isStatusBarVisible && !isKeyguardVisibleAndOccluded; showCaption = (isStatusBarVisible && !isKeyguardVisibleAndOccluded); } else { showCaption = taskInfo.isFreeform() || (isStatusBarVisible && !isKeyguardVisibleAndOccluded); Loading Loading @@ -1798,6 +1803,13 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin mIsRecentsTransitionRunning = isRecentsTransitionRunning; } /** * Declares whether the window decoration is being dragged. */ void setIsDragging(boolean isDragging) { mIsDragging = isDragging; } /** * Called when there is a {@link MotionEvent#ACTION_HOVER_EXIT} on the maximize window button. */ Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorationTests.java +41 −0 Original line number Diff line number Diff line Loading @@ -167,6 +167,7 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase { private static final boolean DEFAULT_IS_STATUSBAR_VISIBLE = true; private static final boolean DEFAULT_IS_KEYGUARD_VISIBLE_AND_OCCLUDED = false; private static final boolean DEFAULT_IS_IN_FULL_IMMERSIVE_MODE = false; private static final boolean DEFAULT_IS_DRAGGING = false; private static final boolean DEFAULT_HAS_GLOBAL_FOCUS = true; private static final boolean DEFAULT_SHOULD_IGNORE_CORNER_RADIUS = false; private static final boolean DEFAULT_SHOULD_EXCLUDE_CAPTION_FROM_APP_BOUNDS = false; Loading Loading @@ -415,6 +416,7 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase { DEFAULT_IS_STATUSBAR_VISIBLE, DEFAULT_IS_KEYGUARD_VISIBLE_AND_OCCLUDED, DEFAULT_IS_IN_FULL_IMMERSIVE_MODE, DEFAULT_IS_DRAGGING, new InsetsState(), DEFAULT_HAS_GLOBAL_FOCUS, mExclusionRegion, Loading Loading @@ -616,6 +618,7 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase { DEFAULT_IS_STATUSBAR_VISIBLE, DEFAULT_IS_KEYGUARD_VISIBLE_AND_OCCLUDED, DEFAULT_IS_IN_FULL_IMMERSIVE_MODE, DEFAULT_IS_DRAGGING, new InsetsState(), DEFAULT_HAS_GLOBAL_FOCUS, mExclusionRegion, Loading Loading @@ -650,6 +653,7 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase { DEFAULT_IS_STATUSBAR_VISIBLE, DEFAULT_IS_KEYGUARD_VISIBLE_AND_OCCLUDED, DEFAULT_IS_IN_FULL_IMMERSIVE_MODE, DEFAULT_IS_DRAGGING, new InsetsState(), DEFAULT_HAS_GLOBAL_FOCUS, mExclusionRegion, Loading Loading @@ -728,6 +732,7 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase { DEFAULT_IS_STATUSBAR_VISIBLE, DEFAULT_IS_KEYGUARD_VISIBLE_AND_OCCLUDED, /* inFullImmersiveMode */ true, DEFAULT_IS_DRAGGING, insetsState, DEFAULT_HAS_GLOBAL_FOCUS, mExclusionRegion, Loading Loading @@ -755,6 +760,7 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase { DEFAULT_IS_STATUSBAR_VISIBLE, DEFAULT_IS_KEYGUARD_VISIBLE_AND_OCCLUDED, /* inFullImmersiveMode */ true, DEFAULT_IS_DRAGGING, new InsetsState(), DEFAULT_HAS_GLOBAL_FOCUS, mExclusionRegion, Loading @@ -781,6 +787,7 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase { /* isStatusBarVisible */ false, DEFAULT_IS_KEYGUARD_VISIBLE_AND_OCCLUDED, DEFAULT_IS_IN_FULL_IMMERSIVE_MODE, DEFAULT_IS_DRAGGING, new InsetsState(), DEFAULT_HAS_GLOBAL_FOCUS, mExclusionRegion, Loading @@ -807,6 +814,7 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase { /* isStatusBarVisible */ true, /* isKeyguardVisibleAndOccluded */ false, DEFAULT_IS_IN_FULL_IMMERSIVE_MODE, DEFAULT_IS_DRAGGING, new InsetsState(), DEFAULT_HAS_GLOBAL_FOCUS, mExclusionRegion, Loading @@ -832,6 +840,7 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase { /* isStatusBarVisible */ false, DEFAULT_IS_KEYGUARD_VISIBLE_AND_OCCLUDED, DEFAULT_IS_IN_FULL_IMMERSIVE_MODE, DEFAULT_IS_DRAGGING, new InsetsState(), DEFAULT_HAS_GLOBAL_FOCUS, mExclusionRegion, Loading @@ -857,6 +866,7 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase { DEFAULT_IS_STATUSBAR_VISIBLE, /* isKeyguardVisibleAndOccluded */ true, DEFAULT_IS_IN_FULL_IMMERSIVE_MODE, DEFAULT_IS_DRAGGING, new InsetsState(), DEFAULT_HAS_GLOBAL_FOCUS, mExclusionRegion, Loading @@ -883,6 +893,7 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase { /* isStatusBarVisible */ true, DEFAULT_IS_KEYGUARD_VISIBLE_AND_OCCLUDED, /* inFullImmersiveMode */ true, DEFAULT_IS_DRAGGING, new InsetsState(), DEFAULT_HAS_GLOBAL_FOCUS, mExclusionRegion, Loading @@ -901,6 +912,7 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase { /* isStatusBarVisible */ false, DEFAULT_IS_KEYGUARD_VISIBLE_AND_OCCLUDED, /* inFullImmersiveMode */ true, DEFAULT_IS_DRAGGING, new InsetsState(), DEFAULT_HAS_GLOBAL_FOCUS, mExclusionRegion, Loading @@ -910,6 +922,33 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase { assertThat(relayoutParams.mIsCaptionVisible).isFalse(); } @Test @EnableFlags(Flags.FLAG_ENABLE_DESKTOP_IMMERSIVE_DRAG_BUGFIX) public void updateRelayoutParams_header_fullyImmersive_captionVisDuringDrag() { final ActivityManager.RunningTaskInfo taskInfo = createTaskInfo(/* visible= */ true); taskInfo.configuration.windowConfiguration.setWindowingMode(WINDOWING_MODE_FULLSCREEN); final RelayoutParams relayoutParams = new RelayoutParams(); DesktopModeWindowDecoration.updateRelayoutParams( relayoutParams, mTestableContext, taskInfo, mMockSplitScreenController, DEFAULT_APPLY_START_TRANSACTION_ON_DRAW, DEFAULT_SHOULD_SET_TASK_POSITIONING_AND_CROP, /* isStatusBarVisible */ false, DEFAULT_IS_KEYGUARD_VISIBLE_AND_OCCLUDED, /* inFullImmersiveMode */ true, /* isDragging */ true, new InsetsState(), DEFAULT_HAS_GLOBAL_FOCUS, mExclusionRegion, DEFAULT_SHOULD_IGNORE_CORNER_RADIUS, DEFAULT_SHOULD_EXCLUDE_CAPTION_FROM_APP_BOUNDS); assertThat(relayoutParams.mIsCaptionVisible).isTrue(); } @Test @EnableFlags(Flags.FLAG_ENABLE_FULLY_IMMERSIVE_IN_DESKTOP) public void updateRelayoutParams_header_fullyImmersive_overKeyguard_captionNotVisible() { Loading @@ -927,6 +966,7 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase { DEFAULT_IS_STATUSBAR_VISIBLE, /* isKeyguardVisibleAndOccluded */ true, /* inFullImmersiveMode */ true, DEFAULT_IS_DRAGGING, new InsetsState(), DEFAULT_HAS_GLOBAL_FOCUS, mExclusionRegion, Loading Loading @@ -1588,6 +1628,7 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase { DEFAULT_IS_STATUSBAR_VISIBLE, DEFAULT_IS_KEYGUARD_VISIBLE_AND_OCCLUDED, DEFAULT_IS_IN_FULL_IMMERSIVE_MODE, DEFAULT_IS_DRAGGING, new InsetsState(), DEFAULT_HAS_GLOBAL_FOCUS, mExclusionRegion, Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java +15 −8 Original line number Diff line number Diff line Loading @@ -1215,7 +1215,7 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, if (id == R.id.caption_handle) { handleCaptionThroughStatusBar(e, decoration); final boolean wasDragging = mIsDragging; updateDragStatus(e.getActionMasked()); updateDragStatus(decoration, e); final boolean upOrCancel = e.getActionMasked() == ACTION_UP || e.getActionMasked() == ACTION_CANCEL; if (wasDragging && upOrCancel) { Loading @@ -1231,6 +1231,13 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, return false; } private void setIsDragging( @Nullable DesktopModeWindowDecoration decor, boolean isDragging) { mIsDragging = isDragging; if (decor == null) return; decor.setIsDragging(isDragging); } private boolean handleFreeformMotionEvent(DesktopModeWindowDecoration decoration, RunningTaskInfo taskInfo, View v, MotionEvent e) { final int id = v.getId(); Loading @@ -1250,7 +1257,7 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, final Rect initialBounds = mDragPositioningCallback.onDragPositioningStart( 0 /* ctrlType */, e.getDisplayId(), e.getRawX(0), e.getRawY(0)); updateDragStatus(e.getActionMasked()); updateDragStatus(decoration, e); mOnDragStartInitialBounds.set(initialBounds); } // Do not consume input event if a button is touched, otherwise it would Loading @@ -1277,7 +1284,7 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, newTaskBounds); // Flip mIsDragging only if the bounds actually changed. if (mIsDragging || !newTaskBounds.equals(mOnDragStartInitialBounds)) { updateDragStatus(e.getActionMasked()); updateDragStatus(decoration, e); } return true; } Loading Loading @@ -1310,7 +1317,7 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, // onClick call that results. return false; } else { updateDragStatus(e.getActionMasked()); updateDragStatus(decoration, e); return true; } } Loading @@ -1318,16 +1325,16 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, return true; } private void updateDragStatus(int eventAction) { switch (eventAction) { private void updateDragStatus(DesktopModeWindowDecoration decor, MotionEvent e) { switch (e.getActionMasked()) { case MotionEvent.ACTION_DOWN: case MotionEvent.ACTION_UP: case MotionEvent.ACTION_CANCEL: { mIsDragging = false; setIsDragging(decor, false /* isDragging */); break; } case MotionEvent.ACTION_MOVE: { mIsDragging = true; setIsDragging(decor, true /* isDragging */); break; } } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java +16 −4 Original line number Diff line number Diff line Loading @@ -207,7 +207,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin private final WindowDecorCaptionHandleRepository mWindowDecorCaptionHandleRepository; private final DesktopUserRepositories mDesktopUserRepositories; private boolean mIsRecentsTransitionRunning = false; private boolean mIsDragging = false; private Runnable mLoadAppInfoRunnable; private Runnable mSetAppInfoRunnable; Loading Loading @@ -513,7 +513,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin updateRelayoutParams(mRelayoutParams, mContext, taskInfo, mSplitScreenController, applyStartTransactionOnDraw, shouldSetTaskVisibilityPositionAndCrop, mIsStatusBarVisible, mIsKeyguardVisibleAndOccluded, inFullImmersive, mDisplayController.getInsetsState(taskInfo.displayId), hasGlobalFocus, mIsDragging, mDisplayController.getInsetsState(taskInfo.displayId), hasGlobalFocus, displayExclusionRegion, mIsRecentsTransitionRunning, mDesktopModeCompatPolicy.shouldExcludeCaptionFromAppBounds(taskInfo)); Loading Loading @@ -911,6 +911,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin boolean isStatusBarVisible, boolean isKeyguardVisibleAndOccluded, boolean inFullImmersiveMode, boolean isDragging, @NonNull InsetsState displayInsetsState, boolean hasGlobalFocus, @NonNull Region displayExclusionRegion, Loading @@ -933,9 +934,13 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin relayoutParams.mAsyncViewHost = isAppHandle; final boolean showCaption; if (DesktopModeFlags.ENABLE_FULLY_IMMERSIVE_IN_DESKTOP.isTrue()) { if (DesktopModeFlags.ENABLE_DESKTOP_IMMERSIVE_DRAG_BUGFIX.isTrue() && isDragging) { // If the task is being dragged, the caption should not be hidden so that it continues // receiving input showCaption = true; } else if (DesktopModeFlags.ENABLE_FULLY_IMMERSIVE_IN_DESKTOP.isTrue()) { if (inFullImmersiveMode) { showCaption = isStatusBarVisible && !isKeyguardVisibleAndOccluded; showCaption = (isStatusBarVisible && !isKeyguardVisibleAndOccluded); } else { showCaption = taskInfo.isFreeform() || (isStatusBarVisible && !isKeyguardVisibleAndOccluded); Loading Loading @@ -1798,6 +1803,13 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin mIsRecentsTransitionRunning = isRecentsTransitionRunning; } /** * Declares whether the window decoration is being dragged. */ void setIsDragging(boolean isDragging) { mIsDragging = isDragging; } /** * Called when there is a {@link MotionEvent#ACTION_HOVER_EXIT} on the maximize window button. */ Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorationTests.java +41 −0 Original line number Diff line number Diff line Loading @@ -167,6 +167,7 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase { private static final boolean DEFAULT_IS_STATUSBAR_VISIBLE = true; private static final boolean DEFAULT_IS_KEYGUARD_VISIBLE_AND_OCCLUDED = false; private static final boolean DEFAULT_IS_IN_FULL_IMMERSIVE_MODE = false; private static final boolean DEFAULT_IS_DRAGGING = false; private static final boolean DEFAULT_HAS_GLOBAL_FOCUS = true; private static final boolean DEFAULT_SHOULD_IGNORE_CORNER_RADIUS = false; private static final boolean DEFAULT_SHOULD_EXCLUDE_CAPTION_FROM_APP_BOUNDS = false; Loading Loading @@ -415,6 +416,7 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase { DEFAULT_IS_STATUSBAR_VISIBLE, DEFAULT_IS_KEYGUARD_VISIBLE_AND_OCCLUDED, DEFAULT_IS_IN_FULL_IMMERSIVE_MODE, DEFAULT_IS_DRAGGING, new InsetsState(), DEFAULT_HAS_GLOBAL_FOCUS, mExclusionRegion, Loading Loading @@ -616,6 +618,7 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase { DEFAULT_IS_STATUSBAR_VISIBLE, DEFAULT_IS_KEYGUARD_VISIBLE_AND_OCCLUDED, DEFAULT_IS_IN_FULL_IMMERSIVE_MODE, DEFAULT_IS_DRAGGING, new InsetsState(), DEFAULT_HAS_GLOBAL_FOCUS, mExclusionRegion, Loading Loading @@ -650,6 +653,7 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase { DEFAULT_IS_STATUSBAR_VISIBLE, DEFAULT_IS_KEYGUARD_VISIBLE_AND_OCCLUDED, DEFAULT_IS_IN_FULL_IMMERSIVE_MODE, DEFAULT_IS_DRAGGING, new InsetsState(), DEFAULT_HAS_GLOBAL_FOCUS, mExclusionRegion, Loading Loading @@ -728,6 +732,7 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase { DEFAULT_IS_STATUSBAR_VISIBLE, DEFAULT_IS_KEYGUARD_VISIBLE_AND_OCCLUDED, /* inFullImmersiveMode */ true, DEFAULT_IS_DRAGGING, insetsState, DEFAULT_HAS_GLOBAL_FOCUS, mExclusionRegion, Loading Loading @@ -755,6 +760,7 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase { DEFAULT_IS_STATUSBAR_VISIBLE, DEFAULT_IS_KEYGUARD_VISIBLE_AND_OCCLUDED, /* inFullImmersiveMode */ true, DEFAULT_IS_DRAGGING, new InsetsState(), DEFAULT_HAS_GLOBAL_FOCUS, mExclusionRegion, Loading @@ -781,6 +787,7 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase { /* isStatusBarVisible */ false, DEFAULT_IS_KEYGUARD_VISIBLE_AND_OCCLUDED, DEFAULT_IS_IN_FULL_IMMERSIVE_MODE, DEFAULT_IS_DRAGGING, new InsetsState(), DEFAULT_HAS_GLOBAL_FOCUS, mExclusionRegion, Loading @@ -807,6 +814,7 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase { /* isStatusBarVisible */ true, /* isKeyguardVisibleAndOccluded */ false, DEFAULT_IS_IN_FULL_IMMERSIVE_MODE, DEFAULT_IS_DRAGGING, new InsetsState(), DEFAULT_HAS_GLOBAL_FOCUS, mExclusionRegion, Loading @@ -832,6 +840,7 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase { /* isStatusBarVisible */ false, DEFAULT_IS_KEYGUARD_VISIBLE_AND_OCCLUDED, DEFAULT_IS_IN_FULL_IMMERSIVE_MODE, DEFAULT_IS_DRAGGING, new InsetsState(), DEFAULT_HAS_GLOBAL_FOCUS, mExclusionRegion, Loading @@ -857,6 +866,7 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase { DEFAULT_IS_STATUSBAR_VISIBLE, /* isKeyguardVisibleAndOccluded */ true, DEFAULT_IS_IN_FULL_IMMERSIVE_MODE, DEFAULT_IS_DRAGGING, new InsetsState(), DEFAULT_HAS_GLOBAL_FOCUS, mExclusionRegion, Loading @@ -883,6 +893,7 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase { /* isStatusBarVisible */ true, DEFAULT_IS_KEYGUARD_VISIBLE_AND_OCCLUDED, /* inFullImmersiveMode */ true, DEFAULT_IS_DRAGGING, new InsetsState(), DEFAULT_HAS_GLOBAL_FOCUS, mExclusionRegion, Loading @@ -901,6 +912,7 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase { /* isStatusBarVisible */ false, DEFAULT_IS_KEYGUARD_VISIBLE_AND_OCCLUDED, /* inFullImmersiveMode */ true, DEFAULT_IS_DRAGGING, new InsetsState(), DEFAULT_HAS_GLOBAL_FOCUS, mExclusionRegion, Loading @@ -910,6 +922,33 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase { assertThat(relayoutParams.mIsCaptionVisible).isFalse(); } @Test @EnableFlags(Flags.FLAG_ENABLE_DESKTOP_IMMERSIVE_DRAG_BUGFIX) public void updateRelayoutParams_header_fullyImmersive_captionVisDuringDrag() { final ActivityManager.RunningTaskInfo taskInfo = createTaskInfo(/* visible= */ true); taskInfo.configuration.windowConfiguration.setWindowingMode(WINDOWING_MODE_FULLSCREEN); final RelayoutParams relayoutParams = new RelayoutParams(); DesktopModeWindowDecoration.updateRelayoutParams( relayoutParams, mTestableContext, taskInfo, mMockSplitScreenController, DEFAULT_APPLY_START_TRANSACTION_ON_DRAW, DEFAULT_SHOULD_SET_TASK_POSITIONING_AND_CROP, /* isStatusBarVisible */ false, DEFAULT_IS_KEYGUARD_VISIBLE_AND_OCCLUDED, /* inFullImmersiveMode */ true, /* isDragging */ true, new InsetsState(), DEFAULT_HAS_GLOBAL_FOCUS, mExclusionRegion, DEFAULT_SHOULD_IGNORE_CORNER_RADIUS, DEFAULT_SHOULD_EXCLUDE_CAPTION_FROM_APP_BOUNDS); assertThat(relayoutParams.mIsCaptionVisible).isTrue(); } @Test @EnableFlags(Flags.FLAG_ENABLE_FULLY_IMMERSIVE_IN_DESKTOP) public void updateRelayoutParams_header_fullyImmersive_overKeyguard_captionNotVisible() { Loading @@ -927,6 +966,7 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase { DEFAULT_IS_STATUSBAR_VISIBLE, /* isKeyguardVisibleAndOccluded */ true, /* inFullImmersiveMode */ true, DEFAULT_IS_DRAGGING, new InsetsState(), DEFAULT_HAS_GLOBAL_FOCUS, mExclusionRegion, Loading Loading @@ -1588,6 +1628,7 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase { DEFAULT_IS_STATUSBAR_VISIBLE, DEFAULT_IS_KEYGUARD_VISIBLE_AND_OCCLUDED, DEFAULT_IS_IN_FULL_IMMERSIVE_MODE, DEFAULT_IS_DRAGGING, new InsetsState(), DEFAULT_HAS_GLOBAL_FOCUS, mExclusionRegion, Loading