From 0812f844a16dee446b4fe3c2d3ef07671e1708c5 Mon Sep 17 00:00:00 2001 From: Milton Wu Date: Wed, 4 May 2022 16:55:33 +0800 Subject: [PATCH] Fix physical display ratio incorrect ScreenDecorations' physical display ratio is incorrect on rotation value 1 or 2. Change calculation base for physicalDisplayRatio() Bug: 231407521 Test: atest ScreenDecorationsTest Test: Manually check rounded corner display for every rotation and every resolution on device. Change-Id: I573636f5b889a0ef6e77eba7c6a5bac6e0dfb07d --- .../SystemUI/src/com/android/systemui/ScreenDecorations.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java b/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java index 8d65098747762..cbce854e4a712 100644 --- a/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java +++ b/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java @@ -899,8 +899,8 @@ public class ScreenDecorations extends CoreStartable implements Tunable , Dumpab final DisplayInfo displayInfo = new DisplayInfo(); mContext.getDisplay().getDisplayInfo(displayInfo); return DisplayUtils.getPhysicalPixelDisplaySizeRatio( - stableDisplaySize.x, stableDisplaySize.y, displayInfo.logicalWidth, - displayInfo.logicalHeight); + stableDisplaySize.x, stableDisplaySize.y, displayInfo.getNaturalWidth(), + displayInfo.getNaturalHeight()); } @Override