Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java +1 −1 Original line number Diff line number Diff line Loading @@ -1877,7 +1877,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin } void setAnimatingTaskResizeOrReposition(boolean animatingTaskResizeOrReposition) { if (mRelayoutParams.mLayoutResId == R.layout.desktop_mode_app_handle) return; if (!isAppHeader(mWindowDecorViewHolder)) return; final boolean inFullImmersive = mDesktopUserRepositories.getProfile(mTaskInfo.userId) .isTaskInFullImmersiveState(mTaskInfo.taskId); Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorationTests.java +18 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ import static com.google.common.truth.Truth.assertThat; import static junit.framework.Assert.assertFalse; import static junit.framework.Assert.assertTrue; import static junit.framework.Assert.fail; import static org.mockito.ArgumentMatchers.anyBoolean; import static org.mockito.ArgumentMatchers.argThat; Loading Loading @@ -1753,6 +1754,23 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase { verifyHandleMenuCreated(TEST_URI3); } @Test public void setAnimatingTaskResizeOrReposition_returnsWhenViewHolderIsNull() { final ActivityManager.RunningTaskInfo taskInfo = createTaskInfo(true /* visible */); final DesktopModeWindowDecoration decor = spy(createWindowDecoration(taskInfo, true /* relayout */)); // Close the decor to close the view holder and set it to null decor.close(); // Verify returns when view holder is null try { decor.setAnimatingTaskResizeOrReposition(true /* animatingTaskResizeOrReposition */); } catch (NullPointerException e) { fail("Attempted to access view holder after window decor is closed"); } } private void verifyHandleMenuCreated(@Nullable Uri uri) { verify(mMockHandleMenuFactory).create(any(), any(), any(), any(), any(), anyInt(), Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java +1 −1 Original line number Diff line number Diff line Loading @@ -1877,7 +1877,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin } void setAnimatingTaskResizeOrReposition(boolean animatingTaskResizeOrReposition) { if (mRelayoutParams.mLayoutResId == R.layout.desktop_mode_app_handle) return; if (!isAppHeader(mWindowDecorViewHolder)) return; final boolean inFullImmersive = mDesktopUserRepositories.getProfile(mTaskInfo.userId) .isTaskInFullImmersiveState(mTaskInfo.taskId); Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorationTests.java +18 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ import static com.google.common.truth.Truth.assertThat; import static junit.framework.Assert.assertFalse; import static junit.framework.Assert.assertTrue; import static junit.framework.Assert.fail; import static org.mockito.ArgumentMatchers.anyBoolean; import static org.mockito.ArgumentMatchers.argThat; Loading Loading @@ -1753,6 +1754,23 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase { verifyHandleMenuCreated(TEST_URI3); } @Test public void setAnimatingTaskResizeOrReposition_returnsWhenViewHolderIsNull() { final ActivityManager.RunningTaskInfo taskInfo = createTaskInfo(true /* visible */); final DesktopModeWindowDecoration decor = spy(createWindowDecoration(taskInfo, true /* relayout */)); // Close the decor to close the view holder and set it to null decor.close(); // Verify returns when view holder is null try { decor.setAnimatingTaskResizeOrReposition(true /* animatingTaskResizeOrReposition */); } catch (NullPointerException e) { fail("Attempted to access view holder after window decor is closed"); } } private void verifyHandleMenuCreated(@Nullable Uri uri) { verify(mMockHandleMenuFactory).create(any(), any(), any(), any(), any(), anyInt(), Loading