Allow ActivityOptions remote animation override per-display remote

animation.

Double check if there is already a remote animation override before
applying the override from AppTransitionController.

We have a global RA adapter registered via
ActivityTaskManager.registerRemoteAnimationsForDisplay(),
which will be passed to
AppTransitionController.mRemoteAnimationDefinition.
It seems that when we have another adapter passed via
ActivityOptions, it will be delivered to
AppTransition.overridePendingAppTransitionRemote().
We want to allow the 2nd RA take precedence over the 1st RA. This CL
does so by not passing AppTransitionController's RA adapter to
AppTransition if AppTransition already has a RA adapter.

Bug: 195674714
Fix: 195674714
Test: manually tested
Change-Id: I076c2d2fb304d1032725143b00c0981319bf9f25
(cherry picked from commit 9c0f2376e2b9e40a6cd63a116b3d0d684baafb54)
This commit is contained in:
Josh Yang
2021-08-05 12:26:41 -07:00
parent 3901dc4979
commit 0fd13e8499

View File

@@ -464,7 +464,8 @@ public class AppTransitionController {
}
final RemoteAnimationAdapter adapter =
getRemoteAnimationOverride(animLpActivity, transit, activityTypes);
if (adapter != null) {
if (adapter != null
&& mDisplayContent.mAppTransition.getRemoteAnimationController() == null) {
mDisplayContent.mAppTransition.overridePendingAppTransitionRemote(adapter);
}
}