Bug 848414 - Reply with ERROR to unknown AT commands, r=gyeh

This commit is contained in:
Eric Chou 2013-03-12 13:46:43 +08:00
Родитель 87079a3d76
Коммит 5a4282cf8c
1 изменённых файлов: 5 добавлений и 10 удалений

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

@ -857,15 +857,6 @@ BluetoothHfpManager::ReceiveSocketData(nsAutoPtr<UnixSocketRawData>& aMessage)
// Currently, we don't support memory dialing in Dialer app
SendLine("ERROR");
return;
} else if ((msg.Find("AT+XAPL=") != -1) ||
(msg.Find("AT+XEVENT=") != -1)) {
// FIXME: Bug 838089
// These are vendor commands used on some special headsets. Eventually we
// should reply with ERROR to all unknown incoming commands. However,
// in order not to cause interoperability issues for b2g18 branch, only
// filtering these two commands should be fine for now.
SendLine("ERROR");
return;
} else if (msg.Find("AT+CLCC") != -1) {
SendCommand("+CLCC: ");
} else if (msg.Find("ATD") != -1) {
@ -925,9 +916,13 @@ BluetoothHfpManager::ReceiveSocketData(nsAutoPtr<UnixSocketRawData>& aMessage)
}
} else {
nsCString warningMsg;
warningMsg.AssignLiteral("Not handling HFP message, reply ok: ");
warningMsg.Append(NS_LITERAL_CSTRING("Unsupported AT command: "));
warningMsg.Append(msg);
warningMsg.Append(NS_LITERAL_CSTRING(", reply with ERROR"));
NS_WARNING(warningMsg.get());
SendLine("ERROR");
return;
}
respond_with_ok: