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

Commit bf9a8ca2 authored by Vladislav Kuzkokov's avatar Vladislav Kuzkokov
Browse files

Fix against accessibility event callback calling itself.

Bug: 62102349
Change-Id: I35c13505c5fb7f0004bd2d3cba8db9850ada1060
parent b562e539
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;
        }