diff options
| author | 2022-05-05 19:54:13 +0800 | |
|---|---|---|
| committer | 2022-05-05 12:13:29 +0000 | |
| commit | abaa42bd44af7e0c00bc952e3df0043c861da939 (patch) | |
| tree | fcadeba35f29ff21caaea8ee11a8e0eb8f0f80cb | |
| parent | 100004b0ca9ba19de39987bb36eabd1caf236f0a (diff) | |
Don't create unexpected display cutout or rounded corners
Should not load cutout and rounded corner when the mInitialDisplayCutout
and mInitialRoundedCorner are null when setForcedSize() is called.
Otherwise, it will accidentally create the cutout/rounded corners of the
default display on other display.
Bug: 230500488
Test: atest DisplaySizeTest#testSizeRangesAfterSettingDisplaySize
Change-Id: Ied2ad194cf2a22e4ac3fe2eb9d6d474e3c9b7578
| -rw-r--r-- | services/core/java/com/android/server/wm/DisplayContent.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java index 2975a95426bb..d0baa238f732 100644 --- a/services/core/java/com/android/server/wm/DisplayContent.java +++ b/services/core/java/com/android/server/wm/DisplayContent.java @@ -2922,7 +2922,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp } DisplayCutout loadDisplayCutout(int displayWidth, int displayHeight) { - if (mDisplayPolicy == null) { + if (mDisplayPolicy == null || mInitialDisplayCutout == null) { return null; } return DisplayCutout.fromResourcesRectApproximation( @@ -2931,7 +2931,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp } RoundedCorners loadRoundedCorners(int displayWidth, int displayHeight) { - if (mDisplayPolicy == null) { + if (mDisplayPolicy == null || mInitialRoundedCorners == null) { return null; } return RoundedCorners.fromResources( |