Bug 1015518 - Update users of settings observer message field to use boolean; r=gene

This commit is contained in:
Kyle Machulis 2014-08-19 13:43:58 -07:00
parent 1879d0b8c2
commit fe7068249e
2 changed files with 9 additions and 13 deletions

View File

@ -3314,16 +3314,14 @@ RadioInterface.prototype = {
* Set the setting value of "time.clock.automatic-update.available".
*/
setClockAutoUpdateAvailable: function(value) {
gSettingsService.createLock().set(kSettingsClockAutoUpdateAvailable, value, null,
"fromInternalSetting");
gSettingsService.createLock().set(kSettingsClockAutoUpdateAvailable, value, null);
},
/**
* Set the setting value of "time.timezone.automatic-update.available".
*/
setTimezoneAutoUpdateAvailable: function(value) {
gSettingsService.createLock().set(kSettingsTimezoneAutoUpdateAvailable, value, null,
"fromInternalSetting");
gSettingsService.createLock().set(kSettingsTimezoneAutoUpdateAvailable, value, null);
},
/**
@ -3499,7 +3497,7 @@ RadioInterface.prototype = {
switch (topic) {
case kMozSettingsChangedObserverTopic:
let setting = JSON.parse(data);
this.handleSettingsChange(setting.key, setting.value, setting.message);
this.handleSettingsChange(setting.key, setting.value, setting.isInternalChange);
break;
case kSysClockChangeObserverTopic:
let offset = parseInt(data, 10);
@ -3580,11 +3578,11 @@ RadioInterface.prototype = {
// ICC's mcc-mnc.
_lastKnownHomeNetwork: null,
handleSettingsChange: function(aName, aResult, aMessage) {
handleSettingsChange: function(aName, aResult, aIsInternalSetting) {
// Don't allow any content processes to modify the setting
// "time.clock.automatic-update.available" except for the chrome process.
if (aName === kSettingsClockAutoUpdateAvailable &&
aMessage !== "fromInternalSetting") {
!aIsInternalSetting) {
let isClockAutoUpdateAvailable = this._lastNitzMessage !== null ||
this._sntp.isAvailable();
if (aResult !== isClockAutoUpdateAvailable) {
@ -3600,7 +3598,7 @@ RadioInterface.prototype = {
// "time.timezone.automatic-update.available" except for the chrome
// process.
if (aName === kSettingsTimezoneAutoUpdateAvailable &&
aMessage !== "fromInternalSetting") {
!aIsInternalSetting) {
let isTimezoneAutoUpdateAvailable = this._lastNitzMessage !== null;
if (aResult !== isTimezoneAutoUpdateAvailable) {
if (DEBUG) {

View File

@ -3511,8 +3511,7 @@ WifiWorker.prototype = {
handleError: function(aErrorMessage) {
self.requestDone();
}
},
"fromInternalSetting");
});
},
notifyTetheringOff: function notifyTetheringOff() {
@ -3532,8 +3531,7 @@ WifiWorker.prototype = {
handleError: function(aErrorMessage) {
self.requestDone();
}
},
"fromInternalSetting");
});
},
handleWifiEnabled: function(enabled) {
@ -3609,7 +3607,7 @@ WifiWorker.prototype = {
let setting = JSON.parse(data);
// To avoid WifiWorker setting the wifi again, don't need to deal with
// the "mozsettings-changed" event fired from internal setting.
if (setting.message && setting.message === "fromInternalSetting") {
if (setting.isInternalChange) {
return;
}