Automated import from //branches/donutburger/...@142723,142723
Jaikumar Ganesh [Thu, 26 Mar 2009 00:13:25 +0000 (17:13 -0700)]
src/com/android/phone/BluetoothHeadsetService.java

index 67ca2a8..fec992c 100644 (file)
@@ -594,12 +594,16 @@ public class BluetoothHeadsetService extends Service {
                              BluetoothHeadset.RESULT_CANCELED);
                     break;
                 case BluetoothHeadset.STATE_CONNECTED:
-                    // Send a message to force headset out of sniff mode so
-                    // that it will immediately notice the disconnection
+                    // Send a dummy battery level message to force headset
+                    // out of sniff mode so that it will immediately notice
+                    // the disconnection. We are currently sending it for
+                    // handsfree only.
                     // TODO: Call hci_conn_enter_active_mode() from
                     // rfcomm_send_disc() in the kernel instead.
                     // See http://b/1716887
-                    mHeadset.sendURC("OK");
+                    if (mHeadsetType == BluetoothHandsfree.TYPE_HANDSFREE) {
+                        mHeadset.sendURC("+CIEV: 7,3");
+                    }
 
                     if (mHeadset != null) {
                         mHeadset.disconnect();