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

Commit 1def104d authored by Muhammed Siju's avatar Muhammed Siju Committed by Deepak Kundra
Browse files

IMS: Fix ConcurrentModification exception during SRVCC.

Removing ho connection while iterating through connection
list throws ConcurrentModification Exception. Use Iterator.remove()
to fix this.

Remove the matched ho connection from the handover connections
list before doing state check.

Change-Id: Idb7bc48a22923db2c9bbe0fcd6f26d8fdbc0708f
CRs-Fixed: 809936
parent 1eb4567d
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@ import com.android.internal.telephony.imsphone.ImsPhoneConnection;
import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;


@@ -715,10 +716,12 @@ public final class CdmaCallTracker extends CallTracker {
        }

        /* Disconnect any pending Handover connections */
        for (Connection hoConnection : mHandoverConnections) {
            log("handlePollCalls - disconnect hoConn= " + hoConnection.toString());
        for (Iterator<Connection> it = mHandoverConnections.iterator();
                it.hasNext();) {
            Connection hoConnection = it.next();
            log("handlePollCalls - disconnect hoConn= " + hoConnection);
            ((ImsPhoneConnection)hoConnection).onDisconnect(DisconnectCause.NOT_VALID);
            mHandoverConnections.remove(hoConnection);
            it.remove();
        }

        // Any non-local disconnects: determine cause
+6 −3
Original line number Diff line number Diff line
@@ -497,6 +497,7 @@ public final class GsmCallTracker extends CallTracker {
                    if (hoConnection != null) {
                        // Single Radio Voice Call Continuity (SRVCC) completed
                        mConnections[i].migrateFrom(hoConnection);
                        mHandoverConnections.remove(hoConnection);
                        for (Iterator<Connection> it = mHandoverConnections.iterator();
                            it.hasNext();) {
                            Connection c = it.next();
@@ -625,10 +626,12 @@ public final class GsmCallTracker extends CallTracker {
        }

        /* Disconnect any pending Handover connections */
        for (Connection hoConnection : mHandoverConnections) {
            log("handlePollCalls - disconnect hoConn= " + hoConnection.toString());
        for (Iterator<Connection> it = mHandoverConnections.iterator();
                it.hasNext();) {
            Connection hoConnection = it.next();
            log("handlePollCalls - disconnect hoConn= " + hoConnection);
            ((ImsPhoneConnection)hoConnection).onDisconnect(DisconnectCause.NOT_VALID);
            mHandoverConnections.remove(hoConnection);
            it.remove();
        }

        // Any non-local disconnects: determine cause