am 907f6f1d: Merge "Fix SipSessionGroup from throwing ConcurrentModificationException" into gingerbread
Merge commit '907f6f1d7d13531015b545861b93e1607d253cfd' into gingerbread-plus-aosp * commit '907f6f1d7d13531015b545861b93e1607d253cfd': Fix SipSessionGroup from throwing ConcurrentModificationException
This commit is contained in:
@@ -153,7 +153,13 @@ class SipSessionGroup implements SipListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
synchronized void onConnectivityChanged() {
|
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,
|
s.onError(SipErrorCode.DATA_CONNECTION_LOST,
|
||||||
"data connection lost");
|
"data connection lost");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user