diff options
| author | Hung-ying Tyan <tyanh@google.com> | 2010-10-14 15:29:35 -0700 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2010-10-14 15:29:35 -0700 |
| commit | 379694f528cbf947b4dbe3fecffced4162cc74e4 (patch) | |
| tree | 2a0fc9c4c04c06f8e99eadadcb8c41423c223730 /voip/java | |
| parent | 45a2033ce9831cb2de0ee924519c768b496510ae (diff) | |
| parent | 06e559779edd93a83100824b36c9bf67a27db178 (diff) | |
| download | frameworks_base-379694f528cbf947b4dbe3fecffced4162cc74e4.zip frameworks_base-379694f528cbf947b4dbe3fecffced4162cc74e4.tar.gz frameworks_base-379694f528cbf947b4dbe3fecffced4162cc74e4.tar.bz2 | |
am 06e55977: am 907f6f1d: Merge "Fix SipSessionGroup from throwing ConcurrentModificationException" into gingerbread
Merge commit '06e559779edd93a83100824b36c9bf67a27db178'
* commit '06e559779edd93a83100824b36c9bf67a27db178':
Fix SipSessionGroup from throwing ConcurrentModificationException
Diffstat (limited to 'voip/java')
| -rw-r--r-- | voip/java/com/android/server/sip/SipSessionGroup.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/voip/java/com/android/server/sip/SipSessionGroup.java b/voip/java/com/android/server/sip/SipSessionGroup.java index 57b3710..b5f8d39 100644 --- a/voip/java/com/android/server/sip/SipSessionGroup.java +++ b/voip/java/com/android/server/sip/SipSessionGroup.java @@ -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"); } |
