Skip to content

Commit 7a5f3e4

Browse files
sganovAndroid (Google) Code Review
authored andcommitted
Merge "Virtual nodes are always important for accessibility." into jb-dev
2 parents 28d9911 + 52a6237 commit 7a5f3e4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

core/java/android/view/accessibility/AccessibilityRecord.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,12 @@ public void setSource(View source) {
135135
*/
136136
public void setSource(View root, int virtualDescendantId) {
137137
enforceNotSealed();
138-
final boolean important = (root != null) ? root.isImportantForAccessibility() : true;
138+
final boolean important;
139+
if (virtualDescendantId == UNDEFINED) {
140+
important = (root != null) ? root.isImportantForAccessibility() : true;
141+
} else {
142+
important = true;
143+
}
139144
setBooleanProperty(PROPERTY_IMPORTANT_FOR_ACCESSIBILITY, important);
140145
mSourceWindowId = (root != null) ? root.getAccessibilityWindowId() : UNDEFINED;
141146
final int rootViewId = (root != null) ? root.getAccessibilityViewId() : UNDEFINED;

0 commit comments

Comments
 (0)