Loading services/core/java/com/android/server/wm/ActivityRecord.java +1 −1 Original line number Diff line number Diff line Loading @@ -496,7 +496,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A /** The most recently given options. */ private ActivityOptions mPendingOptions; /** Non-null if {@link #mPendingOptions} specifies the remote animation. */ private RemoteAnimationAdapter mPendingRemoteAnimation; RemoteAnimationAdapter mPendingRemoteAnimation; private RemoteTransition mPendingRemoteTransition; ActivityOptions returningOptions; // options that are coming back via convertToTranslucent AppTimeTracker appTimeTracker; // set if we are tracking the time in this app/task/activity Loading services/core/java/com/android/server/wm/ActivityStarter.java +5 −1 Original line number Diff line number Diff line Loading @@ -2947,10 +2947,14 @@ class ActivityStarter { } } // Update the target's launch cookie to those specified in the options if set // Update the target's launch cookie and pending remote animation to those specified in the // options if set. if (mStartActivity.mLaunchCookie != null) { intentActivity.mLaunchCookie = mStartActivity.mLaunchCookie; } if (mStartActivity.mPendingRemoteAnimation != null) { intentActivity.mPendingRemoteAnimation = mStartActivity.mPendingRemoteAnimation; } // Need to update mTargetRootTask because if task was moved out of it, the original root // task may be destroyed. Loading services/core/java/com/android/server/wm/AppTransitionController.java +1 −1 Original line number Diff line number Diff line Loading @@ -300,8 +300,8 @@ public class AppTransitionController { layoutRedo = appTransition.goodToGo(transit, topOpeningApp); handleNonAppWindowsInTransition(transit, flags); appTransition.postAnimationCallback(); appTransition.clear(); } finally { appTransition.clear(); mService.mSurfaceAnimationRunner.continueStartingAnimations(); } Loading services/tests/wmtests/src/com/android/server/wm/ActivityStarterTests.java +27 −0 Original line number Diff line number Diff line Loading @@ -98,6 +98,7 @@ import android.service.voice.IVoiceInteractionSession; import android.util.Pair; import android.util.Size; import android.view.Gravity; import android.view.RemoteAnimationAdapter; import android.window.TaskFragmentOrganizerToken; import androidx.test.filters.SmallTest; Loading Loading @@ -1314,6 +1315,32 @@ public class ActivityStarterTests extends WindowTestsBase { assertTrue(mRootWindowContainer.topRunningActivity().mLaunchCookie == newCookie); } @Test public void testRemoteAnimation_appliesToExistingTask() { final ActivityStarter starter = prepareStarter(0, false); // Put an activity on default display as the top focused activity. ActivityRecord r = new ActivityBuilder(mAtm).setCreateTask(true).build(); final Intent intent = new Intent(); intent.setComponent(ActivityBuilder.getDefaultComponent()); starter.setReason("testRemoteAnimation_newTask") .setIntent(intent) .execute(); assertNull(mRootWindowContainer.topRunningActivity().mPendingRemoteAnimation); // Relaunch the activity with remote animation indicated in options. final RemoteAnimationAdapter adaptor = mock(RemoteAnimationAdapter.class); final ActivityOptions options = ActivityOptions.makeRemoteAnimation(adaptor); starter.setReason("testRemoteAnimation_existingTask") .setIntent(intent) .setActivityOptions(options.toBundle()) .execute(); // Verify the remote animation is updated. assertEquals(adaptor, mRootWindowContainer.topRunningActivity().mPendingRemoteAnimation); } @Test public void testStartLaunchIntoPipActivity() { final ActivityStarter starter = prepareStarter(0, false); Loading Loading
services/core/java/com/android/server/wm/ActivityRecord.java +1 −1 Original line number Diff line number Diff line Loading @@ -496,7 +496,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A /** The most recently given options. */ private ActivityOptions mPendingOptions; /** Non-null if {@link #mPendingOptions} specifies the remote animation. */ private RemoteAnimationAdapter mPendingRemoteAnimation; RemoteAnimationAdapter mPendingRemoteAnimation; private RemoteTransition mPendingRemoteTransition; ActivityOptions returningOptions; // options that are coming back via convertToTranslucent AppTimeTracker appTimeTracker; // set if we are tracking the time in this app/task/activity Loading
services/core/java/com/android/server/wm/ActivityStarter.java +5 −1 Original line number Diff line number Diff line Loading @@ -2947,10 +2947,14 @@ class ActivityStarter { } } // Update the target's launch cookie to those specified in the options if set // Update the target's launch cookie and pending remote animation to those specified in the // options if set. if (mStartActivity.mLaunchCookie != null) { intentActivity.mLaunchCookie = mStartActivity.mLaunchCookie; } if (mStartActivity.mPendingRemoteAnimation != null) { intentActivity.mPendingRemoteAnimation = mStartActivity.mPendingRemoteAnimation; } // Need to update mTargetRootTask because if task was moved out of it, the original root // task may be destroyed. Loading
services/core/java/com/android/server/wm/AppTransitionController.java +1 −1 Original line number Diff line number Diff line Loading @@ -300,8 +300,8 @@ public class AppTransitionController { layoutRedo = appTransition.goodToGo(transit, topOpeningApp); handleNonAppWindowsInTransition(transit, flags); appTransition.postAnimationCallback(); appTransition.clear(); } finally { appTransition.clear(); mService.mSurfaceAnimationRunner.continueStartingAnimations(); } Loading
services/tests/wmtests/src/com/android/server/wm/ActivityStarterTests.java +27 −0 Original line number Diff line number Diff line Loading @@ -98,6 +98,7 @@ import android.service.voice.IVoiceInteractionSession; import android.util.Pair; import android.util.Size; import android.view.Gravity; import android.view.RemoteAnimationAdapter; import android.window.TaskFragmentOrganizerToken; import androidx.test.filters.SmallTest; Loading Loading @@ -1314,6 +1315,32 @@ public class ActivityStarterTests extends WindowTestsBase { assertTrue(mRootWindowContainer.topRunningActivity().mLaunchCookie == newCookie); } @Test public void testRemoteAnimation_appliesToExistingTask() { final ActivityStarter starter = prepareStarter(0, false); // Put an activity on default display as the top focused activity. ActivityRecord r = new ActivityBuilder(mAtm).setCreateTask(true).build(); final Intent intent = new Intent(); intent.setComponent(ActivityBuilder.getDefaultComponent()); starter.setReason("testRemoteAnimation_newTask") .setIntent(intent) .execute(); assertNull(mRootWindowContainer.topRunningActivity().mPendingRemoteAnimation); // Relaunch the activity with remote animation indicated in options. final RemoteAnimationAdapter adaptor = mock(RemoteAnimationAdapter.class); final ActivityOptions options = ActivityOptions.makeRemoteAnimation(adaptor); starter.setReason("testRemoteAnimation_existingTask") .setIntent(intent) .setActivityOptions(options.toBundle()) .execute(); // Verify the remote animation is updated. assertEquals(adaptor, mRootWindowContainer.topRunningActivity().mPendingRemoteAnimation); } @Test public void testStartLaunchIntoPipActivity() { final ActivityStarter starter = prepareStarter(0, false); Loading