Bug 970241 - B2G NFC: Don't enable/disable NFC when nfc.enabled settings changed. r=dimi

This commit is contained in:
Yoshi Huang 2014-02-11 20:34:19 +08:00
parent 53aab72233
commit 250bcf8508
2 changed files with 0 additions and 13 deletions

View File

@ -402,7 +402,6 @@ function Nfc() {
gMessageManager.init(this);
let lock = gSettingsService.createLock();
lock.get(NFC.SETTING_NFC_POWER_LEVEL, this);
lock.get(NFC.SETTING_NFC_ENABLED, this);
// Maps sessionId (that are generated from nfcd) with a unique guid : 'SessionToken'
this.sessionTokenMap = {};
@ -523,8 +522,6 @@ Nfc.prototype = {
// nsINfcWorker
worker: null,
powerLevel: NFC.NFC_POWER_LEVEL_DISABLED,
sessionTokenMap: null,
/**
@ -623,15 +620,6 @@ Nfc.prototype = {
case NFC.SETTING_NFC_ENABLED:
debug("'nfc.enabled' is now " + aResult);
this._enabled = aResult;
// General power setting
let powerLevel = this._enabled ? NFC.NFC_POWER_LEVEL_ENABLED :
NFC.NFC_POWER_LEVEL_DISABLED;
// Only if the value changes, set the power config and persist
if (powerLevel !== this.powerLevel) {
debug("New Power Level " + powerLevel);
this.setConfig({powerLevel: powerLevel});
this.powerLevel = powerLevel;
}
break;
}
},

View File

@ -65,7 +65,6 @@ 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.SETTING_NFC_POWER_LEVEL = "nfc.powerlevel";
this.NFC_PEER_EVENT_READY = 0x01;
this.NFC_PEER_EVENT_LOST = 0x02;