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

Commit 85b598be authored by Charles Chen's avatar Charles Chen
Browse files

Fixing bug #2023024 - there is an out of bounds exception that

can happen if services are going away as the AccessibilityManagerService
is trying to dispatch notifications to these services. Catching this
exception and bailing because having this exception means that there
are no more services around that need to get this notification.
parent f4dc9da3
Loading
Loading
Loading
Loading
+13 −6
Original line number Diff line number Diff line
@@ -323,6 +323,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
     */
    private void notifyAccessibilityServicesDelayedLocked(AccessibilityEvent event,
            boolean isDefault) {
        try {
            for (int i = 0, count = mServices.size(); i < count; i++) {
                Service service = mServices.get(i);

@@ -333,6 +334,12 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
                    }
                }
            }
        } catch (IndexOutOfBoundsException oobe) {
            // An out of bounds exception can happen if services are going away
            // as the for loop is running. If that happens, just bail because
            // there are no more services to notify.
            return;
        }
    }

    /**