From 5e55e3976d207b20c00270a8579adffa5aa79bb7 Mon Sep 17 00:00:00 2001 From: Charles Chen Date: Wed, 25 Aug 2021 02:59:05 +0000 Subject: Reland "Introduce TaskFragment transition type" Previously AppTransitionController didn't recognize TaskFragment transitions, so it uses Task opening/closing animation for TaskFragment transitions. This CL introduces and uses TaskFragment transition if the animation target is TaskFragment. The new transition type can be used for registering RemoteAnimation implemented by TaskFragmentOrganizer as well. It also provides a fallback mechanism for TaskFragment transitions if the RemoteAnimation fails or one of opening/closing animation target is not a pure organized TaskFragment. Note that previous reverted CL[1] didn't cover the case that the animation target is promoted to TaskDisplayArea. This CL fixes it by introducing WindowContainer#canBeAnimationTarget to filter out the case. Bug: 194649929 Test: manual - the reproducible step in b/194649929#comment1 Test: atest WmTests:AppTransitionTests AppTransitionControllerTest Test: atest MultiDisplayPolicyTests#testAppTransitionForActivityOnDifferentDisplay [1]: I0094694fa5cd95d8bbb7da94d2aaf7aac6e1fe09 Change-Id: I5520803f3018d2dd67c96db55daceef740b2cf0b --- core/java/android/view/WindowManager.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'core/java/android') diff --git a/core/java/android/view/WindowManager.java b/core/java/android/view/WindowManager.java index 9b3550477aaa..329ea4a02145 100644 --- a/core/java/android/view/WindowManager.java +++ b/core/java/android/view/WindowManager.java @@ -319,6 +319,19 @@ public interface WindowManager extends ViewManager { */ int TRANSIT_OLD_TASK_CHANGE_WINDOWING_MODE = 27; + /** + * A window in a new task fragment is being opened. + * @hide + */ + int TRANSIT_OLD_TASK_FRAGMENT_OPEN = 28; + + /** + * A window in the top-most activity of task fragment is being closed to reveal the activity + * below. + * @hide + */ + int TRANSIT_OLD_TASK_FRAGMENT_CLOSE = 29; + /** * @hide */ @@ -344,7 +357,9 @@ public interface WindowManager extends ViewManager { TRANSIT_OLD_TRANSLUCENT_ACTIVITY_OPEN, TRANSIT_OLD_TRANSLUCENT_ACTIVITY_CLOSE, TRANSIT_OLD_CRASHING_ACTIVITY_CLOSE, - TRANSIT_OLD_TASK_CHANGE_WINDOWING_MODE + TRANSIT_OLD_TASK_CHANGE_WINDOWING_MODE, + TRANSIT_OLD_TASK_FRAGMENT_OPEN, + TRANSIT_OLD_TASK_FRAGMENT_CLOSE }) @Retention(RetentionPolicy.SOURCE) @interface TransitionOldType {} -- cgit v1.2.3