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

Commit 2d199a7c authored by Phil Weaver's avatar Phil Weaver Committed by android-build-merger
Browse files

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

am: 4c5bd240

* commit '4c5bd240':
  Protect MotionEvent stream when a11y changes.
parents a2fafa5d 4c5bd240
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();