Don't do any animations for unstyled translucent activities

This is actually undefined (translucent activities should be
using Theme.Translucent); however, some apps have been assuming
the previous behavior (that it means no-animation). This CL
restores the previous behavior.

Bug: 267843636
Test: Open Photos, go to a photo, click "Edit".
Change-Id: I7073f4acfa1b5d4d72381130c9101e18282f5010
This commit is contained in:
Evan Rosky
2023-05-24 20:51:54 -07:00
parent b185da2a58
commit eb7d276880

View File

@@ -23,6 +23,7 @@ import static android.view.WindowManager.TRANSIT_OPEN;
import static android.view.WindowManager.TRANSIT_TO_BACK;
import static android.view.WindowManager.TRANSIT_TO_FRONT;
import static android.view.WindowManager.transitTypeToString;
import static android.window.TransitionInfo.FLAGS_IS_NON_APP_WINDOW;
import static android.window.TransitionInfo.FLAG_STARTING_WINDOW_TRANSFER_RECIPIENT;
import static android.window.TransitionInfo.FLAG_TRANSLUCENT;
@@ -150,6 +151,10 @@ public class TransitionAnimationHelper {
.loadAnimationAttr(options.getPackageName(), options.getAnimations(),
animAttr, translucent);
}
} else if (translucent && !isTask && ((changeFlags & FLAGS_IS_NON_APP_WINDOW) == 0)) {
// Un-styled translucent activities technically have undefined animations; however,
// as is always the case, some apps now rely on this being no-animation, so skip
// loading animations here.
} else {
a = transitionAnimation.loadDefaultAnimationAttr(animAttr, translucent);
}