summaryrefslogtreecommitdiffstats
path: root/policy
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2011-12-13 11:16:23 -0800
committerDianne Hackborn <hackbod@google.com>2011-12-13 11:32:11 -0800
commit73ab6a49db2b834ce1d56c7a1164938b409ee6fc (patch)
tree2807f9928a6ec5a5518bff83e49d2fec5081d691 /policy
parentf0bbc494d638f4c77e688bf9410027f453301559 (diff)
downloadframeworks_base-73ab6a49db2b834ce1d56c7a1164938b409ee6fc.zip
frameworks_base-73ab6a49db2b834ce1d56c7a1164938b409ee6fc.tar.gz
frameworks_base-73ab6a49db2b834ce1d56c7a1164938b409ee6fc.tar.bz2
Fix issue #5755172: Soft menu key disappears when menu is open
We need to work more like before in determining whether the menu key is needed -- in some cases look back in the window list to determine this if we don't know the value from the current window. This requires adding a new private flag indicating whether the compat menu state is known for a window, which is set by PhoneWindow as part of its existing process of computing the flag for its own windows. Now we can have a new API on WindowState to determine the value of this flag for a window, which if needed walks back in the window list to find a window the value is known for (or stops at what the policy has determined is the top full-screen window, so we stop like we used to at things like the lock screen or the bottom of an application). Change-Id: I829de6d629b5af8bcb422cb85249ee4041c7205e
Diffstat (limited to 'policy')
-rw-r--r--policy/src/com/android/internal/policy/impl/KeyguardViewManager.java1
-rw-r--r--policy/src/com/android/internal/policy/impl/PhoneWindow.java2
-rwxr-xr-xpolicy/src/com/android/internal/policy/impl/PhoneWindowManager.java3
3 files changed, 4 insertions, 2 deletions
diff --git a/policy/src/com/android/internal/policy/impl/KeyguardViewManager.java b/policy/src/com/android/internal/policy/impl/KeyguardViewManager.java
index 0499cfa..ff8d5ac 100644
--- a/policy/src/com/android/internal/policy/impl/KeyguardViewManager.java
+++ b/policy/src/com/android/internal/policy/impl/KeyguardViewManager.java
@@ -138,6 +138,7 @@ public class KeyguardViewManager implements KeyguardWindowController {
lp.privateFlags |=
WindowManager.LayoutParams.PRIVATE_FLAG_FORCE_HARDWARE_ACCELERATED;
}
+ lp.privateFlags |= WindowManager.LayoutParams.PRIVATE_FLAG_SET_NEEDS_MENU_KEY;
lp.setTitle("Keyguard");
mWindowLayoutParams = lp;
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindow.java b/policy/src/com/android/internal/policy/impl/PhoneWindow.java
index 535f039..f1fe43b 100644
--- a/policy/src/com/android/internal/policy/impl/PhoneWindow.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindow.java
@@ -2582,6 +2582,8 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
if (targetPreHoneycomb || (targetPreIcs && targetHcNeedsOptions && noActionBar)) {
addFlags(WindowManager.LayoutParams.FLAG_NEEDS_MENU_KEY);
+ } else {
+ clearFlags(WindowManager.LayoutParams.FLAG_NEEDS_MENU_KEY);
}
if (mAlwaysReadCloseOnTouchAttr || getContext().getApplicationInfo().targetSdkVersion
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
index 7510e04..0b223c1 100755
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -3707,8 +3707,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
& ~mResettingSystemUiFlags
& ~mForceClearedSystemUiFlags;
int diff = visibility ^ mLastSystemUiFlags;
- final boolean needsMenu = (mFocusedWindow.getAttrs().flags
- & WindowManager.LayoutParams.FLAG_NEEDS_MENU_KEY) != 0;
+ final boolean needsMenu = mFocusedWindow.getNeedsMenuLw(mTopFullscreenOpaqueWindowState);
if (diff == 0 && mLastFocusNeedsMenu == needsMenu
&& mFocusedApp == mFocusedWindow.getAppToken()) {
return 0;