Merge "Plumb Scene-transition tag through shell transitions" into udc-dev

This commit is contained in:
Evan Rosky
2023-05-01 18:39:58 +00:00
committed by Android (Google) Code Review
3 changed files with 18 additions and 3 deletions

View File

@@ -21,6 +21,7 @@ import static android.app.ActivityOptions.ANIM_CUSTOM;
import static android.app.ActivityOptions.ANIM_FROM_STYLE;
import static android.app.ActivityOptions.ANIM_OPEN_CROSS_PROFILE_APPS;
import static android.app.ActivityOptions.ANIM_SCALE_UP;
import static android.app.ActivityOptions.ANIM_SCENE_TRANSITION;
import static android.app.ActivityOptions.ANIM_THUMBNAIL_SCALE_DOWN;
import static android.app.ActivityOptions.ANIM_THUMBNAIL_SCALE_UP;
import static android.app.WindowConfiguration.ROTATION_UNDEFINED;
@@ -1067,6 +1068,11 @@ public final class TransitionInfo implements Parcelable {
return options;
}
public static AnimationOptions makeSceneTransitionAnimOptions() {
AnimationOptions options = new AnimationOptions(ANIM_SCENE_TRANSITION);
return options;
}
public int getType() {
return mType;
}

View File

@@ -21,6 +21,7 @@ import static android.app.ActivityOptions.ANIM_CUSTOM;
import static android.app.ActivityOptions.ANIM_NONE;
import static android.app.ActivityOptions.ANIM_OPEN_CROSS_PROFILE_APPS;
import static android.app.ActivityOptions.ANIM_SCALE_UP;
import static android.app.ActivityOptions.ANIM_SCENE_TRANSITION;
import static android.app.ActivityOptions.ANIM_THUMBNAIL_SCALE_DOWN;
import static android.app.ActivityOptions.ANIM_THUMBNAIL_SCALE_UP;
import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
@@ -625,6 +626,9 @@ public class DefaultTransitionHandler implements Transitions.TransitionHandler {
} else if ((changeFlags & FLAG_STARTING_WINDOW_TRANSFER_RECIPIENT) != 0 && isOpeningType) {
// This received a transferred starting window, so don't animate
return null;
} else if (overrideType == ANIM_SCENE_TRANSITION) {
// If there's a scene-transition, then jump-cut.
return null;
} else {
a = loadAttributeAnimation(info, change, wallpaperTransit, mTransitionAnimation);
}

View File

@@ -4908,9 +4908,14 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
mTransitionController.setStatusBarTransitionDelay(
mPendingRemoteAnimation.getStatusBarTransitionDelay());
} else {
if (mPendingOptions == null
|| mPendingOptions.getAnimationType() == ANIM_SCENE_TRANSITION) {
// Scene transition will run on the client side.
if (mPendingOptions == null) {
return;
} else if (mPendingOptions.getAnimationType() == ANIM_SCENE_TRANSITION) {
// Scene transition will run on the client side, so just notify transition
// controller but don't clear the animation information from the options since they
// need to be sent to the animating activity.
mTransitionController.setOverrideAnimation(
AnimationOptions.makeSceneTransitionAnimOptions(), null, null);
return;
}
applyOptionsAnimation(mPendingOptions, intent);