Merge "Disable overriding task animation through windowAnimationStyle attribute." into tm-qpr-dev am: 9631eeca32 am: 4cb4e80639

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17884326

Change-Id: Iee092bb8ab5f191e38ae0d5f47082e79fc9fe0e6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Issei Suzuki
2022-05-05 09:26:08 +00:00
committed by Automerger Merge Worker
3 changed files with 55 additions and 16 deletions

View File

@@ -25,6 +25,7 @@ import static android.view.WindowManager.TRANSIT_OLD_ACTIVITY_OPEN;
import static android.view.WindowManager.TRANSIT_OLD_NONE;
import static android.view.WindowManager.TRANSIT_OLD_TRANSLUCENT_ACTIVITY_CLOSE;
import static android.view.WindowManager.TRANSIT_OLD_TRANSLUCENT_ACTIVITY_OPEN;
import static android.view.WindowManager.TRANSIT_OLD_UNSET;
import static android.view.WindowManager.TRANSIT_OLD_WALLPAPER_INTRA_CLOSE;
import static android.view.WindowManager.TRANSIT_OLD_WALLPAPER_INTRA_OPEN;
import static android.view.WindowManager.TRANSIT_OPEN;
@@ -261,11 +262,17 @@ public class TransitionAnimation {
}
return null;
}
/** Load animation by attribute Id from a specific AnimationStyle resource. */
/**
* Load animation by attribute Id from a specific AnimationStyle resource.
*
* @param translucent {@code true} if we're sure that the animation is applied on a translucent
* window container, {@code false} otherwise.
* @param transit {@link TransitionOldType} for the app transition of this animation, or
* {@link TransitionOldType#TRANSIT_OLD_UNSET} if app transition type is unknown.
*/
@Nullable
public Animation loadAnimationAttr(String packageName, int animStyleResId, int animAttr,
boolean translucent) {
private Animation loadAnimationAttr(String packageName, int animStyleResId, int animAttr,
boolean translucent, @TransitionOldType int transit) {
if (animStyleResId == 0) {
return null;
}
@@ -281,6 +288,8 @@ public class TransitionAnimation {
}
if (translucent) {
resId = updateToTranslucentAnimIfNeeded(resId);
} else if (transit != TRANSIT_OLD_UNSET) {
resId = updateToTranslucentAnimIfNeeded(resId, transit);
}
if (ResourceId.isValid(resId)) {
return loadAnimationSafely(context, resId, mTag);
@@ -288,6 +297,15 @@ public class TransitionAnimation {
return null;
}
/** Load animation by attribute Id from a specific AnimationStyle resource. */
@Nullable
public Animation loadAnimationAttr(String packageName, int animStyleResId, int animAttr,
boolean translucent) {
return loadAnimationAttr(packageName, animStyleResId, animAttr, translucent,
TRANSIT_OLD_UNSET);
}
/** Load animation by attribute Id from android package. */
@Nullable
public Animation loadDefaultAnimationAttr(int animAttr, boolean translucent) {
@@ -295,6 +313,13 @@ public class TransitionAnimation {
translucent);
}
/** Load animation by attribute Id from android package. */
@Nullable
public Animation loadDefaultAnimationAttr(int animAttr, @TransitionOldType int transit) {
return loadAnimationAttr(DEFAULT_PACKAGE, mDefaultWindowAnimationStyleResId, animAttr,
false /* translucent */, transit);
}
@Nullable
private AttributeCache.Entry getCachedAnimations(LayoutParams lp) {
if (mDebug) {