summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSailesh Nepal <sail@google.com>2014-07-10 18:15:15 -0700
committerSailesh Nepal <sail@google.com>2014-07-11 13:35:38 +0000
commit4dd9df58a6bf662264f0aebddfb14b850358f9b9 (patch)
treec912aae3e046d63998464131bea279dfb2b0c43f
parent7c940e94c97ce3c86f2d54ad567127fc11cc8074 (diff)
downloadframeworks_base-4dd9df58a6bf662264f0aebddfb14b850358f9b9.zip
frameworks_base-4dd9df58a6bf662264f0aebddfb14b850358f9b9.tar.gz
frameworks_base-4dd9df58a6bf662264f0aebddfb14b850358f9b9.tar.bz2
Fix exception in ConnectionServiceAdapter.binderDied
Bug: 16215975 Change-Id: I49e7c77c01f306995bb743523436c7620c48a568
-rw-r--r--telecomm/java/android/telecomm/ConnectionServiceAdapter.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/telecomm/java/android/telecomm/ConnectionServiceAdapter.java b/telecomm/java/android/telecomm/ConnectionServiceAdapter.java
index b60e7c6..f71544b 100644
--- a/telecomm/java/android/telecomm/ConnectionServiceAdapter.java
+++ b/telecomm/java/android/telecomm/ConnectionServiceAdapter.java
@@ -28,6 +28,7 @@ import com.android.internal.telecomm.RemoteServiceCallback;
import java.util.ArrayList;
import java.util.HashSet;
+import java.util.Iterator;
import java.util.List;
import java.util.Set;
@@ -61,9 +62,12 @@ final class ConnectionServiceAdapter implements DeathRecipient {
/** ${inheritDoc} */
@Override
public void binderDied() {
- for (IConnectionServiceAdapter adapter : mAdapters) {
+ Iterator<IConnectionServiceAdapter> it = mAdapters.iterator();
+ while (it.hasNext()) {
+ IConnectionServiceAdapter adapter = it.next();
if (!adapter.asBinder().isBinderAlive()) {
- removeAdapter(adapter);
+ it.remove();
+ adapter.asBinder().unlinkToDeath(this, 0);
}
}
}