diff --git a/b2g/chrome/content/shell.js b/b2g/chrome/content/shell.js index 7db27d84401e..8d8a05a08073 100644 --- a/b2g/chrome/content/shell.js +++ b/b2g/chrome/content/shell.js @@ -783,10 +783,6 @@ var CustomEventManager = { case 'inputmethod-update-layouts': KeyboardHelper.handleEvent(detail); break; - case 'nfc-hardware-state-change': - Services.obs.notifyObservers(null, 'nfc-hardware-state-change', - JSON.stringify({ nfcHardwareState: detail.nfcHardwareState })); - break; } } } diff --git a/dom/system/gonk/Nfc.js b/dom/system/gonk/Nfc.js index 2147adab2178..35da7f1d415e 100644 --- a/dom/system/gonk/Nfc.js +++ b/dom/system/gonk/Nfc.js @@ -416,7 +416,6 @@ function Nfc() { this.worker.onmessage = this.onmessage.bind(this); Services.obs.addObserver(this, NFC.TOPIC_MOZSETTINGS_CHANGED, false); - Services.obs.addObserver(this, NFC.TOPIC_HARDWARE_STATE, false); gMessageManager.init(this); let lock = gSettingsService.createLock(); @@ -657,28 +656,11 @@ Nfc.prototype = { this.handle(setting.key, setting.value); } break; - case NFC.TOPIC_HARDWARE_STATE: - let state = JSON.parse(data); - if (state) { - let level = this.hardwareStateToPowerlevel(state.nfcHardwareState); - this.setConfig({ powerLevel: level }); - } - break; } }, setConfig: function setConfig(prop) { this.sendToWorker("config", prop); - }, - - hardwareStateToPowerlevel: function hardwareStateToPowerlevel(state) { - switch (state) { - case 0: return NFC.NFC_POWER_LEVEL_DISABLED; - case 1: return NFC.NFC_POWER_LEVEL_ENABLED; - case 2: return NFC.NFC_POWER_LEVEL_ENABLED; - case 3: return NFC.NFC_POWER_LEVEL_LOW; - default: return NFC.NFC_POWER_LEVEL_UNKNOWN; - } } }; diff --git a/dom/system/gonk/nfc_consts.js b/dom/system/gonk/nfc_consts.js index 3fe730251fa3..b3d6f6d2bd31 100644 --- a/dom/system/gonk/nfc_consts.js +++ b/dom/system/gonk/nfc_consts.js @@ -63,7 +63,6 @@ this.NFC_POWER_LEVEL_ENABLED = 2; this.TOPIC_MOZSETTINGS_CHANGED = "mozsettings-changed"; this.TOPIC_XPCOM_SHUTDOWN = "xpcom-shutdown"; -this.TOPIC_HARDWARE_STATE = "nfc-hardware-state-change"; this.SETTING_NFC_ENABLED = "nfc.enabled"; this.NFC_PEER_EVENT_READY = 0x01;