From 73bad0ec973d4616fa77536f59747c503d55109a Mon Sep 17 00:00:00 2001 From: John Spurlock Date: Thu, 25 Apr 2013 08:09:19 -0400 Subject: [PATCH] Hideybar gesture clears flags if SYSTEM_UI_FLAG_FULLSCREEN If an app uses the system-clearable SYSTEM_UI_FLAG_FULLSCREEN to hide the status bar, swiping from the top of the screen should clear the clearable flags, revealing the system ui, and allowing apps to respond to the change. This differs from the behavior the gesture triggers when an app hides the status bar using the non-clearable WM.LP.FLAG_FULLSCREEN. In this case, we temporarily overlay the transparent auto-hiding bar. Bug: 8682504 Change-Id: Ie5dc885fd13c8d980c136f6babcea181565ef2a2 --- .../android/internal/policy/impl/PhoneWindowManager.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java index 63584aca43e86..6a854f53ceb9f 100644 --- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java @@ -4960,7 +4960,16 @@ public class PhoneWindowManager implements WindowManagerPolicy { if (mHideybars == HIDEYBARS_SHOWING) { if (!hideybarsAllowed) { mHideybars = HIDEYBARS_NONE; + if ((tmpVisibility & View.SYSTEM_UI_FLAG_FULLSCREEN) != 0) { + // hideybars for View.SYSTEM_UI_FLAG_FULLSCREEN: clear the clearable flags + int newVal = mResettingSystemUiFlags | View.SYSTEM_UI_CLEARABLE_FLAGS; + if (newVal != mResettingSystemUiFlags) { + mResettingSystemUiFlags = newVal; + mWindowManagerFuncs.reevaluateStatusBarVisibility(); + } + } } else { + // hideybars for WM.LP.FLAG_FULLSCREEN: show transparent status bar tmpVisibility |= View.STATUS_BAR_OVERLAY; if ((mLastSystemUiFlags & View.STATUS_BAR_OVERLAY) == 0) { mStatusBar.showLw(true);