Bug 1061210 - Update conference group after enumerateCall. r=hsinyi

--HG--
extra : rebase_source : 31916415de67bdefed6c7d01a8f9412bd195301e
This commit is contained in:
Szu-Yu Chen [:aknow] 2014-09-04 00:45:00 -04:00
parent b91ac242ef
commit 8f1b48ab38

View File

@ -575,6 +575,21 @@ Telephony::EnumerateCallStateComplete()
{
MOZ_ASSERT(!mEnumerated);
// Set conference state.
if (mGroup->CallsArray().Length() >= 2) {
const nsTArray<nsRefPtr<TelephonyCall> > &calls = mGroup->CallsArray();
uint16_t callState = calls[0]->CallState();
for (uint32_t i = 1; i < calls.Length(); i++) {
if (calls[i]->CallState() != callState) {
callState = nsITelephonyService::CALL_STATE_UNKNOWN;
break;
}
}
mGroup->ChangeState(callState);
}
mEnumerated = true;
if (NS_FAILED(NotifyEvent(NS_LITERAL_STRING("ready")))) {