Bug 915638 - part1 - B2G RIL: telephonyCallGroup.onstatechange isn't fired when a conference call is becoming empty. r=vicamo

This commit is contained in:
Hsin-Yi Tsai 2013-09-12 21:00:18 +08:00
parent 299bd04d22
commit 97f256f2ed
4 changed files with 9 additions and 7 deletions

View File

@ -450,6 +450,7 @@ this.NETWORK_CREG_TECH_LTE = 14;
this.NETWORK_CREG_TECH_HSPAP = 15;
this.NETWORK_CREG_TECH_GSM = 16;
this.CALL_STATE_UNKNOWN = -1;
this.CALL_STATE_ACTIVE = 0;
this.CALL_STATE_HOLDING = 1;
this.CALL_STATE_DIALING = 2;

View File

@ -3629,12 +3629,12 @@ let RIL = {
delete this.currentConference.cache;
// Update the conference call's state.
let state = null;
let state = CALL_STATE_UNKNOWN;
for each (let call in this.currentConference.participants) {
if (state && state != call.state) {
if (state != CALL_STATE_UNKNOWN && state != call.state) {
// Each participant should have the same state, otherwise something
// wrong happens.
state = null;
state = CALL_STATE_UNKNOWN;
break;
}
state = call.state;

View File

@ -216,6 +216,8 @@ TelephonyProvider.prototype = {
_convertRILCallState: function _convertRILCallState(aState) {
switch (aState) {
case RIL.CALL_STATE_UNKNOWN:
return nsITelephonyProvider.CALL_STATE_UNKNOWN;
case RIL.CALL_STATE_ACTIVE:
return nsITelephonyProvider.CALL_STATE_CONNECTED;
case RIL.CALL_STATE_HOLDING:
@ -492,8 +494,7 @@ TelephonyProvider.prototype = {
notifyConferenceCallStateChanged: function notifyConferenceCallStateChanged(aState) {
if (DEBUG) debug("handleConferenceCallStateChanged: " + aState);
aState = aState != null ? this._convertRILCallState(aState) :
nsITelephonyProvider.CALL_STATE_UNKNOWN;
aState = this._convertRILCallState(aState);
this._updateCallAudioState(null, aState);
this._notifyAllListeners("conferenceCallStateChanged", [aState]);

View File

@ -10,7 +10,7 @@
"@mozilla.org/telephony/gonktelephonyprovider;1"
%}
[scriptable, uuid(0d106c7e-ba47-48ee-ba48-c92002d401b6)]
[scriptable, uuid(f072f334-e4ea-4754-9929-533da30444a8)]
interface nsIGonkTelephonyProvider : nsITelephonyProvider
{
void notifyCallDisconnected(in jsval call);
@ -27,5 +27,5 @@ interface nsIGonkTelephonyProvider : nsITelephonyProvider
void notifySupplementaryService(in long callIndex,
in AString notification);
void notifyConferenceCallStateChanged(in unsigned short state);
void notifyConferenceCallStateChanged(in short state);
};