diff options
| author | 2024-04-30 05:53:04 +0000 | |
|---|---|---|
| committer | 2024-04-30 05:53:04 +0000 | |
| commit | d725ff4f8fa2fc59960523fb6e01a4668c5dcdfc (patch) | |
| tree | bcd5a1ea606288e15c94a82b784ac90b9703e126 | |
| parent | 88a6adb484538a91f1d0fc9fd27ac2ad0c9a61b2 (diff) | |
| parent | e30303bf14ddb7944d47509d71949b43be28aed6 (diff) | |
Merge "Apply size override for fixed rotation activity" into main
| -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 */); |