Bug 881194 - [Bluetooth] Send +CIEV callheld for conference call. r=echou

This commit is contained in:
Jamin Liu 2013-12-16 08:37:33 -05:00
Родитель f43378e9ff
Коммит e6c9ee0f38
5 изменённых файлов: 30 добавлений и 11 удалений

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

@ -184,7 +184,7 @@ TelephonyListener::CallStateChanged(uint32_t aServiceId,
NS_ENSURE_TRUE(hfp, NS_ERROR_FAILURE);
hfp->HandleCallStateChanged(aCallIndex, aCallState, EmptyString(), aNumber,
aIsOutgoing, true);
aIsOutgoing, aIsConference, true);
return NS_OK;
}
@ -202,7 +202,7 @@ TelephonyListener::EnumerateCallState(uint32_t aServiceId,
NS_ENSURE_TRUE(hfp, NS_ERROR_FAILURE);
hfp->HandleCallStateChanged(aCallIndex, aCallState, EmptyString(), aNumber,
aIsOutgoing, false);
aIsOutgoing, aIsConference, false);
return NS_OK;
}
@ -222,7 +222,7 @@ TelephonyListener::NotifyError(uint32_t aServiceId,
// via setting CALL_STATE_DISCONNECTED
hfp->HandleCallStateChanged(aCallIndex,
nsITelephonyProvider::CALL_STATE_DISCONNECTED,
aError, EmptyString(), false, true);
aError, EmptyString(), false, false, true);
BT_WARNING("Reset the call state due to call transition ends abnormally");
}

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

@ -1047,6 +1047,7 @@ BluetoothHfpManager::HandleCallStateChanged(uint32_t aCallIndex,
const nsAString& aError,
const nsAString& aNumber,
const bool aIsOutgoing,
const bool aIsConference,
bool aSend)
{
if (!IsConnected()) {

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

@ -95,7 +95,8 @@ public:
*/
void HandleCallStateChanged(uint32_t aCallIndex, uint16_t aCallState,
const nsAString& aError, const nsAString& aNumber,
const bool aIsOutgoing, bool aSend);
const bool aIsOutgoing, const bool aIsConference,
bool aSend);
void HandleIccInfoChanged(uint32_t aClientId);
void HandleVoiceConnectionChanged(uint32_t aClientId);

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

@ -327,6 +327,7 @@ Call::Reset()
{
mState = nsITelephonyProvider::CALL_STATE_DISCONNECTED;
mDirection = false;
mIsConference = false;
mNumber.Truncate();
mType = TOA_UNKNOWN;
}
@ -753,7 +754,7 @@ BluetoothHfpManager::ReceiveSocketData(BluetoothSocket* aSocket,
// If we get internal request for SCO connection,
// setup SCO after Service Level Connection established.
if(mConnectScoRequest) {
if (mConnectScoRequest) {
mConnectScoRequest = false;
ConnectSco();
}
@ -1371,6 +1372,7 @@ BluetoothHfpManager::HandleCallStateChanged(uint32_t aCallIndex,
const nsAString& aError,
const nsAString& aNumber,
const bool aIsOutgoing,
const bool aIsConference,
bool aSend)
{
if (!IsConnected()) {
@ -1387,6 +1389,9 @@ BluetoothHfpManager::HandleCallStateChanged(uint32_t aCallIndex,
mCurrentCallArray[aCallIndex].mState = aCallState;
mCurrentCallArray[aCallIndex].mDirection = !aIsOutgoing;
bool prevCallIsConference = mCurrentCallArray[aCallIndex].mIsConference;
mCurrentCallArray[aCallIndex].mIsConference = aIsConference;
// Same logic as implementation in ril_worker.js
if (aNumber.Length() && aNumber[0] == '+') {
mCurrentCallArray[aCallIndex].mType = TOA_INTERNATIONAL;
@ -1465,13 +1470,23 @@ BluetoothHfpManager::HandleCallStateChanged(uint32_t aCallIndex,
UpdateCIND(CINDType::CALL, CallState::IN_PROGRESS, aSend);
UpdateCIND(CINDType::CALLSETUP, CallSetupState::NO_CALLSETUP, aSend);
break;
// User wants to add a held call to the conversation.
// The original connected call become a conference call here.
case nsITelephonyProvider::CALL_STATE_CONNECTED:
if (aIsConference) {
UpdateCIND(CINDType::CALLHELD, CallHeldState::NO_CALLHELD, aSend);
}
break;
case nsITelephonyProvider::CALL_STATE_HELD:
// The held call(s) become connected call(s).
if (!FindFirstCall(nsITelephonyProvider::CALL_STATE_HELD)
&& sCINDItems[CINDType::CALLHELD].value ==
CallHeldState::ONHOLD_NOACTIVE) {
if (!FindFirstCall(nsITelephonyProvider::CALL_STATE_HELD)) {
if (aIsConference && !prevCallIsConference) {
// The held call was merged and become a conference call.
UpdateCIND(CINDType::CALLHELD, CallHeldState::NO_CALLHELD, aSend);
} else if (sCINDItems[CINDType::CALLHELD].value ==
CallHeldState::ONHOLD_NOACTIVE) {
// The held call(s) become connected call(s).
UpdateCIND(CINDType::CALLHELD, CallHeldState::NO_CALLHELD, aSend);
}
}
break;

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

@ -68,6 +68,7 @@ public:
uint16_t mState;
bool mDirection; // true: incoming call; false: outgoing call
bool mIsConference;
nsString mNumber;
int mType;
};
@ -121,7 +122,8 @@ public:
*/
void HandleCallStateChanged(uint32_t aCallIndex, uint16_t aCallState,
const nsAString& aError, const nsAString& aNumber,
const bool aIsOutgoing, bool aSend);
const bool aIsOutgoing, const bool aIsConference,
bool aSend);
void HandleIccInfoChanged(uint32_t aClientId);
void HandleVoiceConnectionChanged(uint32_t aClientId);