Merge "Crash observed when attempted to uncheck the Accessibility option."
This commit is contained in:
committed by
Android (Google) Code Review
commit
0e0c204391
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user