diff --git a/data/etc/services.core.protolog.json b/data/etc/services.core.protolog.json index 30604768e6d0b..9917cee00eaf6 100644 --- a/data/etc/services.core.protolog.json +++ b/data/etc/services.core.protolog.json @@ -385,6 +385,12 @@ "group": "WM_ERROR", "at": "com\/android\/server\/wm\/WindowManagerService.java" }, + "-1263316010": { + "message": "Computed rotation=%s (%d) for display id=%d based on lastOrientation=%s (%d) and oldRotation=%s (%d)", + "level": "VERBOSE", + "group": "WM_DEBUG_ORIENTATION", + "at": "com\/android\/server\/wm\/DisplayRotation.java" + }, "-1259022216": { "message": "SURFACE HIDE ( %s ): %s", "level": "INFO", @@ -463,6 +469,12 @@ "group": "WM_ERROR", "at": "com\/android\/server\/wm\/WindowManagerService.java" }, + "-1108775960": { + "message": "%s is requesting orientation %d (%s)", + "level": "VERBOSE", + "group": "WM_DEBUG_ORIENTATION", + "at": "com\/android\/server\/wm\/WindowContainer.java" + }, "-1103716954": { "message": "Not removing %s due to exit animation", "level": "VERBOSE", @@ -631,6 +643,12 @@ "group": "WM_DEBUG_FOCUS_LIGHT", "at": "com\/android\/server\/wm\/ActivityRecord.java" }, + "-766059044": { + "message": "Display id=%d selected orientation %s (%d), got rotation %s (%d)", + "level": "VERBOSE", + "group": "WM_DEBUG_ORIENTATION", + "at": "com\/android\/server\/wm\/DisplayRotation.java" + }, "-760801764": { "message": "onAnimationCancelled", "level": "DEBUG", @@ -1267,12 +1285,6 @@ "group": "WM_DEBUG_RECENTS_ANIMATIONS", "at": "com\/android\/server\/wm\/RecentsAnimation.java" }, - "481370485": { - "message": "Computed rotation=%d for display id=%d based on lastOrientation=%d and oldRotation=%d", - "level": "VERBOSE", - "group": "WM_DEBUG_ORIENTATION", - "at": "com\/android\/server\/wm\/DisplayRotation.java" - }, "490877640": { "message": "onStackOrderChanged(): stack=%s", "level": "DEBUG", @@ -1795,12 +1807,6 @@ "group": "WM_ERROR", "at": "com\/android\/server\/wm\/WindowManagerService.java" }, - "1573332272": { - "message": "Display id=%d selected orientation %d, got rotation %d", - "level": "VERBOSE", - "group": "WM_DEBUG_ORIENTATION", - "at": "com\/android\/server\/wm\/DisplayRotation.java" - }, "1577579529": { "message": "win=%s destroySurfaces: appStopped=%b win.mWindowRemovalAllowed=%b win.mRemoveOnExit=%b", "level": "ERROR", diff --git a/services/core/java/com/android/server/wm/DisplayRotation.java b/services/core/java/com/android/server/wm/DisplayRotation.java index c7c3f8ad54a20..b59c4e38214ba 100644 --- a/services/core/java/com/android/server/wm/DisplayRotation.java +++ b/services/core/java/com/android/server/wm/DisplayRotation.java @@ -442,13 +442,17 @@ public class DisplayRotation { final int lastOrientation = mLastOrientation; final int rotation = rotationForOrientation(lastOrientation, oldRotation); ProtoLog.v(WM_DEBUG_ORIENTATION, - "Computed rotation=%d for display id=%d based on lastOrientation=%d and " - + "oldRotation=%d", - rotation, displayId, lastOrientation, oldRotation); + "Computed rotation=%s (%d) for display id=%d based on lastOrientation=%s (%d) and " + + "oldRotation=%s (%d)", + Surface.rotationToString(rotation), rotation, + displayId, + ActivityInfo.screenOrientationToString(lastOrientation), lastOrientation, + Surface.rotationToString(oldRotation), oldRotation); ProtoLog.v(WM_DEBUG_ORIENTATION, - "Display id=%d selected orientation %d, got rotation %d", displayId, - lastOrientation, rotation); + "Display id=%d selected orientation %s (%d), got rotation %s (%d)", displayId, + ActivityInfo.screenOrientationToString(lastOrientation), lastOrientation, + Surface.rotationToString(rotation), rotation); if (oldRotation == rotation) { // No change. diff --git a/services/core/java/com/android/server/wm/WindowContainer.java b/services/core/java/com/android/server/wm/WindowContainer.java index d73cb50fe107f..008ded518bc51 100644 --- a/services/core/java/com/android/server/wm/WindowContainer.java +++ b/services/core/java/com/android/server/wm/WindowContainer.java @@ -30,6 +30,7 @@ import static android.view.SurfaceControl.Transaction; import static com.android.server.policy.WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER; import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_APP_TRANSITIONS; import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_APP_TRANSITIONS_ANIM; +import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_ORIENTATION; import static com.android.server.wm.WindowContainer.AnimationFlags.CHILDREN; import static com.android.server.wm.WindowContainer.AnimationFlags.PARENTS; import static com.android.server.wm.WindowContainer.AnimationFlags.TRANSITION; @@ -132,6 +133,7 @@ class WindowContainer extends ConfigurationContainer< protected final WindowList mChildren = new WindowList(); // The specified orientation for this window container. + @ActivityInfo.ScreenOrientation protected int mOrientation = SCREEN_ORIENTATION_UNSPECIFIED; private final Pools.SynchronizedPool mConsumerWrapperPool = @@ -984,6 +986,7 @@ class WindowContainer extends ConfigurationContainer< } } + @ActivityInfo.ScreenOrientation int getOrientation() { return getOrientation(mOrientation); } @@ -1036,6 +1039,8 @@ class WindowContainer extends ConfigurationContainer< if (wc.fillsParent() || orientation != SCREEN_ORIENTATION_UNSPECIFIED) { // Use the orientation if the container fills its parent or requested an explicit // orientation that isn't SCREEN_ORIENTATION_UNSPECIFIED. + ProtoLog.v(WM_DEBUG_ORIENTATION, "%s is requesting orientation %d (%s)", toString(), + orientation, ActivityInfo.screenOrientationToString(orientation)); return orientation; } }