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

Commit bc678305 authored by Uday Kiran jandhyala's avatar Uday Kiran jandhyala Committed by Gerrit - the friendly Code Review server
Browse files

AccessibilityManager: Handling IndexOutOfBoundsException

Though elements are added/removed in ArrayList in synchronized blocks,
there are corner cases where an IndexOutOfBoundsException is thrown

Change-Id: I348155b0fc719313d2c540ee2035a94ff718a7c6
parent 8e6ce499
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -642,7 +642,11 @@ public final class AccessibilityManager {
        }
        final int listenerCount = mAccessibilityStateChangeListeners.size();
        for (int i = 0; i < listenerCount; i++) {
            try {
                mAccessibilityStateChangeListeners.get(i).onAccessibilityStateChanged(isEnabled);
            } catch (IndexOutOfBoundsException e) {
                Log.e(LOG_TAG, "Error while notifying Accessibility State Change : " + e);
            }
        }
    }