From c501b06de572cddea8ef8f564461d675d6b0d1cd Mon Sep 17 00:00:00 2001 From: Tiger Huang Date: Thu, 17 May 2018 16:45:56 +0800 Subject: [PATCH] Prevent infinite layout while hiding nav bar on keyguard By the original logic, if there is a focused window which hides navigation bar while keyguard is showing, PhoneWindowManager would hide/show navigation bar frequently, which caused infinite layout. Bug: 78681867 Bug: 79896018 Bug: 80113279 Test: 1. a. Open a photo in fullscreen mode (hiding navigation bar) b. Press power key to bring up keyguard c. See if there is "Performed 6 layouts in a row. Skipping" log 2. go/wm-smoke 3. Open a video in YouTube in fullscreen mode and then expand status bar, and see if navigation bar would show; collapse status bar, and see if navigation bar would hide Change-Id: Id8c49ac8fc45b98294e48017308dce3117ed1cf8 Merged-In: Id8c49ac8fc45b98294e48017308dce3117ed1cf8 (cherry picked from commit 53e8cfe794ef0e1295e526b21c557c2a17e597ad) --- .../java/com/android/server/policy/PhoneWindowManager.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java index 9395a0a5fe86a..03e34d3070ab9 100644 --- a/services/core/java/com/android/server/policy/PhoneWindowManager.java +++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java @@ -5761,11 +5761,6 @@ public class PhoneWindowManager implements WindowManagerPolicy { mStatusBarController.updateVisibilityLw(false /*transientAllowed*/, mLastSystemUiFlags, mLastSystemUiFlags); } - if (statusBarExpanded && mNavigationBar != null) { - if (mNavigationBarController.setBarShowingLw(true)) { - changes |= FINISH_LAYOUT_REDO_LAYOUT; - } - } } else if (mTopFullscreenOpaqueWindowState != null) { topIsFullscreen = topAppHidesStatusBar; // The subtle difference between the window for mTopFullscreenOpaqueWindowState