Merge "Make sure display config is updated when cutout is changed" into tm-dev am: 25319431be

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17473271

Change-Id: I83c8cfe3a299ad42d4839ea439247b57372c2860
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Riddle Hsu
2022-03-31 06:54:15 +00:00
committed by Automerger Merge Worker
2 changed files with 17 additions and 9 deletions

View File

@@ -1810,10 +1810,14 @@ public class DisplayPolicy {
/**
* Called when the resource overlays change.
*/
public void onOverlayChangedLw() {
void onOverlayChanged() {
updateCurrentUserResources();
// Update the latest display size, cutout.
mDisplayContent.updateDisplayInfo();
// The height of status bar needs to update in case display cutout is changed.
onConfigurationChanged();
mSystemGestures.onConfigurationChanged();
// The height of status bar can affect screen size configuration.
mDisplayContent.reconfigureDisplayLocked();
}
/**

View File

@@ -6966,13 +6966,17 @@ public class WindowManagerService extends IWindowManager.Stub
}
public void onOverlayChanged() {
synchronized (mGlobalLock) {
mRoot.forAllDisplays(displayContent -> {
displayContent.getDisplayPolicy().onOverlayChangedLw();
displayContent.updateDisplayInfo();
});
requestTraversal();
}
// Post to display thread so it can get the latest display info.
mH.post(() -> {
synchronized (mGlobalLock) {
mAtmService.deferWindowLayout();
try {
mRoot.forAllDisplays(dc -> dc.getDisplayPolicy().onOverlayChanged());
} finally {
mAtmService.continueWindowLayout();
}
}
});
}
@Override