From 657cc738e99ac585c429bb6e97f7f64d6f0a4bba Mon Sep 17 00:00:00 2001 From: Evan Rosky Date: Thu, 29 Sep 2022 22:59:27 +0000 Subject: [PATCH] Display-level relative display rotation should be 0 Because duh. DisplayContent is root, so it can't have a relative rotation. The problem is that RootWindowContainer ends up with the default display's rotation because we store the "global" configuration at that level. This is a legacy thing, so until we clean that up, we have to just fix things at the display level. Bug: 249250882 Test: atest ChangeAppRotationTest, look at the trace and see that the recording display doesn't get rotated. Change-Id: I76dc12be8ba934799dbc2ade3e00476f73bf3c71 --- .../core/java/com/android/server/wm/DisplayContent.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java index 95d71a36313fc..71c80fb9a97ce 100644 --- a/services/core/java/com/android/server/wm/DisplayContent.java +++ b/services/core/java/com/android/server/wm/DisplayContent.java @@ -6729,4 +6729,11 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp DisplayContent asDisplayContent() { return this; } + + @Override + @Surface.Rotation + int getRelativeDisplayRotation() { + // Display is the root, so it's not rotated relative to anything. + return Surface.ROTATION_0; + } }