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

Commit 4c5bd240 authored by Phil Weaver's avatar Phil Weaver Committed by Android (Google) Code Review
Browse files

Merge "Protect MotionEvent stream when a11y changes." into nyc-dev

parents d94469ba e7b19835
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -275,6 +275,9 @@ class AccessibilityInputFilter extends InputFilter implements EventStreamTransfo

    private void processBatchedEvents(long frameNanos) {
        MotionEventHolder current = mEventQueue;
        if (current == null) {
            return;
        }
        while (current.next != null) {
            current = current.next;
        }
@@ -403,6 +406,9 @@ class AccessibilityInputFilter extends InputFilter implements EventStreamTransfo
    }

    private void disableFeatures() {
        // Give the features a chance to process any batched events so we'll keep a consistent
        // event stream
        processBatchedEvents(Long.MAX_VALUE);
        if (mMotionEventInjector != null) {
            mAms.setMotionEventInjector(null);
            mMotionEventInjector.onDestroy();