summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Svetoslav Ganov <svetoslavganov@google.com> 2011-06-30 18:07:11 -0700
committer Android (Google) Code Review <android-gerrit@google.com> 2011-06-30 18:07:11 -0700
commit0e0c2043913af15f06b2307e908f231aea66ff10 (patch)
treebaa4ca901ab8d0804ff383465075524c84b52e97
parent77dd02df7113bce29ed34665b238d4b323565a38 (diff)
parentce5ee2dc8dec2a1369ceaad15a39d29909ed0172 (diff)
Merge "Crash observed when attempted to uncheck the Accessibility option."
-rw-r--r--core/java/android/view/ViewAncestor.java19
1 files changed, 12 insertions, 7 deletions
diff --git a/core/java/android/view/ViewAncestor.java b/core/java/android/view/ViewAncestor.java
index 2b692f3e93f1..d70c79850a18 100644
--- a/core/java/android/view/ViewAncestor.java
+++ b/core/java/android/view/ViewAncestor.java
@@ -4637,13 +4637,18 @@ public final class ViewAncestor extends Handler implements ViewParent,
public void run() {
if (mView != null) {
- // Send the event directly since we do not want to append the
- // source text because this is the text for the entire window
- // and we just want to notify that the content has changed.
- AccessibilityEvent event = AccessibilityEvent.obtain(
- AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED);
- mView.onInitializeAccessibilityEvent(event);
- AccessibilityManager.getInstance(mView.mContext).sendAccessibilityEvent(event);
+ // Check again for accessibility state since this is executed delayed.
+ AccessibilityManager accessibilityManager =
+ AccessibilityManager.getInstance(mView.mContext);
+ if (accessibilityManager.isEnabled()) {
+ // Send the event directly since we do not want to append the
+ // source text because this is the text for the entire window
+ // and we just want to notify that the content has changed.
+ AccessibilityEvent event = AccessibilityEvent.obtain(
+ AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED);
+ mView.onInitializeAccessibilityEvent(event);
+ accessibilityManager.sendAccessibilityEvent(event);
+ }
mIsPending = false;
}
}