diff options
| -rw-r--r-- | services/core/java/com/android/server/wm/ActivityRecord.java | 12 |
1 files changed, 10 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 42efc2de5b47..b41755b71fb5 100644 --- a/services/core/java/com/android/server/wm/ActivityRecord.java +++ b/services/core/java/com/android/server/wm/ActivityRecord.java @@ -8689,6 +8689,15 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A // calculate the override, skip the override. return; } + // Make sure the orientation related fields will be updated by the override insets, because + // fixed rotation has assigned the fields from display's configuration. + if (hasFixedRotationTransform()) { + inOutConfig.windowConfiguration.setAppBounds(null); + inOutConfig.screenWidthDp = Configuration.SCREEN_WIDTH_DP_UNDEFINED; + inOutConfig.screenHeightDp = Configuration.SCREEN_HEIGHT_DP_UNDEFINED; + inOutConfig.smallestScreenWidthDp = Configuration.SMALLEST_SCREEN_WIDTH_DP_UNDEFINED; + inOutConfig.orientation = ORIENTATION_UNDEFINED; + } // Override starts here. final boolean rotated = (rotation == ROTATION_90 || rotation == ROTATION_270); @@ -8725,8 +8734,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A // For the case of PIP transition and multi-window environment, the // smallestScreenWidthDp is handled already. Override only if the app is in // fullscreen. - DisplayInfo info = new DisplayInfo(); - mDisplayContent.getDisplay().getDisplayInfo(info); + final DisplayInfo info = new DisplayInfo(mDisplayContent.getDisplayInfo()); mDisplayContent.computeSizeRanges(info, rotated, dw, dh, mDisplayContent.getDisplayMetrics().density, inOutConfig, true /* overrideConfig */); |