Bug 883505 - [Bluetooth] Support for CHLD=0 of HFP, r=echou

This commit is contained in:
Ben Tian 2013-06-18 15:42:10 +08:00
parent 5553fb610e
commit f0e4b1fc60

View File

@ -837,7 +837,7 @@ BluetoothHfpManager::ReceiveSocketData(BluetoothSocket* aSocket,
NS_ASSERTION(vgm >= 0 && vgm <= 15, "Received invalid VGM value");
mCurrentVgm = vgm;
} else if (msg.Find("AT+CHLD=?") != -1) {
SendLine("+CHLD: (1,2)");
SendLine("+CHLD: (0,1,2)");
} else if (msg.Find("AT+CHLD=") != -1) {
ParseAtCommand(msg, 8, atCommandValues);
@ -847,14 +847,16 @@ BluetoothHfpManager::ReceiveSocketData(BluetoothSocket* aSocket,
}
/**
* The following two cases are supported:
* The following three cases are supported:
* AT+CHLD=0 - Releases all held calls or sets User Determined User Busy
* (UDUB) for a waiting call
* AT+CHLD=1 - Releases active calls and accepts the other (held or
* waiting) call
* AT+CHLD=2 - Places active calls on hold and accepts the other (held
* or waiting) call
*
* The following cases are NOT supported yet:
* AT+CHLD=0, AT+CHLD=1<idx>, AT+CHLD=2<idx>, AT+CHLD=3, AT+CHLD=4
* AT+CHLD=1<idx>, AT+CHLD=2<idx>, AT+CHLD=3, AT+CHLD=4
* Please see 4.33.2 in Bluetooth hands-free profile 1.6 for more
* information.
*/
@ -863,9 +865,14 @@ BluetoothHfpManager::ReceiveSocketData(BluetoothSocket* aSocket,
if (atCommandValues[0].Length() > 1) {
NS_WARNING("No index should be included in command [AT+CHLD]");
valid = false;
} else if (chld == '0' || chld == '3' || chld == '4') {
} else if (chld == '3' || chld == '4') {
NS_WARNING("The value of command [AT+CHLD] is not supported");
valid = false;
} else if (chld == '0') {
// We need to rename these dialer commands for better readability
// and expandability.
// See bug 884190 for more information.
NotifyDialer(NS_LITERAL_STRING("CHLD=0"));
} else if (chld == '1') {
NotifyDialer(NS_LITERAL_STRING("CHUP+ATA"));
} else if (chld == '2') {