Offer a masked version of setUiOptions for windows to only modify certain flags.
Change-Id: I36aaff982767f8984c468e8c13f8d5ec8c3c0040
diff --git a/api/current.txt b/api/current.txt
index f8d3e06..68c830f 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -23471,6 +23471,7 @@
method public abstract void setTitleColor(int);
method public void setType(int);
method public void setUiOptions(int);
+ method public void setUiOptions(int, int);
method public abstract void setVolumeControlStream(int);
method public void setWindowAnimations(int);
method public void setWindowManager(android.view.WindowManager, android.os.IBinder, java.lang.String);
diff --git a/core/java/android/view/Window.java b/core/java/android/view/Window.java
index 6ac679c..e0e1a1a 100644
--- a/core/java/android/view/Window.java
+++ b/core/java/android/view/Window.java
@@ -1219,4 +1219,12 @@
* @param uiOptions Flags specifying extra options for this window.
*/
public void setUiOptions(int uiOptions) { }
+
+ /**
+ * Set extra options that will influence the UI for this window.
+ * Only the bits filtered by mask will be modified.
+ * @param uiOptions Flags specifying extra options for this window.
+ * @param mask Flags specifying which options should be modified. Others will remain unchanged.
+ */
+ public void setUiOptions(int uiOptions, int mask) { }
}
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindow.java b/policy/src/com/android/internal/policy/impl/PhoneWindow.java
index 3dcc297..0ee6488 100644
--- a/policy/src/com/android/internal/policy/impl/PhoneWindow.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindow.java
@@ -235,6 +235,11 @@
}
@Override
+ public void setUiOptions(int uiOptions, int mask) {
+ mUiOptions = (mUiOptions & ~mask) | (uiOptions & mask);
+ }
+
+ @Override
public void setContentView(int layoutResID) {
if (mContentParent == null) {
installDecor();