mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
Bug 1096194 - Responding Enhanced call control with ERROR if enhanced call control is not supported, r=btian
This commit is contained in:
parent
a3ba9b4cb5
commit
042f661de2
@ -65,6 +65,12 @@ IsValidDtmf(const char aChar) {
|
||||
(aChar >= 'A' && aChar <= 'D');
|
||||
}
|
||||
|
||||
static bool
|
||||
IsSupportedChld(const int aChld) {
|
||||
// We currently only support CHLD=0~3.
|
||||
return (aChld >= 0 && aChld <= 3);
|
||||
}
|
||||
|
||||
class BluetoothHfpManager::GetVolumeTask : public nsISettingsServiceCallback
|
||||
{
|
||||
public:
|
||||
@ -1420,6 +1426,13 @@ BluetoothHfpManager::CallHoldNotification(BluetoothHandsfreeCallHoldType aChld)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
if (!IsSupportedChld((int)aChld)) {
|
||||
// We currently don't support Enhanced Call Control.
|
||||
// AT+CHLD=1x and AT+CHLD=2x will be ignored
|
||||
SendResponse(HFP_AT_RESPONSE_ERROR);
|
||||
return;
|
||||
}
|
||||
|
||||
SendResponse(HFP_AT_RESPONSE_OK);
|
||||
|
||||
nsAutoCString message("CHLD=");
|
||||
|
@ -62,6 +62,12 @@ IsValidDtmf(const char aChar) {
|
||||
(aChar >= 'A' && aChar <= 'D');
|
||||
}
|
||||
|
||||
static bool
|
||||
IsSupportedChld(const int aChld) {
|
||||
// We currently only support CHLD=0~3.
|
||||
return (aChld >= 0 && aChld <= 3);
|
||||
}
|
||||
|
||||
class BluetoothHfpManager::GetVolumeTask MOZ_FINAL : public nsISettingsServiceCallback
|
||||
{
|
||||
public:
|
||||
@ -1411,6 +1417,13 @@ BluetoothHfpManager::CallHoldNotification(BluetoothHandsfreeCallHoldType aChld)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
if (!IsSupportedChld((int)aChld)) {
|
||||
// We currently don't support Enhanced Call Control.
|
||||
// AT+CHLD=1x and AT+CHLD=2x will be ignored
|
||||
SendResponse(HFP_AT_RESPONSE_ERROR);
|
||||
return;
|
||||
}
|
||||
|
||||
SendResponse(HFP_AT_RESPONSE_OK);
|
||||
|
||||
nsAutoCString message("CHLD=");
|
||||
|
Loading…
Reference in New Issue
Block a user