Bug 761533 - WebTelephony: busy event is never fired. r=philikon

This commit is contained in:
Hsinyi Tsai 2012-06-18 17:51:11 +08:00
Родитель d0e97f794d
Коммит a430dc28a1
3 изменённых файлов: 26 добавлений и 4 удалений

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

@ -94,6 +94,8 @@ function convertRILCallState(state) {
case RIL.CALL_STATE_INCOMING:
case RIL.CALL_STATE_WAITING:
return nsIRadioInterfaceLayer.CALL_STATE_INCOMING;
case RIL.CALL_STATE_BUSY:
return nsIRadioInterfaceLayer.CALL_STATE_BUSY;
default:
throw new Error("Unknown rilCallState: " + state);
}

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

@ -370,6 +370,7 @@ const CALL_STATE_DIALING = 2;
const CALL_STATE_ALERTING = 3;
const CALL_STATE_INCOMING = 4;
const CALL_STATE_WAITING = 5;
const CALL_STATE_BUSY = 6;
const TOA_INTERNATIONAL = 0x91;
const TOA_UNKNOWN = 0x81;

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

@ -2229,7 +2229,7 @@ let RIL = {
// Call is no longer reported by the radio. Remove from our map and
// send disconnected state change.
delete this.currentCalls[currentCall.callIndex];
this._handleDisconnectedCall(currentCall);
this.getFailCauseCode(currentCall);
}
}
@ -2875,9 +2875,28 @@ RIL[REQUEST_LAST_CALL_FAIL_CAUSE] = function REQUEST_LAST_CALL_FAIL_CAUSE(length
}
let failCause = Buf.readUint32();
options.type = "callError";
options.error = RIL_CALL_FAILCAUSE_TO_GECKO_CALL_ERROR[failCause];
this.sendDOMMessage(options);
switch (failCause) {
case CALL_FAIL_NORMAL:
this._handleDisconnectedCall(options);
break;
case CALL_FAIL_BUSY:
options.state = CALL_STATE_BUSY;
this._handleChangedCallState(options);
this._handleDisconnectedCall(options);
break;
case CALL_FAIL_UNOBTAINABLE_NUMBER:
case CALL_FAIL_CONGESTION:
case CALL_FAIL_ACM_LIMIT_EXCEEDED:
case CALL_FAIL_CALL_BARRED:
case CALL_FAIL_FDN_BLOCKED:
case CALL_FAIL_IMSI_UNKNOWN_IN_VLR:
case CALL_FAIL_IMEI_NOT_ACCEPTED:
case CALL_FAIL_ERROR_UNSPECIFIED:
options.type = "callError";
options.error = RIL_CALL_FAILCAUSE_TO_GECKO_CALL_ERROR[failCause];
this.sendDOMMessage(options);
break;
}
};
RIL[REQUEST_SIGNAL_STRENGTH] = function REQUEST_SIGNAL_STRENGTH(length, options) {
if (options.rilRequestError) {