Backed out changeset 916a5e943388 (bug 1077075)

This commit is contained in:
Carsten "Tomcat" Book 2014-12-29 10:30:17 +01:00
Родитель 28d936c574
Коммит f11023f88b
1 изменённых файлов: 21 добавлений и 42 удалений

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

@ -533,7 +533,7 @@ TelephonyService.prototype = {
} else if (aNumber === "1") { } else if (aNumber === "1") {
this._sendToRilWorker(aClientId, "hangUpForeground", null, mmiCallback); this._sendToRilWorker(aClientId, "hangUpForeground", null, mmiCallback);
} else if (aNumber[0] === "1" && aNumber.length === 2) { } else if (aNumber[0] === "1" && aNumber.length === 2) {
this._sendToRilWorker(aClientId, "hangUpCall", this._sendToRilWorker(aClientId, "hangUp",
{ callIndex: parseInt(aNumber[1]) }, mmiCallback); { callIndex: parseInt(aNumber[1]) }, mmiCallback);
} else if (aNumber === "2") { } else if (aNumber === "2") {
this._sendToRilWorker(aClientId, "switchActiveCall", null, mmiCallback); this._sendToRilWorker(aClientId, "switchActiveCall", null, mmiCallback);
@ -625,9 +625,7 @@ TelephonyService.prototype = {
if (activeCall.isConference) { if (activeCall.isConference) {
this.holdConference(aClientId); this.holdConference(aClientId);
} else { } else {
this.holdCall(aClientId, activeCall.callIndex, this.holdCall(aClientId, activeCall.callIndex);
{ notifySuccess: function () {},
notifyError: function (errorMsg) {} });
} }
} }
}, },
@ -917,19 +915,14 @@ TelephonyService.prototype = {
} }
}, },
/** hangUp: function(aClientId, aCallIndex) {
* The default callback handler for call operations. let parentId = this._currentCalls[aClientId][aCallIndex].parentId;
* if (parentId) {
* @param aCallback // Should release both, child and parent, together. Since RIL holds only
* An callback object including notifySuccess() and notifyError(aMsg) // the parent call, we send 'parentId' to RIL.
* @param aResponse this.hangUp(aClientId, parentId);
* The response from ril_worker.
*/
_defaultCallbackHandler: function(aCallback, aResponse) {
if (!aResponse.success) {
aCallback.notifyError(aResponse.errorMsg);
} else { } else {
aCallback.notifySuccess(); this._sendToRilWorker(aClientId, "hangUp", { callIndex: aCallIndex });
} }
}, },
@ -941,48 +934,34 @@ TelephonyService.prototype = {
this._sendToRilWorker(aClientId, "stopTone"); this._sendToRilWorker(aClientId, "stopTone");
}, },
answerCall: function(aClientId, aCallIndex, aCallback) { answerCall: function(aClientId, aCallIndex) {
this._sendToRilWorker(aClientId, "answerCall", { callIndex: aCallIndex }, this._sendToRilWorker(aClientId, "answerCall", { callIndex: aCallIndex });
this._defaultCallbackHandler.bind(this, aCallback));
}, },
rejectCall: function(aClientId, aCallIndex, aCallback) { rejectCall: function(aClientId, aCallIndex) {
this._sendToRilWorker(aClientId, "rejectCall", { callIndex: aCallIndex }, this._sendToRilWorker(aClientId, "rejectCall", { callIndex: aCallIndex });
this._defaultCallbackHandler.bind(this, aCallback));
}, },
hangUpCall: function(aClientId, aCallIndex, aCallback) { holdCall: function(aClientId, aCallIndex) {
let parentId = this._currentCalls[aClientId][aCallIndex].parentId;
if (parentId) {
// Should release both, child and parent, together. Since RIL holds only
// the parent call, we send 'parentId' to RIL.
this.hangUpCall(aClientId, parentId, aCallback);
} else {
this._sendToRilWorker(aClientId, "hangUpCall", { callIndex: aCallIndex },
this._defaultCallbackHandler.bind(this, aCallback));
}
},
holdCall: function(aClientId, aCallIndex, aCallback) {
let call = this._currentCalls[aClientId][aCallIndex]; let call = this._currentCalls[aClientId][aCallIndex];
if (!call || !call.isSwitchable) { if (!call || !call.isSwitchable) {
aCallback.notifyError(RIL.GECKO_ERROR_GENERIC_FAILURE); // TODO: Bug 975949 - [B2G] Telephony should throw exceptions when some
// operations aren't allowed instead of simply ignoring them.
return; return;
} }
this._sendToRilWorker(aClientId, "holdCall", { callIndex: aCallIndex }, this._sendToRilWorker(aClientId, "holdCall", { callIndex: aCallIndex });
this._defaultCallbackHandler.bind(this, aCallback));
}, },
resumeCall: function(aClientId, aCallIndex, aCallback) { resumeCall: function(aClientId, aCallIndex) {
let call = this._currentCalls[aClientId][aCallIndex]; let call = this._currentCalls[aClientId][aCallIndex];
if (!call || !call.isSwitchable) { if (!call || !call.isSwitchable) {
aCallback.notifyError(RIL.GECKO_ERROR_GENERIC_FAILURE); // TODO: Bug 975949 - [B2G] Telephony should throw exceptions when some
// operations aren't allowed instead of simply ignoring them.
return; return;
} }
this._sendToRilWorker(aClientId, "resumeCall", { callIndex: aCallIndex }, this._sendToRilWorker(aClientId, "resumeCall", { callIndex: aCallIndex });
this._defaultCallbackHandler.bind(this, aCallback));
}, },
conferenceCall: function(aClientId) { conferenceCall: function(aClientId) {