summaryrefslogtreecommitdiffstats
path: root/core/java/android/view
diff options
context:
space:
mode:
authorAlan Viverette <alanv@google.com>2013-10-08 20:14:20 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-10-08 20:14:21 +0000
commit3a407fad3554fe9567bb8769b060233b3efc0633 (patch)
treed4e3a9dec1b1b76ef64d2a9037a7ae69dc76ac05 /core/java/android/view
parent40bacdf4843ac227b8a19cea47f4424138c8490f (diff)
parent24cafbc56cacfad42af375e7545de45ff500cdbe (diff)
downloadframeworks_base-3a407fad3554fe9567bb8769b060233b3efc0633.zip
frameworks_base-3a407fad3554fe9567bb8769b060233b3efc0633.tar.gz
frameworks_base-3a407fad3554fe9567bb8769b060233b3efc0633.tar.bz2
Merge "Fix HIDE_DESCENDANTS accessibility importance mode" into klp-dev
Diffstat (limited to 'core/java/android/view')
-rw-r--r--core/java/android/view/View.java104
1 files changed, 51 insertions, 53 deletions
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index caeb1d8..c45307b 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -1738,47 +1738,41 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
/**
* Masks for mPrivateFlags2, as generated by dumpFlags():
*
- * -------|-------|-------|-------|
- * PFLAG2_TEXT_ALIGNMENT_FLAGS[0]
- * PFLAG2_TEXT_DIRECTION_FLAGS[0]
- * 1 PFLAG2_DRAG_CAN_ACCEPT
- * 1 PFLAG2_DRAG_HOVERED
- * 1 PFLAG2_LAYOUT_DIRECTION_MASK_SHIFT
- * 11 PFLAG2_TEXT_DIRECTION_MASK_SHIFT
- * 1 1 PFLAG2_TEXT_DIRECTION_RESOLVED_MASK_SHIFT
- * 11 PFLAG2_LAYOUT_DIRECTION_MASK
- * 11 1 PFLAG2_TEXT_ALIGNMENT_MASK_SHIFT
- * 1 PFLAG2_LAYOUT_DIRECTION_RESOLVED_RTL
- * 1 1 PFLAG2_TEXT_ALIGNMENT_RESOLVED_MASK_SHIFT
- * 1 1 PFLAG2_IMPORTANT_FOR_ACCESSIBILITY_SHIFT
- * 1 PFLAG2_LAYOUT_DIRECTION_RESOLVED
- * 11 PFLAG2_LAYOUT_DIRECTION_RESOLVED_MASK
- * 1 PFLAG2_TEXT_DIRECTION_FLAGS[1]
- * 1 PFLAG2_TEXT_DIRECTION_FLAGS[2]
- * 11 PFLAG2_TEXT_DIRECTION_FLAGS[3]
- * 1 PFLAG2_TEXT_DIRECTION_FLAGS[4]
- * 1 1 PFLAG2_TEXT_DIRECTION_FLAGS[5]
- * 111 PFLAG2_TEXT_DIRECTION_MASK
- * 1 PFLAG2_TEXT_DIRECTION_RESOLVED
- * 1 PFLAG2_TEXT_DIRECTION_RESOLVED_DEFAULT
- * 111 PFLAG2_TEXT_DIRECTION_RESOLVED_MASK
- * 1 PFLAG2_TEXT_ALIGNMENT_FLAGS[1]
- * 1 PFLAG2_TEXT_ALIGNMENT_FLAGS[2]
- * 11 PFLAG2_TEXT_ALIGNMENT_FLAGS[3]
- * 1 PFLAG2_TEXT_ALIGNMENT_FLAGS[4]
- * 1 1 PFLAG2_TEXT_ALIGNMENT_FLAGS[5]
- * 11 PFLAG2_TEXT_ALIGNMENT_FLAGS[6]
- * 111 PFLAG2_TEXT_ALIGNMENT_MASK
- * 1 PFLAG2_TEXT_ALIGNMENT_RESOLVED
- * 1 PFLAG2_TEXT_ALIGNMENT_RESOLVED_DEFAULT
- * 111 PFLAG2_TEXT_ALIGNMENT_RESOLVED_MASK
- * 11 PFLAG2_IMPORTANT_FOR_ACCESSIBILITY_MASK
- * 1 PFLAG2_HAS_TRANSIENT_STATE
- * 1 PFLAG2_ACCESSIBILITY_FOCUSED
- * 1 PFLAG2_ACCESSIBILITY_STATE_CHANGED
- * 1 PFLAG2_VIEW_QUICK_REJECTED
- * 1 PFLAG2_PADDING_RESOLVED
- * -------|-------|-------|-------|
+ * |-------|-------|-------|-------|
+ * 1 PFLAG2_DRAG_CAN_ACCEPT
+ * 1 PFLAG2_DRAG_HOVERED
+ * 11 PFLAG2_LAYOUT_DIRECTION_MASK
+ * 1 PFLAG2_LAYOUT_DIRECTION_RESOLVED_RTL
+ * 1 PFLAG2_LAYOUT_DIRECTION_RESOLVED
+ * 11 PFLAG2_LAYOUT_DIRECTION_RESOLVED_MASK
+ * 1 PFLAG2_TEXT_DIRECTION_FLAGS[1]
+ * 1 PFLAG2_TEXT_DIRECTION_FLAGS[2]
+ * 11 PFLAG2_TEXT_DIRECTION_FLAGS[3]
+ * 1 PFLAG2_TEXT_DIRECTION_FLAGS[4]
+ * 1 1 PFLAG2_TEXT_DIRECTION_FLAGS[5]
+ * 111 PFLAG2_TEXT_DIRECTION_MASK
+ * 1 PFLAG2_TEXT_DIRECTION_RESOLVED
+ * 1 PFLAG2_TEXT_DIRECTION_RESOLVED_DEFAULT
+ * 111 PFLAG2_TEXT_DIRECTION_RESOLVED_MASK
+ * 1 PFLAG2_TEXT_ALIGNMENT_FLAGS[1]
+ * 1 PFLAG2_TEXT_ALIGNMENT_FLAGS[2]
+ * 11 PFLAG2_TEXT_ALIGNMENT_FLAGS[3]
+ * 1 PFLAG2_TEXT_ALIGNMENT_FLAGS[4]
+ * 1 1 PFLAG2_TEXT_ALIGNMENT_FLAGS[5]
+ * 11 PFLAG2_TEXT_ALIGNMENT_FLAGS[6]
+ * 111 PFLAG2_TEXT_ALIGNMENT_MASK
+ * 1 PFLAG2_TEXT_ALIGNMENT_RESOLVED
+ * 1 PFLAG2_TEXT_ALIGNMENT_RESOLVED_DEFAULT
+ * 111 PFLAG2_TEXT_ALIGNMENT_RESOLVED_MASK
+ * 111 PFLAG2_IMPORTANT_FOR_ACCESSIBILITY_MASK
+ * 11 PFLAG2_ACCESSIBILITY_LIVE_REGION_MASK
+ * 1 PFLAG2_ACCESSIBILITY_FOCUSED
+ * 1 PFLAG2_SUBTREE_ACCESSIBILITY_STATE_CHANGED
+ * 1 PFLAG2_VIEW_QUICK_REJECTED
+ * 1 PFLAG2_PADDING_RESOLVED
+ * 1 PFLAG2_DRAWABLE_RESOLVED
+ * 1 PFLAG2_HAS_TRANSIENT_STATE
+ * |-------|-------|-------|-------|
*/
/**
@@ -1876,15 +1870,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
static final int LAYOUT_DIRECTION_RESOLVED_DEFAULT = LAYOUT_DIRECTION_LTR;
/**
- * Indicates that the view is tracking some sort of transient state
- * that the app should not need to be aware of, but that the framework
- * should take special care to preserve.
- *
- * @hide
- */
- static final int PFLAG2_HAS_TRANSIENT_STATE = 0x1 << 22;
-
- /**
* Text direction is inherited thru {@link ViewGroup}
*/
public static final int TEXT_DIRECTION_INHERIT = 0;
@@ -2216,6 +2201,13 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
static final int PFLAG2_DRAWABLE_RESOLVED = 0x40000000;
/**
+ * Indicates that the view is tracking some sort of transient state
+ * that the app should not need to be aware of, but that the framework
+ * should take special care to preserve.
+ */
+ static final int PFLAG2_HAS_TRANSIENT_STATE = 0x80000000;
+
+ /**
* Group of bits indicating that RTL properties resolution is done.
*/
static final int ALL_RTL_PROPERTIES_RESOLVED = PFLAG2_LAYOUT_DIRECTION_RESOLVED |
@@ -7090,12 +7082,18 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* @see #IMPORTANT_FOR_ACCESSIBILITY_AUTO
*/
public void setImportantForAccessibility(int mode) {
- final boolean oldIncludeForAccessibility = includeForAccessibility();
- if (mode != getImportantForAccessibility()) {
+ final int oldMode = getImportantForAccessibility();
+ if (mode != oldMode) {
+ // If we're moving between AUTO and another state, we might not need
+ // to send a subtree changed notification. We'll store the computed
+ // importance, since we'll need to check it later to make sure.
+ final boolean maySkipNotify = oldMode == IMPORTANT_FOR_ACCESSIBILITY_AUTO
+ || mode == IMPORTANT_FOR_ACCESSIBILITY_AUTO;
+ final boolean oldIncludeForAccessibility = maySkipNotify && includeForAccessibility();
mPrivateFlags2 &= ~PFLAG2_IMPORTANT_FOR_ACCESSIBILITY_MASK;
mPrivateFlags2 |= (mode << PFLAG2_IMPORTANT_FOR_ACCESSIBILITY_SHIFT)
& PFLAG2_IMPORTANT_FOR_ACCESSIBILITY_MASK;
- if (oldIncludeForAccessibility != includeForAccessibility()) {
+ if (!maySkipNotify || oldIncludeForAccessibility != includeForAccessibility()) {
notifySubtreeAccessibilityStateChangedIfNeeded();
} else {
notifyViewAccessibilityStateChangedIfNeeded(