Bug 787477 - Part 3: Add errorMsg for getICCContacts in RIL. r=philikon

This commit is contained in:
Yoshi Huang 2012-09-07 14:33:16 +08:00
parent dbcf4d5560
commit 54092eec59
2 changed files with 7 additions and 8 deletions

View File

@ -448,7 +448,9 @@ RadioInterfaceLayer.prototype = {
let callback = this._contactsCallbacks[message.requestId];
if (callback) {
delete this._contactsCallbacks[message.requestId];
callback.receiveContactsList(message.contactType, message.contacts);
callback.receiveContactsList(message.errorMsg,
message.contactType,
message.contacts);
}
break;
case "iccmbdn":
@ -1864,7 +1866,7 @@ RadioInterfaceLayer.prototype = {
getICCContacts: function getICCContacts(contactType, callback) {
if (!this._contactsCallbacks) {
this._contactsCallbacks = {};
}
}
let requestId = Math.floor(Math.random() * 1000);
this._contactsCallbacks[requestId] = callback;
this.worker.postMessage({rilMessageType: "getICCContacts",

View File

@ -1461,11 +1461,10 @@ let RIL = {
}
function error(options) {
// TODO: Error handling should be addressed in Bug 787477
delete options.callback;
delete options.onerror;
options.rilMessageType = "icccontacts";
options.contacts = [];
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
this.sendDOMMessage(options);
}
@ -1554,9 +1553,8 @@ let RIL = {
*/
getICCContacts: function getICCContacts(options) {
if (!this.appType) {
// TODO: Error handling should be addressed in Bug 787477
options.rilMessageType = "icccontacts";
options.contacts = [];
options.errorMsg = GECKO_ERROR_REQUEST_NOT_SUPPORTED;
this.sendDOMMessage(options);
}
@ -1602,11 +1600,10 @@ let RIL = {
}
function error(options) {
// TODO: Error handling should be addressed in Bug 787477
delete options.callback;
delete options.onerror;
options.rilMessageType = "icccontacts";
options.contacts = [];
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
this.sendDOMMessage(options);
}