Backed out changeset 05880eb3e779 (bug 1077075)

This commit is contained in:
Carsten "Tomcat" Book 2014-12-29 10:30:13 +01:00
parent 19124d2667
commit ac1f16356d

View File

@ -1687,7 +1687,7 @@ RilObject.prototype = {
*/
hangUpAll: function() {
for (let callIndex in this.currentCalls) {
this.hangUpCall({callIndex: callIndex});
this.hangUp({callIndex: callIndex});
}
},
@ -1697,14 +1697,9 @@ RilObject.prototype = {
* @param callIndex
* Call index (1-based) as reported by REQUEST_GET_CURRENT_CALLS.
*/
hangUpCall: function(options) {
hangUp: function(options) {
let call = this.currentCalls[options.callIndex];
if (!call) {
// |hangUpCall()| is used to remove a call from the current call list,
// so we consider it as an successful case when hanging up a call that
// doesn't exist in the current call list.
options.success = true;
this.sendChromeMessage(options);
return;
}
@ -1786,9 +1781,6 @@ RilObject.prototype = {
answerCall: function(options) {
let call = this.currentCalls[options.callIndex];
if (!call) {
options.success = false;
options.errorMsg = GECKO_ERROR_GENERIC_FAILURE;
this.sendChromeMessage(options);
return;
}
@ -1799,19 +1791,13 @@ RilObject.prototype = {
switch (call.state) {
case CALL_STATE_INCOMING:
this.telephonyRequestQueue.push(REQUEST_ANSWER, () => {
this.context.Buf.simpleRequest(REQUEST_ANSWER, options);
this.context.Buf.simpleRequest(REQUEST_ANSWER);
});
break;
case CALL_STATE_WAITING:
// Answer the waiting (second) call, and hold the first call.
this.switchActiveCall(options);
break;
default:
if (DEBUG) this.context.debug("AnswerCall: Invalid call state");
options.success = false;
options.errorMsg = GECKO_ERROR_GENERIC_FAILURE;
this.sendChromeMessage(options);
}
},
@ -1822,13 +1808,12 @@ RilObject.prototype = {
* Call index of the call to reject.
*/
rejectCall: function(options) {
// Check for races. Since we dispatched the incoming/waiting call
// notification the incoming/waiting call may have changed. The main
// thread thinks that it is rejecting the call with the given index,
// so only reject if that is still incoming/waiting.
let call = this.currentCalls[options.callIndex];
if (!call) {
// |hangUpCall()| is used to remove an imcoming call from the current
// call list, so we consider it as an successful case when rejecting
// a call that doesn't exist in the current call list.
options.success = true;
this.sendChromeMessage(options);
return;
}
@ -1840,10 +1825,6 @@ RilObject.prototype = {
return;
}
// Check for races. Since we dispatched the incoming/waiting call
// notification the incoming/waiting call may have changed. The main
// thread thinks that it is rejecting the call with the given index,
// so only reject if that is still incoming/waiting.
switch (call.state) {
case CALL_STATE_INCOMING:
this.udub(options);
@ -1852,12 +1833,6 @@ RilObject.prototype = {
// Reject the waiting (second) call, and remain the first call.
this.hangUpBackground(options);
break;
default:
if (DEBUG) this.context.debug("RejectCall: Invalid call state");
options.success = false;
options.errorMsg = GECKO_ERROR_GENERIC_FAILURE;
this.sendChromeMessage(options);
}
},
@ -1946,7 +1921,7 @@ RilObject.prototype = {
}
options.callIndex = 1;
this.hangUpCall(options);
this.hangUp(options);
return;
}
@ -5512,10 +5487,6 @@ RilObject.prototype[REQUEST_GET_IMSI] = function REQUEST_GET_IMSI(length, option
this.sendChromeMessage(options);
};
RilObject.prototype[REQUEST_HANGUP] = function REQUEST_HANGUP(length, options) {
if (options.rilMessageType == null) {
return;
}
options.success = (options.rilRequestError === 0);
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
this.sendChromeMessage(options);
@ -5543,11 +5514,6 @@ RilObject.prototype[REQUEST_CONFERENCE] = function REQUEST_CONFERENCE(length, op
this.sendChromeMessage(options);
};
RilObject.prototype[REQUEST_UDUB] = function REQUEST_UDUB(length, options) {
options.success = (options.rilRequestError === 0);
if (!options.success) {
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
}
this.sendChromeMessage(options);
};
RilObject.prototype[REQUEST_LAST_CALL_FAIL_CAUSE] = function REQUEST_LAST_CALL_FAIL_CAUSE(length, options) {
let Buf = this.context.Buf;
@ -6002,11 +5968,6 @@ RilObject.prototype[REQUEST_GET_IMEISV] = function REQUEST_GET_IMEISV(length, op
this.IMEISV = this.context.Buf.readString();
};
RilObject.prototype[REQUEST_ANSWER] = function REQUEST_ANSWER(length, options) {
options.success = (options.rilRequestError === 0);
if (!options.success) {
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
}
this.sendChromeMessage(options);
};
RilObject.prototype[REQUEST_DEACTIVATE_DATA_CALL] = function REQUEST_DEACTIVATE_DATA_CALL(length, options) {
if (options.rilRequestError) {