Loading libs/WindowManager/Shell/src/com/android/wm/shell/taskview/TaskViewTransitions.java +9 −0 Original line number Diff line number Diff line Loading @@ -641,6 +641,15 @@ public class TaskViewTransitions implements Transitions.TransitionHandler, TaskV } if (pending.mExternalTransition != null) { pending.mClaimed = pending.mExternalTransition.start(); if (pending.mClaimed == null) { ProtoLog.w(WM_SHELL_BUBBLES_NOISY, "TaskViewTransitions.startNextTransition(): " + "taskView=%d starting the external transition returned a null claim " + "token. it may have already finished. removing it so that it does not " + "block other transitions.", pending.mTaskView.hashCode()); mPending.remove(pending); startNextTransition(); return; } } else { pending.mClaimed = mTransitions.startTransition(pending.mType, pending.mWct, this); } Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/BubbleTransitionsTest.java +3 −0 Original line number Diff line number Diff line Loading @@ -185,6 +185,7 @@ public class BubbleTransitionsTest extends ShellTestCase { @Test public void testConvertToBubble() { // Basic walk-through of convert-to-bubble transition stages when(mTransitions.startTransition(anyInt(), any(), any())).thenReturn(mock(IBinder.class)); final ActivityManager.RunningTaskInfo taskInfo = setupBubble(); final BubbleTransitions.BubbleTransition bt = mBubbleTransitions.startConvertToBubble( mBubble, taskInfo, mExpandedViewManager, mTaskViewFactory, mBubblePositioner, Loading Loading @@ -318,6 +319,7 @@ public class BubbleTransitionsTest extends ShellTestCase { @Test public void testConvertFromBubble() { when(mTransitions.startTransition(anyInt(), any(), any())).thenReturn(mock(IBinder.class)); final ActivityManager.RunningTaskInfo taskInfo = setupBubble(); final BubbleTransitions.BubbleTransition bt = mBubbleTransitions.startConvertFromBubble( mBubble, taskInfo); Loading Loading @@ -432,6 +434,7 @@ public class BubbleTransitionsTest extends ShellTestCase { when(bev.getViewRootImpl()).thenReturn(vri); when(mBubble.getBubbleBarExpandedView()).thenReturn(null); when(mBubble.getExpandedView()).thenReturn(bev); when(mTransitions.startTransition(anyInt(), any(), any())).thenReturn(mock(IBinder.class)); final ActivityManager.RunningTaskInfo taskInfo = setupBubble(); final BubbleTransitions.BubbleTransition bt = mBubbleTransitions.startConvertFromBubble( Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/taskview/TaskViewTransitionsTest.java +16 −0 Original line number Diff line number Diff line Loading @@ -435,6 +435,22 @@ public class TaskViewTransitionsTest extends ShellTestCase { .isEqualTo(bounds); } @Test public void externalTransitionPending_alreadyFinished_removed() { IBinder transition = mock(IBinder.class); mTaskViewTransitions.enqueueExternal(mTaskViewTaskController, () -> transition); assertThat(mTaskViewTransitions.hasPending()).isTrue(); // enqueue an external transition, that when started returns a null token as if it has // already finished mTaskViewTransitions.enqueueExternal(mTaskViewTaskController, () -> null); assertThat(mTaskViewTransitions.hasPending()).isTrue(); mTaskViewTransitions.onExternalDone(transition); assertThat(mTaskViewTransitions.hasPending()).isFalse(); } private SurfaceControl.Transaction createMockTransaction() { SurfaceControl.Transaction transaction = mock(SurfaceControl.Transaction.class); when(transaction.reparent(any(), any())).thenReturn(transaction); Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/taskview/TaskViewTransitions.java +9 −0 Original line number Diff line number Diff line Loading @@ -641,6 +641,15 @@ public class TaskViewTransitions implements Transitions.TransitionHandler, TaskV } if (pending.mExternalTransition != null) { pending.mClaimed = pending.mExternalTransition.start(); if (pending.mClaimed == null) { ProtoLog.w(WM_SHELL_BUBBLES_NOISY, "TaskViewTransitions.startNextTransition(): " + "taskView=%d starting the external transition returned a null claim " + "token. it may have already finished. removing it so that it does not " + "block other transitions.", pending.mTaskView.hashCode()); mPending.remove(pending); startNextTransition(); return; } } else { pending.mClaimed = mTransitions.startTransition(pending.mType, pending.mWct, this); } Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/BubbleTransitionsTest.java +3 −0 Original line number Diff line number Diff line Loading @@ -185,6 +185,7 @@ public class BubbleTransitionsTest extends ShellTestCase { @Test public void testConvertToBubble() { // Basic walk-through of convert-to-bubble transition stages when(mTransitions.startTransition(anyInt(), any(), any())).thenReturn(mock(IBinder.class)); final ActivityManager.RunningTaskInfo taskInfo = setupBubble(); final BubbleTransitions.BubbleTransition bt = mBubbleTransitions.startConvertToBubble( mBubble, taskInfo, mExpandedViewManager, mTaskViewFactory, mBubblePositioner, Loading Loading @@ -318,6 +319,7 @@ public class BubbleTransitionsTest extends ShellTestCase { @Test public void testConvertFromBubble() { when(mTransitions.startTransition(anyInt(), any(), any())).thenReturn(mock(IBinder.class)); final ActivityManager.RunningTaskInfo taskInfo = setupBubble(); final BubbleTransitions.BubbleTransition bt = mBubbleTransitions.startConvertFromBubble( mBubble, taskInfo); Loading Loading @@ -432,6 +434,7 @@ public class BubbleTransitionsTest extends ShellTestCase { when(bev.getViewRootImpl()).thenReturn(vri); when(mBubble.getBubbleBarExpandedView()).thenReturn(null); when(mBubble.getExpandedView()).thenReturn(bev); when(mTransitions.startTransition(anyInt(), any(), any())).thenReturn(mock(IBinder.class)); final ActivityManager.RunningTaskInfo taskInfo = setupBubble(); final BubbleTransitions.BubbleTransition bt = mBubbleTransitions.startConvertFromBubble( Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/taskview/TaskViewTransitionsTest.java +16 −0 Original line number Diff line number Diff line Loading @@ -435,6 +435,22 @@ public class TaskViewTransitionsTest extends ShellTestCase { .isEqualTo(bounds); } @Test public void externalTransitionPending_alreadyFinished_removed() { IBinder transition = mock(IBinder.class); mTaskViewTransitions.enqueueExternal(mTaskViewTaskController, () -> transition); assertThat(mTaskViewTransitions.hasPending()).isTrue(); // enqueue an external transition, that when started returns a null token as if it has // already finished mTaskViewTransitions.enqueueExternal(mTaskViewTaskController, () -> null); assertThat(mTaskViewTransitions.hasPending()).isTrue(); mTaskViewTransitions.onExternalDone(transition); assertThat(mTaskViewTransitions.hasPending()).isFalse(); } private SurfaceControl.Transaction createMockTransaction() { SurfaceControl.Transaction transaction = mock(SurfaceControl.Transaction.class); when(transaction.reparent(any(), any())).thenReturn(transaction); Loading