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

Commit 9dafebb8 authored by Svetoslav's avatar Svetoslav
Browse files

Correctly update the source of recurring subtree change accessibility events.

Change-Id: I0b0fd9224a5208b274e5c889a27417ef13579849
parent 9829016e
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -6442,15 +6442,18 @@ public final class ViewRootImpl implements ViewParent,

        public void runOrPost(View source) {
            if (mSource != null) {
                mSource = getCommonPredecessor(mSource, source);
                // If there is no common predecessor, then mSource points to
                // a removed view, hence in this case always prefer the source.
                View predecessor = getCommonPredecessor(mSource, source);
                mSource = (predecessor != null) ? predecessor : source;
                return;
            }
            mSource = source;
            final long timeSinceLastMillis = SystemClock.uptimeMillis() - mLastEventTimeMillis;
            final long minEventIntevalMillis =
                    ViewConfiguration.getSendRecurringAccessibilityEventsInterval();
            mSource.removeCallbacks(this);
            if (timeSinceLastMillis >= minEventIntevalMillis) {
                mSource.removeCallbacks(this);
                run();
            } else {
                mSource.postDelayed(this, minEventIntevalMillis - timeSinceLastMillis);