Bug 713451 - B2G RIL: Handle request errors. r=philikon

This commit is contained in:
Price Tseng 2012-03-07 14:14:37 -08:00
parent e883e42a7a
commit 954357edc9
2 changed files with 30 additions and 2 deletions

View File

@ -178,6 +178,23 @@ const UNSOLICITED_OEM_HOOK_RAW = 1028;
const UNSOLICITED_RINGBACK_TONE = 1029;
const UNSOLICITED_RESEND_INCALL_MUTE = 1030;
const ERROR_SUCCESS = 0;
const ERROR_RADIO_NOT_AVAILABLE = 1;
const ERROR_GENERIC_FAILURE = 2;
const ERROR_PASSWORD_INCORRECT = 3;
const ERROR_SIM_PIN2 = 4;
const ERROR_SIM_PUK2 = 5;
const ERROR_REQUEST_NOT_SUPPORTED = 6;
const ERROR_CANCELLED = 7;
const ERROR_OP_NOT_ALLOWED_DURING_VOICE_CALL = 8;
const ERROR_OP_NOT_ALLOWED_BEFORE_REG_TO_NW = 9;
const ERROR_SMS_SEND_FAIL_RETRY = 10;
const ERROR_SIM_ABSENT = 11;
const ERROR_SUBSCRIPTION_NOT_AVAILABLE = 12;
const ERROR_MODE_NOT_SUPPORTED = 13;
const ERROR_FDN_CHECK_FAILURE = 14;
const ERROR_ILLEGAL_SIM_OR_ME = 15;
const RADIO_STATE_OFF = 0;
const RADIO_STATE_UNAVAILABLE = 1;
const RADIO_STATE_SIM_NOT_READY = 2;

View File

@ -463,12 +463,14 @@ let Buf = {
options = this.tokenRequestMap[token];
request_type = options.rilRequestType;
options.rilRequestError = error;
if (error) {
//TODO
if (DEBUG) {
debug("Received error " + error + " for solicited parcel type " +
request_type);
}
RIL.handleRequestError(options);
return;
}
if (DEBUG) {
@ -509,6 +511,7 @@ let Buf = {
options = {};
}
options.rilRequestType = type;
options.rilRequestError = null;
this.tokenRequestMap[token] = options;
this.token++;
return token;
@ -940,6 +943,14 @@ let RIL = {
Buf.simpleRequest(REQUEST_LAST_CALL_FAIL_CAUSE);
},
/**
* Handle the RIL request errors
*/
handleRequestError: function handleRequestError(options) {
options.type = "error";
Phone.sendDOMMessage(options);
},
/**
* Handle incoming requests from the RIL. We find the method that
* corresponds to the request type. Incidentally, the request type