summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/view/Window.java3
-rw-r--r--core/java/android/view/WindowManager.java10
-rw-r--r--core/java/android/view/WindowManagerPolicy.java8
3 files changed, 21 insertions, 0 deletions
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);
diff --git a/core/java/android/view/WindowManager.java b/core/java/android/view/WindowManager.java
index e74fec6082a4..c0eb65bf73f4 100644
--- a/core/java/android/view/WindowManager.java
+++ b/core/java/android/view/WindowManager.java
@@ -824,6 +824,16 @@ public interface WindowManager extends ViewManager {
public static final int PRIVATE_FLAG_WANTS_OFFSET_NOTIFICATIONS = 0x00000004;
/**
+ * This is set for a window that has explicitly specified its
+ * FLAG_NEEDS_MENU_KEY, so we know the value on this window is the
+ * appropriate one to use. If this is not set, we should look at
+ * windows behind it to determine the appropriate value.
+ *
+ * @hide
+ */
+ public static final int PRIVATE_FLAG_SET_NEEDS_MENU_KEY = 0x00000008;
+
+ /**
* Control flags that are private to the platform.
* @hide
*/
diff --git a/core/java/android/view/WindowManagerPolicy.java b/core/java/android/view/WindowManagerPolicy.java
index 2e19bf64d3e1..924cb5327833 100644
--- a/core/java/android/view/WindowManagerPolicy.java
+++ b/core/java/android/view/WindowManagerPolicy.java
@@ -238,6 +238,14 @@ public interface WindowManagerPolicy {
public WindowManager.LayoutParams getAttrs();
/**
+ * Return whether this window needs the menu key shown. Must be called
+ * with window lock held, because it may need to traverse down through
+ * window list to determine the result.
+ * @param bottom The bottom-most window to consider when determining this.
+ */
+ public boolean getNeedsMenuLw(WindowState bottom);
+
+ /**
* Retrieve the current system UI visibility flags associated with
* this window.
*/