OSDN Git Service

Remove calls when device gets disconnected
authorSanket Agarwal <sanketa@google.com>
Mon, 20 Jun 2016 23:20:28 +0000 (16:20 -0700)
committerSanket Agarwal <sanketa@google.com>
Fri, 28 Oct 2016 16:08:46 +0000 (16:08 +0000)
Bug: b/29170324
Change-Id: I4e9ae948801f80d8f22fb737812e1ed403077bff
(cherry picked from commit 8b2711a9c8537df86e73a0d01b9c3f737f29c643)

src/com/android/bluetooth/hfpclient/connserv/HfpClientConnectionService.java

index a5b7024..8b6c2e5 100644 (file)
@@ -430,10 +430,11 @@ public class HfpClientConnectionService extends ConnectionService {
         }
     }
 
-    private void disconnectAll() {
+    private synchronized void disconnectAll() {
         for (HfpClientConnection connection : mConnections.values()) {
             connection.onHfpDisconnected();
         }
+        mConnections.clear();
         if (mConference != null) {
             mConference.destroy();
             mConference = null;