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

Commit 5c749b82 authored by Phil Weaver's avatar Phil Weaver Committed by android-build-merger
Browse files

Merge \"Suppress exceptions for corner-case a11y events.\" into nyc-mr1-dev

am: 39abe33b

Change-Id: If169e5ab2a6241e6df720fa427a9eaee61d3cdc8
parents 06a96735 39abe33b
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -305,7 +305,18 @@ public final class AccessibilityManager {
                return;
            }
            if (!mIsEnabled) {
                throw new IllegalStateException("Accessibility off. Did you forget to check that?");
                Looper myLooper = Looper.myLooper();
                if (myLooper == Looper.getMainLooper()) {
                    throw new IllegalStateException(
                            "Accessibility off. Did you forget to check that?");
                } else {
                    // If we're not running on the thread with the main looper, it's possible for
                    // the state of accessibility to change between checking isEnabled and
                    // calling this method. So just log the error rather than throwing the
                    // exception.
                    Log.e(LOG_TAG, "AccessibilityEvent sent with accessibility disabled");
                    return;
                }
            }
            userId = mUserId;
        }