mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1124550 - Part 10: Refactoring holdCall, resumeCall. r=hsinyi
This commit is contained in:
parent
8f5ece4e0e
commit
3c6c9280ea
@ -1885,42 +1885,6 @@ RilObject.prototype = {
|
||||
}
|
||||
},
|
||||
|
||||
holdCall: function(options) {
|
||||
let call = this.currentCalls[options.callIndex];
|
||||
if (!call) {
|
||||
options.errorMsg = GECKO_ERROR_GENERIC_FAILURE;
|
||||
options.success = false;
|
||||
this.sendChromeMessage(options);
|
||||
return;
|
||||
}
|
||||
|
||||
let Buf = this.context.Buf;
|
||||
if (this._isCdma) {
|
||||
options.featureStr = "";
|
||||
this.cdmaFlash(options);
|
||||
} else if (call.state == CALL_STATE_ACTIVE) {
|
||||
this.switchActiveCall(options);
|
||||
}
|
||||
},
|
||||
|
||||
resumeCall: function(options) {
|
||||
let call = this.currentCalls[options.callIndex];
|
||||
if (!call) {
|
||||
options.errorMsg = GECKO_ERROR_GENERIC_FAILURE;
|
||||
options.success = false;
|
||||
this.sendChromeMessage(options);
|
||||
return;
|
||||
}
|
||||
|
||||
let Buf = this.context.Buf;
|
||||
if (this._isCdma) {
|
||||
options.featureStr = "";
|
||||
this.cdmaFlash(options);
|
||||
} else if (call.state == CALL_STATE_HOLDING) {
|
||||
this.switchActiveCall(options);
|
||||
}
|
||||
},
|
||||
|
||||
conferenceCall: function(options) {
|
||||
this.telephonyRequestQueue.push(REQUEST_CONFERENCE, () => {
|
||||
this.context.Buf.simpleRequest(REQUEST_CONFERENCE, options);
|
||||
|
@ -877,28 +877,52 @@ TelephonyService.prototype = {
|
||||
this._defaultCallbackHandler.bind(this, aCallback));
|
||||
},
|
||||
|
||||
holdCall: function(aClientId, aCallIndex, aCallback) {
|
||||
_switchCall: function(aClientId, aCallIndex, aCallback, aRequiredState) {
|
||||
let call = this._currentCalls[aClientId][aCallIndex];
|
||||
if (!call || !call.isSwitchable) {
|
||||
if (!call) {
|
||||
aCallback.notifyError(RIL.GECKO_ERROR_GENERIC_FAILURE);
|
||||
return;
|
||||
}
|
||||
|
||||
this._sendToRilWorker(aClientId, "holdCall", { callIndex: aCallIndex },
|
||||
if (this._isCdmaClient(aClientId)) {
|
||||
this._switchCallCdma(aClientId, aCallIndex, aCallback);
|
||||
} else {
|
||||
this._switchCallGsm(aClientId, aCallIndex, aCallback, aRequiredState);
|
||||
}
|
||||
},
|
||||
|
||||
_switchCallGsm: function(aClientId, aCallIndex, aCallback, aRequiredState) {
|
||||
let call = this._currentCalls[aClientId][aCallIndex];
|
||||
if (call.state != aRequiredState) {
|
||||
aCallback.notifyError(RIL.GECKO_ERROR_GENERIC_FAILURE);
|
||||
return;
|
||||
}
|
||||
|
||||
this._sendToRilWorker(aClientId, "switchActiveCall", null,
|
||||
this._defaultCallbackHandler.bind(this, aCallback));
|
||||
},
|
||||
|
||||
resumeCall: function(aClientId, aCallIndex, aCallback) {
|
||||
_switchCallCdma: function(aClientId, aCallIndex, aCallback) {
|
||||
let call = this._currentCalls[aClientId][aCallIndex];
|
||||
if (!call || !call.isSwitchable) {
|
||||
if (!call.isSwitchable) {
|
||||
aCallback.notifyError(RIL.GECKO_ERROR_GENERIC_FAILURE);
|
||||
return;
|
||||
}
|
||||
|
||||
this._sendToRilWorker(aClientId, "resumeCall", { callIndex: aCallIndex },
|
||||
this._sendToRilWorker(aClientId, "cdmaFlash", null,
|
||||
this._defaultCallbackHandler.bind(this, aCallback));
|
||||
},
|
||||
|
||||
holdCall: function(aClientId, aCallIndex, aCallback) {
|
||||
this._switchCall(aClientId, aCallIndex, aCallback,
|
||||
nsITelephonyService.CALL_STATE_CONNECTED);
|
||||
},
|
||||
|
||||
resumeCall: function(aClientId, aCallIndex, aCallback) {
|
||||
this._switchCall(aClientId, aCallIndex, aCallback,
|
||||
nsITelephonyService.CALL_STATE_HELD);
|
||||
},
|
||||
|
||||
_conferenceCallGsm: function(aClientId, aCallback) {
|
||||
this._sendToRilWorker(aClientId, "conferenceCall", null, response => {
|
||||
if (!response.success) {
|
||||
|
Loading…
Reference in New Issue
Block a user