Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ce5ee2dc authored by Svetoslav Ganov's avatar Svetoslav Ganov
Browse files

Crash observed when attempted to uncheck the Accessibility option.

1. Accessibility events for change in the window content are sent
   with a delay and code performing the send does not check the
   accessibilitys state before sending the event.

bug:4980754

Change-Id: Ice68037ebab9c5dcd0dece927765585e13959c0c
parent 16efb101
Loading
Loading
Loading
Loading
+12 −7
Original line number Diff line number Diff line
@@ -4637,13 +4637,18 @@ public final class ViewAncestor extends Handler implements ViewParent,

        public void run() {
            if (mView != null) {
                // 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.getInstance(mView.mContext).sendAccessibilityEvent(event);
                    accessibilityManager.sendAccessibilityEvent(event);
                }
                mIsPending = false;
            }
        }