Backed out changeset 736965f66934

This commit is contained in:
Eric Chou 2013-06-02 22:42:43 +08:00
Родитель ff1dcf936f
Коммит 134b84c4e7
1 изменённых файлов: 20 добавлений и 32 удалений

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

@ -1282,11 +1282,7 @@ BluetoothHfpManager::HandleCallStateChanged(uint32_t aCallIndex,
switch (aCallState) {
case nsITelephonyProvider::CALL_STATE_HELD:
if (!FindFirstCall(nsIRadioInterfaceLayer::CALL_STATE_CONNECTED)) {
sCINDItems[CINDType::CALLHELD].value = CallHeldState::ONHOLD_NOACTIVE;
} else {
sCINDItems[CINDType::CALLHELD].value = CallHeldState::ONHOLD_ACTIVE;
}
SendCommand("+CIEV: ", CINDType::CALLHELD);
break;
case nsITelephonyProvider::CALL_STATE_INCOMING:
@ -1344,11 +1340,7 @@ BluetoothHfpManager::HandleCallStateChanged(uint32_t aCallIndex,
UpdateCIND(CINDType::CALL, CallState::IN_PROGRESS, aSend);
UpdateCIND(CINDType::CALLSETUP, CallSetupState::NO_CALLSETUP, aSend);
break;
default:
NS_WARNING("Not handling state changed");
}
// = Handle callheld separately =
case nsITelephonyProvider::CALL_STATE_HELD:
// Besides checking if there is still held calls, another thing we
// need to consider is the state change when receiving AT+CHLD=2.
// Assume that there is one active call(c1) and one call on hold(c2).
@ -1358,12 +1350,14 @@ BluetoothHfpManager::HandleCallStateChanged(uint32_t aCallIndex,
// However we can't send callheld=0 at this time because we should
// see c2 -> ACTIVE + c1 -> HELD as one operation. That's the reason
// why I added the GetNumberOfCalls() condition check.
if (GetNumberOfCalls(nsIRadioInterfaceLayer::CALL_STATE_CONNECTED) == 1) {
if (FindFirstCall(nsIRadioInterfaceLayer::CALL_STATE_HELD)) {
UpdateCIND(CINDType::CALLHELD, CallHeldState::ONHOLD_ACTIVE, aSend);
} else if (currentCallState == nsIRadioInterfaceLayer::CALL_STATE_HELD) {
if (!FindFirstCall(nsITelephonyProvider::CALL_STATE_HELD) &&
GetNumberOfCalls(
nsITelephonyProvider::CALL_STATE_CONNECTED) == 1) {
UpdateCIND(CINDType::CALLHELD, CallHeldState::NO_CALLHELD, aSend);
}
break;
default:
NS_WARNING("Not handling state changed");
}
break;
case nsITelephonyProvider::CALL_STATE_DISCONNECTED:
@ -1384,19 +1378,13 @@ BluetoothHfpManager::HandleCallStateChanged(uint32_t aCallIndex,
UpdateCIND(CINDType::CALL, CallState::NO_CALL, aSend);
}
break;
case nsITelephonyProvider::CALL_STATE_HELD:
UpdateCIND(CINDType::CALLHELD, CallHeldState::NO_CALLHELD, aSend);
break;
default:
NS_WARNING("Not handling state changed");
}
// Handle held calls separately
if (!FindFirstCall(nsIRadioInterfaceLayer::CALL_STATE_HELD)) {
UpdateCIND(CINDType::CALLHELD, CallHeldState::NO_CALLHELD, aSend);
} else if (!FindFirstCall(nsIRadioInterfaceLayer::CALL_STATE_CONNECTED)) {
UpdateCIND(CINDType::CALLHELD, CallHeldState::ONHOLD_NOACTIVE, aSend);
} else {
UpdateCIND(CINDType::CALLHELD, CallHeldState::ONHOLD_ACTIVE, aSend);
}
// -1 is necessary because call 0 is an invalid (padding) call object.
if (mCurrentCallArray.Length() - 1 ==
GetNumberOfCalls(nsITelephonyProvider::CALL_STATE_DISCONNECTED)) {