Skip to content

Commit 9aefa14

Browse files
sganovAndroid (Google) Code Review
authored andcommitted
Merge "Send accessibility event for content change upon setting content description." into jb-mr1-dev
2 parents 092ad66 + b708f77 commit 9aefa14

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

core/java/android/view/View.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5214,11 +5214,19 @@ public CharSequence getContentDescription() {
52145214
*/
52155215
@RemotableViewMethod
52165216
public void setContentDescription(CharSequence contentDescription) {
5217+
if (mContentDescription == null) {
5218+
if (contentDescription == null) {
5219+
return;
5220+
}
5221+
} else if (mContentDescription.equals(contentDescription)) {
5222+
return;
5223+
}
52175224
mContentDescription = contentDescription;
52185225
final boolean nonEmptyDesc = contentDescription != null && contentDescription.length() > 0;
52195226
if (nonEmptyDesc && getImportantForAccessibility() == IMPORTANT_FOR_ACCESSIBILITY_AUTO) {
52205227
setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_YES);
52215228
}
5229+
notifyAccessibilityStateChanged();
52225230
}
52235231

52245232
/**

0 commit comments

Comments
 (0)