Merge "Crash observed when attempted to uncheck the Accessibility option."

This commit is contained in:
Svetoslav Ganov
2011-06-30 18:07:11 -07:00
committed by Android (Google) Code Review

View File

@@ -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;
}
}