summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSvetoslav Ganov <svetoslavganov@google.com>2012-10-10 21:25:55 -0700
committerSvetoslav Ganov <svetoslavganov@google.com>2012-10-10 21:25:59 -0700
commitb708f7703b98e14f01311dbc93e2636abe4790c9 (patch)
tree762258f7fee4b4a2eeadefd97f10f8b68187dcec
parent251445667ce045c4425c10fb24e3e23f90a210c0 (diff)
downloadframeworks_base-b708f7703b98e14f01311dbc93e2636abe4790c9.zip
frameworks_base-b708f7703b98e14f01311dbc93e2636abe4790c9.tar.gz
frameworks_base-b708f7703b98e14f01311dbc93e2636abe4790c9.tar.bz2
Send accessibility event for content change upon setting content description.
1. Since the content description is generated dynamically we need to notify clients when it changes so they can drop cached state to get the most recent content. This really is used by the caching we do to optimize the window query APIs. Otherwise, the user does not see the current content. bug:7327556 Change-Id: I9be46508e86864566e027c64565eb1d787ec9363
-rw-r--r--core/java/android/view/View.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 0d76eac..6eafc57 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -5214,11 +5214,19 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
*/
@RemotableViewMethod
public void setContentDescription(CharSequence contentDescription) {
+ if (mContentDescription == null) {
+ if (contentDescription == null) {
+ return;
+ }
+ } else if (mContentDescription.equals(contentDescription)) {
+ return;
+ }
mContentDescription = contentDescription;
final boolean nonEmptyDesc = contentDescription != null && contentDescription.length() > 0;
if (nonEmptyDesc && getImportantForAccessibility() == IMPORTANT_FOR_ACCESSIBILITY_AUTO) {
setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_YES);
}
+ notifyAccessibilityStateChanged();
}
/**