summaryrefslogtreecommitdiffstats
path: root/core/java/android/view/View.java
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2011-10-06 11:51:27 -0700
committerDianne Hackborn <hackbod@google.com>2011-10-06 14:57:37 -0700
commit9a230e01a1237749a8a19a5de8d46531b0c8ca6a (patch)
treec62734c0dcd00cc9add7c70bd60e8946e0915735 /core/java/android/view/View.java
parentfe7fcd23d5b306db7b1fb31c901cbcbb6b66db1d (diff)
downloadframeworks_base-9a230e01a1237749a8a19a5de8d46531b0c8ca6a.zip
frameworks_base-9a230e01a1237749a8a19a5de8d46531b0c8ca6a.tar.gz
frameworks_base-9a230e01a1237749a8a19a5de8d46531b0c8ca6a.tar.bz2
Fix issue #5371530: SYSTEMUI_FLAG_HIDE_NAVIGATION reasserts itself immediately
This cleans up how ui flags are managed between the client and window manager. It still reports the global UI mode state to the callback, but we now only clear certain flags when the system goes out of a state (currently this just means the hide nav bar mode), and don't corrupt other flags in the application when the global state changes. Also introduces a sequence number between the app and window manager, to avoid using bad old data coming from the app during these transitions. Change-Id: I40bbd12d9b7b69fc0ff1c7dc0cb58a933d4dfb23
Diffstat (limited to 'core/java/android/view/View.java')
-rw-r--r--core/java/android/view/View.java30
1 files changed, 28 insertions, 2 deletions
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 8e5aefd..c7507f8 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -1925,6 +1925,15 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal
public static final int PUBLIC_STATUS_BAR_VISIBILITY_MASK = 0x0000FFFF;
/**
+ * These are the system UI flags that can be cleared by events outside
+ * of an application. Currently this is just the ability to tap on the
+ * screen while hiding the navigation bar to have it return.
+ * @hide
+ */
+ public static final int SYSTEM_UI_CLEARABLE_FLAGS =
+ SYSTEM_UI_FLAG_LOW_PROFILE | SYSTEM_UI_FLAG_HIDE_NAVIGATION;
+
+ /**
* Find views that render the specified text.
*
* @see #findViewsWithText(ArrayList, CharSequence, int)
@@ -13027,6 +13036,8 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal
}
/**
+ * Dispatch callbacks to {@link #setOnSystemUiVisibilityChangeListener} down
+ * the view hierarchy.
*/
public void dispatchSystemUiVisibilityChanged(int visibility) {
if (mOnSystemUiVisibilityChangeListener != null) {
@@ -13035,6 +13046,13 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal
}
}
+ void updateLocalSystemUiVisibility(int localValue, int localChanges) {
+ int val = (mSystemUiVisibility&~localChanges) | (localValue&localChanges);
+ if (val != mSystemUiVisibility) {
+ setSystemUiVisibility(val);
+ }
+ }
+
/**
* Creates an image that the system displays during the drag and drop
* operation. This is called a &quot;drag shadow&quot;. The default implementation
@@ -14108,7 +14126,8 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal
/**
* Interface definition for a callback to be invoked when the status bar changes
- * visibility.
+ * visibility. This reports <strong>global</strong> changes to the system UI
+ * state, not just what the application is requesting.
*
* @see View#setOnSystemUiVisibilityChangeListener(android.view.View.OnSystemUiVisibilityChangeListener)
*/
@@ -14118,7 +14137,9 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal
* {@link View#setSystemUiVisibility(int)}.
*
* @param visibility Bitwise-or of flags {@link #SYSTEM_UI_FLAG_LOW_PROFILE} or
- * {@link #SYSTEM_UI_FLAG_HIDE_NAVIGATION}.
+ * {@link #SYSTEM_UI_FLAG_HIDE_NAVIGATION}. This tells you the
+ * <strong>global</strong> state of the UI visibility flags, not what your
+ * app is currently applying.
*/
public void onSystemUiVisibilityChange(int visibility);
}
@@ -14376,6 +14397,11 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal
boolean mRecomputeGlobalAttributes;
/**
+ * Always report new attributes at next traversal.
+ */
+ boolean mForceReportNewAttributes;
+
+ /**
* Set during a traveral if any views want to keep the screen on.
*/
boolean mKeepScreenOn;