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

Commit ebc886c8 authored by Hung-ying Tyan's avatar Hung-ying Tyan
Browse files

Fix SipSessionGroup from throwing ConcurrentModificationException

http://b/issue?id=3087256

Change-Id: I67df64105db7c1295649f1f3ce77f99025ce3d44
parent 4367ab00
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -153,7 +153,13 @@ class SipSessionGroup implements SipListener {
    }

    synchronized void onConnectivityChanged() {
        for (SipSessionImpl s : mSessionMap.values()) {
        SipSessionImpl[] ss = mSessionMap.values().toArray(
                    new SipSessionImpl[mSessionMap.size()]);
        // Iterate on the copied array instead of directly on mSessionMap to
        // avoid ConcurrentModificationException being thrown when
        // SipSessionImpl removes itself from mSessionMap in onError() in the
        // following loop.
        for (SipSessionImpl s : ss) {
            s.onError(SipErrorCode.DATA_CONNECTION_LOST,
                    "data connection lost");
        }