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

Commit 9c71716e authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change 9063 into donut

* changes:
  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.
parents 65e5438d 85b598be
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;
        }
    }

    /**