mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 947100 - B2G NFC: enable/disable NFC worker at runtime. r=yoshi
This commit is contained in:
parent
a8aca26478
commit
1c63e8351f
@ -138,8 +138,12 @@ MozNFCPeer.prototype = {
|
||||
*/
|
||||
function mozNfc() {
|
||||
debug("In mozNfc Constructor");
|
||||
this._nfcContentHelper = Cc["@mozilla.org/nfc/content-helper;1"]
|
||||
.getService(Ci.nsINfcContentHelper);
|
||||
try {
|
||||
this._nfcContentHelper = Cc["@mozilla.org/nfc/content-helper;1"]
|
||||
.getService(Ci.nsINfcContentHelper);
|
||||
} catch(e) {
|
||||
debug("No NFC support.")
|
||||
}
|
||||
}
|
||||
mozNfc.prototype = {
|
||||
_nfcContentHelper: null,
|
||||
|
@ -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]);
|
||||
}
|
||||
|
@ -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]);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user