OSDN Git Service

Don't update configuration for invisible windows
authorAndrii Kulian <akulian@google.com>
Thu, 24 May 2018 00:14:00 +0000 (17:14 -0700)
committerAndrii Kulian <akulian@google.com>
Thu, 24 May 2018 21:52:52 +0000 (14:52 -0700)
Use isGoneForLayoutLw() to check visibility of the window when
evaluating if we need to report resize and new config to the
client in WindowState#onResize, like we do in
WindowState#updateResizingWindowIfNeeded.

Bug: 76011287
Test: ActivityManagerAppConfigurationTests
Change-Id: Icfc2e3a793ca7070191c54a0b9334c3ac293c88d

services/core/java/com/android/server/wm/WindowState.java

index c797d8d..febc1a9 100644 (file)
@@ -1763,7 +1763,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
     @Override
     void onResize() {
         final ArrayList<WindowState> resizingWindows = mService.mResizingWindows;
-        if (mHasSurface && !resizingWindows.contains(this)) {
+        if (mHasSurface && !isGoneForLayoutLw() && !resizingWindows.contains(this)) {
             if (DEBUG_RESIZE) Slog.d(TAG, "onResize: Resizing " + this);
             resizingWindows.add(this);
         }