OSDN Git Service

HF should wait for AG to change conference
authorSanket Agarwal <sanketa@google.com>
Wed, 6 Jul 2016 21:56:13 +0000 (14:56 -0700)
committerSanket Agarwal <sanketa@google.com>
Fri, 28 Oct 2016 20:05:05 +0000 (20:05 +0000)
We should always wait for AG to make changes to the call before we show
it to the user so that the UI does not get confusing (inconsistent).
Currently we are not waiting for the conf. call to be
disconnected/established by AG before we show this on our end.

Bug: b/29898872
Change-Id: Ia9198958122e9e539fb6f2a6f08942d3174ae2fc
(cherry picked from commit de8d996c5eb073949210f53b739ef12c2c3054ee)

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

index 767bd86..bd143b1 100644 (file)
@@ -50,7 +50,6 @@ public class HfpClientConference extends Conference {
     public void onDisconnect() {
         Log.d(TAG, "onDisconnect");
         mHeadsetProfile.terminateCall(mDevice, null);
-        setDisconnected(new DisconnectCause(DisconnectCause.LOCAL));
     }
 
     @Override
index a587362..c993685 100644 (file)
@@ -31,6 +31,7 @@ import android.os.Handler;
 import android.telecom.Connection;
 import android.telecom.ConnectionRequest;
 import android.telecom.ConnectionService;
+import android.telecom.DisconnectCause;
 import android.telecom.PhoneAccount;
 import android.telecom.PhoneAccountHandle;
 import android.telecom.TelecomManager;
@@ -377,9 +378,7 @@ public class HfpClientConnectionService extends ConnectionService {
         if (mConference == null) {
             BluetoothDevice device = getDevice(getHandle());
             mConference = new HfpClientConference(getHandle(), device, mHeadsetProfile);
-            addConference(mConference);
         }
-        mConference.setActive();
         if (connection1.getConference() == null) {
             mConference.addConnection(connection1);
         }
@@ -432,6 +431,7 @@ public class HfpClientConnectionService extends ConnectionService {
             if (DBG) {
                 Log.d(TAG, "Conference has no connection, destroying");
             }
+            mConference.setDisconnected(new DisconnectCause(DisconnectCause.LOCAL));
             mConference.destroy();
             mConference = null;
         }