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

Commit 90a16463 authored by Vladislav Kuzkokov's avatar Vladislav Kuzkokov Committed by Android (Google) Code Review
Browse files

Merge "Fix against accessibility event callback calling itself."

parents 2fd233a1 bf9a8ca2
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -7874,19 +7874,21 @@ public final class ViewRootImpl implements ViewParent,

        @Override
        public void run() {
            // mSource may be changed in calls below.
            View source = mSource;
            mSource = null;
            // The accessibility may be turned off while we were waiting so check again.
            if (AccessibilityManager.getInstance(mContext).isEnabled()) {
                mLastEventTimeMillis = SystemClock.uptimeMillis();
                AccessibilityEvent event = AccessibilityEvent.obtain();
                event.setEventType(AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED);
                event.setContentChangeTypes(mChangeTypes);
                mSource.sendAccessibilityEventUnchecked(event);
                source.sendAccessibilityEventUnchecked(event);
            } else {
                mLastEventTimeMillis = 0;
            }
            // In any case reset to initial state.
            mSource.resetSubtreeAccessibilityStateChanged();
            mSource = null;
            source.resetSubtreeAccessibilityStateChanged();
            mChangeTypes = 0;
        }