mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-16 13:56:29 +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');
|
(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
|
class BluetoothHfpManager::GetVolumeTask : public nsISettingsServiceCallback
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -1420,6 +1426,13 @@ BluetoothHfpManager::CallHoldNotification(BluetoothHandsfreeCallHoldType aChld)
|
|||||||
{
|
{
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
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);
|
SendResponse(HFP_AT_RESPONSE_OK);
|
||||||
|
|
||||||
nsAutoCString message("CHLD=");
|
nsAutoCString message("CHLD=");
|
||||||
|
@ -62,6 +62,12 @@ IsValidDtmf(const char aChar) {
|
|||||||
(aChar >= 'A' && aChar <= 'D');
|
(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
|
class BluetoothHfpManager::GetVolumeTask MOZ_FINAL : public nsISettingsServiceCallback
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -1411,6 +1417,13 @@ BluetoothHfpManager::CallHoldNotification(BluetoothHandsfreeCallHoldType aChld)
|
|||||||
{
|
{
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
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);
|
SendResponse(HFP_AT_RESPONSE_OK);
|
||||||
|
|
||||||
nsAutoCString message("CHLD=");
|
nsAutoCString message("CHLD=");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user