summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Riddle Hsu <riddlehsu@google.com> 2021-06-02 18:55:30 +0800
committer Riddle Hsu <riddlehsu@google.com> 2021-06-02 19:50:20 +0800
commit5ffdaf032a0074f6814bc938b9980a73bbe9f7fd (patch)
tree32a0de90d0a5beb4ab88934a8c7e2e4ec98fdc1f
parent0a40c03eb1a0583c7cac687d679d281683fae293 (diff)
Reduce reporting resize when the window is in relayout
Since commit 23c07ad that changes the order of createSurfaceControl and performSurfacePlacement, the window in relayout will have mHasSurface=true. And because isLastConfigReportedToClient is not set yet at the end of relayout, that causes to report resize for config change. In relayoutWindow, the latest merged configuration will be returned from fillClientWindowFramesAndConfiguration that sets mLastConfigReportedToClient(isLastConfigReportedToClient), so the resize is usually unnecessary. Actually most of cases, the client receives the resize message and just skip because nothing is different from its states. Bug: 189915038 Test: CtsWindowManagerDeviceTestCases Test: Check trace of adding a new simple window. There won't be a MSG_RESIZED after the first relayout. Change-Id: Ieaf709907342780e4458c9c3c27902c86068de6e
-rw-r--r--services/core/java/com/android/server/wm/WindowState.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java
index 5f4798650184..20a992d244c5 100644
--- a/services/core/java/com/android/server/wm/WindowState.java
+++ b/services/core/java/com/android/server/wm/WindowState.java
@@ -1500,7 +1500,9 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
}
boolean didFrameInsetsChange = setReportResizeHints();
- boolean configChanged = !isLastConfigReportedToClient();
+ // The latest configuration will be returned by the out parameter of relayout, so it is
+ // unnecessary to report resize if this window is running relayout.
+ final boolean configChanged = !mInRelayout && !isLastConfigReportedToClient();
if (DEBUG_CONFIGURATION && configChanged) {
Slog.v(TAG_WM, "Win " + this + " config changed: " + getConfiguration());
}