Bug 947100 - B2G NFC: enable/disable NFC worker at runtime. r=yoshi

This commit is contained in:
Dimi Lee 2013-12-11 14:04:27 +08:00
parent e286df484b
commit 0316a3ed9f
2 changed files with 12 additions and 2 deletions

View File

@ -25,6 +25,9 @@ Cu.import("resource://gre/modules/Services.jsm");
let NFC = {};
Cu.import("resource://gre/modules/nfc_consts.js", NFC);
Cu.import("resource://gre/modules/systemlibs.js");
const NFC_ENABLED = libcutils.property_get("ro.moz.nfc.enabled", "false") === "true";
// set to true in nfc_consts.js to see debug messages
let DEBUG = NFC.DEBUG_NFC;
@ -627,4 +630,6 @@ Nfc.prototype = {
}
};
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([Nfc]);
if (NFC_ENABLED) {
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([Nfc]);
}

View File

@ -26,6 +26,9 @@ Cu.import("resource://gre/modules/DOMRequestHelper.jsm");
let NFC = {};
Cu.import("resource://gre/modules/nfc_consts.js", NFC);
Cu.import("resource://gre/modules/systemlibs.js");
const NFC_ENABLED = libcutils.property_get("ro.moz.nfc.enabled", "false") === "true";
// set to true to in nfc_consts.js to see debug messages
let DEBUG = NFC.DEBUG_CONTENT_HELPER;
@ -384,4 +387,6 @@ NfcContentHelper.prototype = {
},
};
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([NfcContentHelper]);
if (NFC_ENABLED) {
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([NfcContentHelper]);
}