diff options
3 files changed, 33 insertions, 57 deletions
diff --git a/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/JetpackTaskFragmentOrganizer.java b/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/JetpackTaskFragmentOrganizer.java index 9ea2943bc6da..f0613cec6a0b 100644 --- a/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/JetpackTaskFragmentOrganizer.java +++ b/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/JetpackTaskFragmentOrganizer.java @@ -398,27 +398,23 @@ class JetpackTaskFragmentOrganizer extends TaskFragmentOrganizer { new TaskFragmentAnimationParams.Builder(); final int animationBackgroundColor = getAnimationBackgroundColor(splitAttributes); builder.setAnimationBackgroundColor(animationBackgroundColor); - if (Flags.activityEmbeddingAnimationCustomizationFlag()) { - final int openAnimationResId = - splitAttributes.getAnimationParams().getOpenAnimationResId(); - builder.setOpenAnimationResId(openAnimationResId); - final int closeAnimationResId = - splitAttributes.getAnimationParams().getCloseAnimationResId(); - builder.setCloseAnimationResId(closeAnimationResId); - final int changeAnimationResId = - splitAttributes.getAnimationParams().getChangeAnimationResId(); - builder.setChangeAnimationResId(changeAnimationResId); - } + final int openAnimationResId = + splitAttributes.getAnimationParams().getOpenAnimationResId(); + builder.setOpenAnimationResId(openAnimationResId); + final int closeAnimationResId = + splitAttributes.getAnimationParams().getCloseAnimationResId(); + builder.setCloseAnimationResId(closeAnimationResId); + final int changeAnimationResId = + splitAttributes.getAnimationParams().getChangeAnimationResId(); + builder.setChangeAnimationResId(changeAnimationResId); return builder.build(); } @ColorInt private static int getAnimationBackgroundColor(@NonNull SplitAttributes splitAttributes) { int animationBackgroundColor = DEFAULT_ANIMATION_BACKGROUND_COLOR; - AnimationBackground animationBackground = splitAttributes.getAnimationBackground(); - if (Flags.activityEmbeddingAnimationCustomizationFlag()) { - animationBackground = splitAttributes.getAnimationParams().getAnimationBackground(); - } + final AnimationBackground animationBackground = + splitAttributes.getAnimationParams().getAnimationBackground(); if (animationBackground instanceof AnimationBackground.ColorBackground colorBackground) { animationBackgroundColor = colorBackground.getColor(); } diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/activityembedding/ActivityEmbeddingAnimationRunner.java b/libs/WindowManager/Shell/src/com/android/wm/shell/activityembedding/ActivityEmbeddingAnimationRunner.java index d2cef4baf798..f269b3831aab 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/activityembedding/ActivityEmbeddingAnimationRunner.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/activityembedding/ActivityEmbeddingAnimationRunner.java @@ -268,10 +268,7 @@ class ActivityEmbeddingAnimationRunner { final Animation animation = animationProvider.get(info, change, openingWholeScreenBounds); if (shouldUseJumpCutForAnimation(animation)) { - if (Flags.activityEmbeddingAnimationCustomizationFlag()) { - return new ArrayList<>(); - } - continue; + return new ArrayList<>(); } final ActivityEmbeddingAnimationAdapter adapter = createOpenCloseAnimationAdapter( info, change, animation, openingWholeScreenBounds); @@ -296,10 +293,7 @@ class ActivityEmbeddingAnimationRunner { final Animation animation = animationProvider.get(info, change, closingWholeScreenBounds); if (shouldUseJumpCutForAnimation(animation)) { - if (Flags.activityEmbeddingAnimationCustomizationFlag()) { - return new ArrayList<>(); - } - continue; + return new ArrayList<>(); } final ActivityEmbeddingAnimationAdapter adapter = createOpenCloseAnimationAdapter( info, change, animation, closingWholeScreenBounds); @@ -455,11 +449,9 @@ class ActivityEmbeddingAnimationRunner { final Animation[] animations = mAnimationSpec.createChangeBoundsChangeAnimations(info, change, parentBounds); // Jump cut if either animation has zero for duration. - if (Flags.activityEmbeddingAnimationCustomizationFlag()) { - for (Animation animation : animations) { - if (shouldUseJumpCutForAnimation(animation)) { - return new ArrayList<>(); - } + for (Animation animation : animations) { + if (shouldUseJumpCutForAnimation(animation)) { + return new ArrayList<>(); } } // Keep track as we might need to add background color for the animation. @@ -516,10 +508,8 @@ class ActivityEmbeddingAnimationRunner { mAnimationSpec.createChangeBoundsOpenAnimation(info, change, parentBounds); shouldShowBackgroundColor = false; } - if (Flags.activityEmbeddingAnimationCustomizationFlag()) { - if (shouldUseJumpCutForAnimation(animation)) { - return new ArrayList<>(); - } + if (shouldUseJumpCutForAnimation(animation)) { + return new ArrayList<>(); } adapters.add(new ActivityEmbeddingAnimationAdapter(animation, change, TransitionUtil.getRootFor(change, info))); diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/activityembedding/ActivityEmbeddingAnimationSpec.java b/libs/WindowManager/Shell/src/com/android/wm/shell/activityembedding/ActivityEmbeddingAnimationSpec.java index 3046307702c2..77799e99607b 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/activityembedding/ActivityEmbeddingAnimationSpec.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/activityembedding/ActivityEmbeddingAnimationSpec.java @@ -96,11 +96,9 @@ class ActivityEmbeddingAnimationSpec { @NonNull Animation createChangeBoundsOpenAnimation(@NonNull TransitionInfo info, @NonNull TransitionInfo.Change change, @NonNull Rect parentBounds) { - if (Flags.activityEmbeddingAnimationCustomizationFlag()) { - final Animation customAnimation = loadCustomAnimation(info, change, TRANSIT_CHANGE); - if (customAnimation != null) { - return customAnimation; - } + final Animation customAnimation = loadCustomAnimation(info, change, TRANSIT_CHANGE); + if (customAnimation != null) { + return customAnimation; } // Use end bounds for opening. final Rect bounds = change.getEndAbsBounds(); @@ -130,11 +128,9 @@ class ActivityEmbeddingAnimationSpec { @NonNull Animation createChangeBoundsCloseAnimation(@NonNull TransitionInfo info, @NonNull TransitionInfo.Change change, @NonNull Rect parentBounds) { - if (Flags.activityEmbeddingAnimationCustomizationFlag()) { - final Animation customAnimation = loadCustomAnimation(info, change, TRANSIT_CHANGE); - if (customAnimation != null) { - return customAnimation; - } + final Animation customAnimation = loadCustomAnimation(info, change, TRANSIT_CHANGE); + if (customAnimation != null) { + return customAnimation; } // Use start bounds for closing. final Rect bounds = change.getStartAbsBounds(); @@ -168,14 +164,12 @@ class ActivityEmbeddingAnimationSpec { @NonNull Animation[] createChangeBoundsChangeAnimations(@NonNull TransitionInfo info, @NonNull TransitionInfo.Change change, @NonNull Rect parentBounds) { - if (Flags.activityEmbeddingAnimationCustomizationFlag()) { - // TODO(b/293658614): Support more complicated animations that may need more than a noop - // animation as the start leash. - final Animation noopAnimation = createNoopAnimation(change); - final Animation customAnimation = loadCustomAnimation(info, change, TRANSIT_CHANGE); - if (customAnimation != null) { - return new Animation[]{noopAnimation, customAnimation}; - } + // TODO(b/293658614): Support more complicated animations that may need more than a noop + // animation as the start leash. + final Animation noopAnimation = createNoopAnimation(change); + final Animation customAnimation = loadCustomAnimation(info, change, TRANSIT_CHANGE); + if (customAnimation != null) { + return new Animation[]{noopAnimation, customAnimation}; } // Both start bounds and end bounds are in screen coordinates. We will post translate // to the local coordinates in ActivityEmbeddingAnimationAdapter#onAnimationUpdate @@ -320,13 +314,9 @@ class ActivityEmbeddingAnimationSpec { } final Animation anim; - if (Flags.activityEmbeddingAnimationCustomizationFlag()) { - // TODO(b/293658614): Consider allowing custom animations from non-default packages. - // Enforce limiting to animations from the default "android" package for now. - anim = mTransitionAnimation.loadDefaultAnimationRes(resId); - } else { - anim = mTransitionAnimation.loadAnimationRes(options.getPackageName(), resId); - } + // TODO(b/293658614): Consider allowing custom animations from non-default packages. + // Enforce limiting to animations from the default "android" package for now. + anim = mTransitionAnimation.loadDefaultAnimationRes(resId); if (anim != null) { return anim; } |