Loading libs/WindowManager/Shell/src/com/android/wm/shell/recents/IRecentsAnimationRunner.aidl +3 −2 Original line number Diff line number Diff line Loading @@ -59,11 +59,12 @@ oneway interface IRecentsAnimationRunner { void onAnimationStart(in IRecentsAnimationController controller, in RemoteAnimationTarget[] apps, in RemoteAnimationTarget[] wallpapers, in Rect homeContentInsets, in Rect minimizedHomeBounds, in Bundle extras, in TransitionInfo info) = 2; in @nullable TransitionInfo info) = 2; /** * Called when the task of an activity that has been started while the recents animation * was running becomes ready for control. */ void onTasksAppeared(in RemoteAnimationTarget[] app) = 3; void onTasksAppeared(in RemoteAnimationTarget[] app, in @nullable TransitionInfo transitionInfo) = 3; } libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentsTransitionHandler.java +6 −3 Original line number Diff line number Diff line Loading @@ -1214,13 +1214,16 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler, // Since we're accepting the merge, update the finish transaction so that changes via // that transaction will be applied on top of those of the merged transitions mFinishTransaction = finishT; boolean passTransitionInfo = ENABLE_DESKTOP_RECENTS_TRANSITIONS_CORNERS_BUGFIX.isTrue(); if (!passTransitionInfo) { // not using the incoming anim-only surfaces info.releaseAnimSurfaces(); } if (appearedTargets != null) { try { ProtoLog.v(ShellProtoLogGroup.WM_SHELL_RECENTS_TRANSITION, "[%d] RecentsController.merge: calling onTasksAppeared", mInstanceId); mListener.onTasksAppeared(appearedTargets); mListener.onTasksAppeared(appearedTargets, passTransitionInfo ? info : null); } catch (RemoteException e) { Slog.e(TAG, "Error sending appeared tasks to recents animation", e); } Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/recents/RecentsTransitionHandlerTest.java +26 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertNull; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.spy; Loading Loading @@ -291,6 +292,31 @@ public class RecentsTransitionHandlerTest extends ShellTestCase { assertThat(listener.getState()).isEqualTo(TRANSITION_STATE_NOT_RUNNING); } @Test @EnableFlags(FLAG_ENABLE_DESKTOP_RECENTS_TRANSITIONS_CORNERS_BUGFIX) public void testMerge_openingTasks_callsOnTasksAppeared() throws Exception { final IRecentsAnimationRunner animationRunner = mock(IRecentsAnimationRunner.class); TransitionInfo mergeTransitionInfo = new TransitionInfoBuilder(TRANSIT_OPEN) .addChange(TRANSIT_OPEN, new TestRunningTaskInfoBuilder().build()) .build(); final IBinder transition = startRecentsTransition(/* synthetic= */ false, animationRunner); SurfaceControl.Transaction finishT = mock(SurfaceControl.Transaction.class); mRecentsTransitionHandler.startAnimation( transition, createTransitionInfo(), new StubTransaction(), new StubTransaction(), mock(Transitions.TransitionFinishCallback.class)); mRecentsTransitionHandler.findController(transition).merge( mergeTransitionInfo, new StubTransaction(), finishT, transition, mock(Transitions.TransitionFinishCallback.class)); mMainExecutor.flushAll(); verify(animationRunner).onTasksAppeared( /* appearedTargets= */ any(), eq(mergeTransitionInfo)); } @Test @EnableFlags(FLAG_ENABLE_DESKTOP_RECENTS_TRANSITIONS_CORNERS_BUGFIX) public void testMergeAndFinish_openingFreeformTasks_setsCornerRadius() { Loading packages/SystemUI/shared/src/com/android/systemui/shared/system/RecentsAnimationListener.java +2 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.systemui.shared.system; import android.annotation.Nullable; import android.graphics.Rect; import android.os.Bundle; import android.view.RemoteAnimationTarget; Loading @@ -42,5 +43,5 @@ public interface RecentsAnimationListener { * Called when the task of an activity that has been started while the recents animation * was running becomes ready for control. */ void onTasksAppeared(RemoteAnimationTarget[] app); void onTasksAppeared(RemoteAnimationTarget[] app, @Nullable TransitionInfo transitionInfo); } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/recents/IRecentsAnimationRunner.aidl +3 −2 Original line number Diff line number Diff line Loading @@ -59,11 +59,12 @@ oneway interface IRecentsAnimationRunner { void onAnimationStart(in IRecentsAnimationController controller, in RemoteAnimationTarget[] apps, in RemoteAnimationTarget[] wallpapers, in Rect homeContentInsets, in Rect minimizedHomeBounds, in Bundle extras, in TransitionInfo info) = 2; in @nullable TransitionInfo info) = 2; /** * Called when the task of an activity that has been started while the recents animation * was running becomes ready for control. */ void onTasksAppeared(in RemoteAnimationTarget[] app) = 3; void onTasksAppeared(in RemoteAnimationTarget[] app, in @nullable TransitionInfo transitionInfo) = 3; }
libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentsTransitionHandler.java +6 −3 Original line number Diff line number Diff line Loading @@ -1214,13 +1214,16 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler, // Since we're accepting the merge, update the finish transaction so that changes via // that transaction will be applied on top of those of the merged transitions mFinishTransaction = finishT; boolean passTransitionInfo = ENABLE_DESKTOP_RECENTS_TRANSITIONS_CORNERS_BUGFIX.isTrue(); if (!passTransitionInfo) { // not using the incoming anim-only surfaces info.releaseAnimSurfaces(); } if (appearedTargets != null) { try { ProtoLog.v(ShellProtoLogGroup.WM_SHELL_RECENTS_TRANSITION, "[%d] RecentsController.merge: calling onTasksAppeared", mInstanceId); mListener.onTasksAppeared(appearedTargets); mListener.onTasksAppeared(appearedTargets, passTransitionInfo ? info : null); } catch (RemoteException e) { Slog.e(TAG, "Error sending appeared tasks to recents animation", e); } Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/recents/RecentsTransitionHandlerTest.java +26 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertNull; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.spy; Loading Loading @@ -291,6 +292,31 @@ public class RecentsTransitionHandlerTest extends ShellTestCase { assertThat(listener.getState()).isEqualTo(TRANSITION_STATE_NOT_RUNNING); } @Test @EnableFlags(FLAG_ENABLE_DESKTOP_RECENTS_TRANSITIONS_CORNERS_BUGFIX) public void testMerge_openingTasks_callsOnTasksAppeared() throws Exception { final IRecentsAnimationRunner animationRunner = mock(IRecentsAnimationRunner.class); TransitionInfo mergeTransitionInfo = new TransitionInfoBuilder(TRANSIT_OPEN) .addChange(TRANSIT_OPEN, new TestRunningTaskInfoBuilder().build()) .build(); final IBinder transition = startRecentsTransition(/* synthetic= */ false, animationRunner); SurfaceControl.Transaction finishT = mock(SurfaceControl.Transaction.class); mRecentsTransitionHandler.startAnimation( transition, createTransitionInfo(), new StubTransaction(), new StubTransaction(), mock(Transitions.TransitionFinishCallback.class)); mRecentsTransitionHandler.findController(transition).merge( mergeTransitionInfo, new StubTransaction(), finishT, transition, mock(Transitions.TransitionFinishCallback.class)); mMainExecutor.flushAll(); verify(animationRunner).onTasksAppeared( /* appearedTargets= */ any(), eq(mergeTransitionInfo)); } @Test @EnableFlags(FLAG_ENABLE_DESKTOP_RECENTS_TRANSITIONS_CORNERS_BUGFIX) public void testMergeAndFinish_openingFreeformTasks_setsCornerRadius() { Loading
packages/SystemUI/shared/src/com/android/systemui/shared/system/RecentsAnimationListener.java +2 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.systemui.shared.system; import android.annotation.Nullable; import android.graphics.Rect; import android.os.Bundle; import android.view.RemoteAnimationTarget; Loading @@ -42,5 +43,5 @@ public interface RecentsAnimationListener { * Called when the task of an activity that has been started while the recents animation * was running becomes ready for control. */ void onTasksAppeared(RemoteAnimationTarget[] app); void onTasksAppeared(RemoteAnimationTarget[] app, @Nullable TransitionInfo transitionInfo); }