summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Riddle Hsu <riddlehsu@google.com> 2025-03-23 18:36:23 -0700
committer Android (Google) Code Review <android-gerrit@google.com> 2025-03-23 18:36:23 -0700
commitd9a023d1a0a9cdd72a2e6d2f5606ebfe457a8f99 (patch)
treee094f05ce902925cebb037045452e91564498989
parentd268778160730bf53a55bec6629ee4b8755a9953 (diff)
parent995a2b8c12cd6c5a2569d04ab65183544136a9e8 (diff)
Merge "Remove FixedRotationTransformStateLegacy" into main
-rw-r--r--services/core/java/com/android/server/wm/WindowToken.java62
1 files changed, 1 insertions, 61 deletions
diff --git a/services/core/java/com/android/server/wm/WindowToken.java b/services/core/java/com/android/server/wm/WindowToken.java
index cca73c574951..7823b92e4057 100644
--- a/services/core/java/com/android/server/wm/WindowToken.java
+++ b/services/core/java/com/android/server/wm/WindowToken.java
@@ -134,15 +134,6 @@ class WindowToken extends WindowContainer<WindowState> {
}
/**
- * Transforms the window container from the next rotation to the current rotation for
- * showing the window in a display with different rotation.
- */
- void transform(WindowContainer<?> container) {
- // The default implementation assumes shell transition is enabled, so the transform
- // is done by getOrCreateFixedRotationLeash().
- }
-
- /**
* Resets the transformation of the window containers which have been rotated. This should
* be called when the window has the same rotation as display.
*/
@@ -158,45 +149,6 @@ class WindowToken extends WindowContainer<WindowState> {
}
}
- private static class FixedRotationTransformStateLegacy extends FixedRotationTransformState {
- final SeamlessRotator mRotator;
- final ArrayList<WindowContainer<?>> mRotatedContainers = new ArrayList<>(3);
-
- FixedRotationTransformStateLegacy(DisplayInfo rotatedDisplayInfo,
- DisplayFrames rotatedDisplayFrames, Configuration rotatedConfig,
- int currentRotation) {
- super(rotatedDisplayInfo, rotatedDisplayFrames, rotatedConfig);
- // This will use unrotate as rotate, so the new and old rotation are inverted.
- mRotator = new SeamlessRotator(rotatedDisplayInfo.rotation, currentRotation,
- rotatedDisplayInfo, true /* applyFixedTransformationHint */);
- }
-
- @Override
- void transform(WindowContainer<?> container) {
- mRotator.unrotate(container.getPendingTransaction(), container);
- if (!mRotatedContainers.contains(container)) {
- mRotatedContainers.add(container);
- }
- }
-
- @Override
- void resetTransform() {
- for (int i = mRotatedContainers.size() - 1; i >= 0; i--) {
- final WindowContainer<?> c = mRotatedContainers.get(i);
- // If the window is detached (no parent), its surface may have been released.
- if (c.getParent() != null) {
- mRotator.finish(c.getPendingTransaction(), c);
- }
- }
- }
-
- @Override
- void disassociate(WindowToken token) {
- super.disassociate(token);
- mRotatedContainers.remove(token);
- }
- }
-
/**
* Compares two child window of this token and returns -1 if the first is lesser than the
* second in terms of z-order and 1 otherwise.
@@ -494,10 +446,7 @@ class WindowToken extends WindowContainer<WindowState> {
mFixedRotationTransformState.disassociate(this);
}
config = new Configuration(config);
- mFixedRotationTransformState = mTransitionController.isShellTransitionsEnabled()
- ? new FixedRotationTransformState(info, displayFrames, config)
- : new FixedRotationTransformStateLegacy(info, displayFrames, config,
- mDisplayContent.getRotation());
+ mFixedRotationTransformState = new FixedRotationTransformState(info, displayFrames, config);
mFixedRotationTransformState.mAssociatedTokens.add(this);
mDisplayContent.getDisplayPolicy().simulateLayoutDisplay(displayFrames);
onFixedRotationStatePrepared();
@@ -699,15 +648,6 @@ class WindowToken extends WindowContainer<WindowState> {
return;
}
super.updateSurfacePosition(t);
- if (!mTransitionController.isShellTransitionsEnabled() && isFixedRotationTransforming()) {
- final Task rootTask = r != null ? r.getRootTask() : null;
- // Don't transform the activity in PiP because the PiP task organizer will handle it.
- if (rootTask == null || !rootTask.inPinnedWindowingMode()) {
- // The window is laid out in a simulated rotated display but the real display hasn't
- // rotated, so here transforms its surface to fit in the real display.
- mFixedRotationTransformState.transform(this);
- }
- }
}
@Override