Bluetooth: Handle CHLD cmd properly incase of Held call

This change will handle the CHLD command properly incase of
Incomming call when there is already active Held call.

Change-Id: Iccb059d71fafb6f4fa3195b8393b8462e4bcff32
diff --git a/src/com/android/phone/BluetoothPhoneService.java b/src/com/android/phone/BluetoothPhoneService.java
index cd9c696..4255634 100644
--- a/src/com/android/phone/BluetoothPhoneService.java
+++ b/src/com/android/phone/BluetoothPhoneService.java
@@ -730,6 +730,10 @@
                     }
                     return true;
                 } else if (phoneType == PhoneConstants.PHONE_TYPE_GSM) {
+                    if (ringingCall.isRinging() && (mNumHeld > 0 && mNumActive == 0)) {
+                       if (VDBG) log("CHLD:1 Answer the Call");
+                       return PhoneUtils.answerCall(ringingCall);
+                    }
                     // Hangup active call, answer held call
                     return PhoneUtils.answerAndEndActive(PhoneGlobals.getInstance().mCM, ringingCall);
                 } else {
@@ -762,7 +766,11 @@
                     Log.e(TAG, "CDMA fail to do hold active and accept held");
                     return false;
                 } else if (phoneType == PhoneConstants.PHONE_TYPE_GSM) {
-                    PhoneUtils.switchHoldingAndActive(backgroundCall);
+                    if (ringingCall.isRinging() && (mNumHeld > 0 && mNumActive == 0)) {
+                       PhoneUtils.answerCall(ringingCall);
+                    } else {
+                       PhoneUtils.switchHoldingAndActive(backgroundCall);
+                    }
                     return true;
                 } else {
                     Log.e(TAG, "Unexpected phone type: " + phoneType);