Bug 804851 - Add telephony mock object to avoid Contacts app errors on B2G Desktop. r=gwagner

--HG--
extra : rebase_source : 9329364aac86696b3d6f526831b85235167aa8f8
This commit is contained in:
Chris Peterson 2012-10-23 15:09:29 -07:00
parent 60788c9e2a
commit 5a658cc058

View File

@ -22,9 +22,18 @@ XPCOMUtils.defineLazyServiceGetter(this, "ppmm",
"nsIMessageListenerManager");
XPCOMUtils.defineLazyGetter(this, "mRIL", function () {
return Cc["@mozilla.org/telephony/system-worker-manager;1"].
getService(Ci.nsIInterfaceRequestor).
getInterface(Ci.nsIRadioInterfaceLayer);
let telephony = Cc["@mozilla.org/telephony/system-worker-manager;1"];
if (!telephony) {
// Return a mock RIL because B2G Desktop build does not support telephony.
return {
getICCContacts: function(aContactType, aCallback) {
aCallback("!telephony", null, null);
}
};
}
return telephony.
getService(Ci.nsIInterfaceRequestor).
getInterface(Ci.nsIRadioInterfaceLayer);
});
let myGlobal = this;