Bug 881194 - [Bluetooth] Support AT+CHLD=3 in dom bluetooth. When "AT+CHLD=3" is received from a hands-free device, notify the Dialer app to "Add a held call to the conversation". r=echou

This commit is contained in:
Jamin Liu 2013-11-28 14:05:05 +08:00
Родитель 3d71878bfb
Коммит 4f634eea11
1 изменённых файлов: 6 добавлений и 3 удалений

Просмотреть файл

@ -832,7 +832,7 @@ BluetoothHfpManager::ReceiveSocketData(BluetoothSocket* aSocket,
mCurrentVgm = vgm; mCurrentVgm = vgm;
#ifdef MOZ_B2G_RIL #ifdef MOZ_B2G_RIL
} else if (msg.Find("AT+CHLD=?") != -1) { } else if (msg.Find("AT+CHLD=?") != -1) {
SendLine("+CHLD: (0,1,2)"); SendLine("+CHLD: (0,1,2,3)");
} else if (msg.Find("AT+CHLD=") != -1) { } else if (msg.Find("AT+CHLD=") != -1) {
ParseAtCommand(msg, 8, atCommandValues); ParseAtCommand(msg, 8, atCommandValues);
@ -849,9 +849,10 @@ BluetoothHfpManager::ReceiveSocketData(BluetoothSocket* aSocket,
* waiting) call * waiting) call
* AT+CHLD=2 - Places active calls on hold and accepts the other (held * AT+CHLD=2 - Places active calls on hold and accepts the other (held
* or waiting) call * or waiting) call
* AT+CHLD=3 - Adds a held call to the conversation.
* *
* The following cases are NOT supported yet: * The following cases are NOT supported yet:
* AT+CHLD=1<idx>, AT+CHLD=2<idx>, AT+CHLD=3, AT+CHLD=4 * AT+CHLD=1<idx>, AT+CHLD=2<idx>, AT+CHLD=4
* Please see 4.33.2 in Bluetooth hands-free profile 1.6 for more * Please see 4.33.2 in Bluetooth hands-free profile 1.6 for more
* information. * information.
*/ */
@ -860,7 +861,7 @@ BluetoothHfpManager::ReceiveSocketData(BluetoothSocket* aSocket,
if (atCommandValues[0].Length() > 1) { if (atCommandValues[0].Length() > 1) {
BT_WARNING("No index should be included in command [AT+CHLD]"); BT_WARNING("No index should be included in command [AT+CHLD]");
valid = false; valid = false;
} else if (chld == '3' || chld == '4') { } else if (chld == '4') {
BT_WARNING("The value of command [AT+CHLD] is not supported"); BT_WARNING("The value of command [AT+CHLD] is not supported");
valid = false; valid = false;
} else if (chld == '0') { } else if (chld == '0') {
@ -872,6 +873,8 @@ BluetoothHfpManager::ReceiveSocketData(BluetoothSocket* aSocket,
NotifyDialer(NS_LITERAL_STRING("CHLD=1")); NotifyDialer(NS_LITERAL_STRING("CHLD=1"));
} else if (chld == '2') { } else if (chld == '2') {
NotifyDialer(NS_LITERAL_STRING("CHLD=2")); NotifyDialer(NS_LITERAL_STRING("CHLD=2"));
} else if (chld == '3') {
NotifyDialer(NS_LITERAL_STRING("CHLD=3"));
} else { } else {
BT_WARNING("Wrong value of command [AT+CHLD]"); BT_WARNING("Wrong value of command [AT+CHLD]");
valid = false; valid = false;