summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/core/java/com/android/server/wm/ActivityRecord.java5
-rw-r--r--services/core/java/com/android/server/wm/WindowState.java3
2 files changed, 6 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java
index fa6ac651a059..ccf8d4fce6c0 100644
--- a/services/core/java/com/android/server/wm/ActivityRecord.java
+++ b/services/core/java/com/android/server/wm/ActivityRecord.java
@@ -2867,7 +2867,10 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
if (mStartingData != null) {
if (mStartingData.mAssociatedTask != null) {
// The snapshot type may have called associateStartingDataWithTask().
- attachStartingSurfaceToAssociatedTask();
+ // If this activity is rotated, don't attach to task to preserve the transform.
+ if (!hasFixedRotationTransform()) {
+ attachStartingSurfaceToAssociatedTask();
+ }
} else if (isEmbedded()) {
associateStartingWindowWithTaskIfNeeded();
}
diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java
index ba7628e0ad04..a36cff6d7bc5 100644
--- a/services/core/java/com/android/server/wm/WindowState.java
+++ b/services/core/java/com/android/server/wm/WindowState.java
@@ -5506,7 +5506,8 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
@Override
public SurfaceControl getAnimationLeashParent() {
- if (isStartingWindowAssociatedToTask()) {
+ if (mActivityRecord != null && !mActivityRecord.hasFixedRotationTransform()
+ && isStartingWindowAssociatedToTask()) {
return mStartingData.mAssociatedTask.mSurfaceControl;
}
return super.getAnimationLeashParent();