From 73ab6a49db2b834ce1d56c7a1164938b409ee6fc Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Tue, 13 Dec 2011 11:16:23 -0800 Subject: 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 --- core/java/android/view/Window.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'core/java/android/view/Window.java') diff --git a/core/java/android/view/Window.java b/core/java/android/view/Window.java index d0841dd2b3e7..a99ac03e0570 100644 --- a/core/java/android/view/Window.java +++ b/core/java/android/view/Window.java @@ -743,6 +743,9 @@ public abstract class Window { public void setFlags(int flags, int mask) { final WindowManager.LayoutParams attrs = getAttributes(); attrs.flags = (attrs.flags&~mask) | (flags&mask); + if ((mask&WindowManager.LayoutParams.FLAG_NEEDS_MENU_KEY) != 0) { + attrs.privateFlags |= WindowManager.LayoutParams.PRIVATE_FLAG_SET_NEEDS_MENU_KEY; + } mForcedWindowFlags |= mask; if (mCallback != null) { mCallback.onWindowAttributesChanged(attrs); -- cgit v1.2.3