summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author shawnlin <shawnlin@google.com> 2022-05-05 19:54:13 +0800
committer Shawn Lin <shawnlin@google.com> 2022-05-05 12:13:29 +0000
commitabaa42bd44af7e0c00bc952e3df0043c861da939 (patch)
treefcadeba35f29ff21caaea8ee11a8e0eb8f0f80cb
parent100004b0ca9ba19de39987bb36eabd1caf236f0a (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.java4
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(