PTS Certification issue: AT+CHLD should be followed by OK, before
CIEV commands are send out.

We were sending commands in DISCONNECTING state itself, and this
was causing problems with PTS and possibly with some headsets in
multi call scenarios.

Based on a report and patch by: Shawn.C_Huang@htc.com

Bug: 2777410
Change-Id: I8e6e8104f6f795e43cadaed121c01ff372efe2e4
diff --git a/src/com/android/phone/BluetoothHandsfree.java b/src/com/android/phone/BluetoothHandsfree.java
index ff2ead8..79a840b 100644
--- a/src/com/android/phone/BluetoothHandsfree.java
+++ b/src/com/android/phone/BluetoothHandsfree.java
@@ -697,6 +697,13 @@
                 audioOn();
                 mAudioPossible = true;
                 break;
+            case DISCONNECTING:
+                // This is a transient state, we don't want to send
+                // any AT commands during this state.
+                call = mCall;
+                callsetup = mCallsetup;
+                callheld = mCallheld;
+                break;
             default:
                 mAudioPossible = false;
             }
@@ -706,6 +713,13 @@
             case WAITING:
                 callsetup = 1;
                 break;
+            case DISCONNECTING:
+                // This is a transient state, we don't want to send
+                // any AT commands during this state.
+                call = mCall;
+                callsetup = mCallsetup;
+                callheld = mCallheld;
+                break;
             }
 
             switch(mBackgroundCall.getState()) {
@@ -717,6 +731,13 @@
                     callheld = 2;
                 }
                 break;
+            case DISCONNECTING:
+                // This is a transient state, we don't want to send
+                // any AT commands during this state.
+                call = mCall;
+                callsetup = mCallsetup;
+                callheld = mCallheld;
+                break;
             }
 
             if (mCall != call) {