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

Commit 65a9e93c authored by Brad Ebinger's avatar Brad Ebinger Committed by android-build-merger
Browse files

Don't remove elements while using foreach

am: e680e662

Change-Id: I55da207c92542a2860098bd3f955d64c1c84f4eb
parents d532ef0f e680e662
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -69,6 +69,7 @@ import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@@ -737,9 +738,10 @@ public class CallsManager extends Call.ListenerBase
        // Check to see if we can reuse any of the calls that are waiting to disconnect.
        // See {@link Call#abort} and {@link #onCanceledViaNewOutgoingCall} for more information.
        Call reusedCall = null;
        for (Call pendingCall : mPendingCallsToDisconnect) {
        for (Iterator<Call> callIter = mPendingCallsToDisconnect.iterator(); callIter.hasNext();) {
            Call pendingCall = callIter.next();
            if (reusedCall == null && areHandlesEqual(pendingCall.getHandle(), handle)) {
                mPendingCallsToDisconnect.remove(pendingCall);
                callIter.remove();
                Log.i(this, "Reusing disconnected call %s", pendingCall);
                reusedCall = pendingCall;
            } else {