Bug 894737 - [Buri][WIFI-hotspot]Wi-Fi hotspot will be turn off automatic when change the security. r=mrbkap
authorVincent Chang <vchang@mozilla.com>
Mon, 22 Jul 2013 17:11:57 +0800
changeset 151772 9771837fd8958e6b662dbc2605ae0cd3c72ad8ab
parent 151771 07e9f171a894b0b8847f8bfe28dfe968d89e26ec
child 151773 9f89a757e41bdc5470a53267c3ca330140941aba
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmrbkap
bugs894737
milestone25.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 894737 - [Buri][WIFI-hotspot]Wi-Fi hotspot will be turn off automatic when change the security. r=mrbkap
dom/wifi/WifiWorker.js
--- a/dom/wifi/WifiWorker.js
+++ b/dom/wifi/WifiWorker.js
@@ -3200,27 +3200,29 @@ WifiWorker.prototype = {
     }
   },
 
   notifyTetheringOn: function notifyTetheringOn() {
     // It's really sad that we don't have an API to notify the wifi
     // hotspot status. Toggle settings to let gaia know that wifi hotspot
     // is enabled.
     this.tetheringSettings[SETTINGS_WIFI_TETHERING_ENABLED] = true;
+    this._oldWifiTetheringEnabledState = true;
     gSettingsService.createLock().set(
       SETTINGS_WIFI_TETHERING_ENABLED, true, null, "fromInternalSetting");
     // Check for the next request.
     this.nextRequest();
   },
 
   notifyTetheringOff: function notifyTetheringOff() {
     // It's really sad that we don't have an API to notify the wifi
     // hotspot status. Toggle settings to let gaia know that wifi hotspot
     // is disabled.
     this.tetheringSettings[SETTINGS_WIFI_TETHERING_ENABLED] = false;
+    this._oldWifiTetheringEnabledState = false;
     gSettingsService.createLock().set(
       SETTINGS_WIFI_TETHERING_ENABLED, false, null, "fromInternalSetting");
     // Check for the next request.
     this.nextRequest();
   },
 
   handleWifiEnabled: function(enabled) {
     if (WifiManager.enabled === enabled) {
@@ -3328,16 +3330,17 @@ WifiWorker.prototype = {
         }
 
         if (this._oldWifiTetheringEnabledState === null &&
             !this.tetheringSettings[SETTINGS_WIFI_TETHERING_ENABLED]) {
           debug("Do nothing when initial settings for SETTINGS_WIFI_TETHERING_ENABLED flag is false.");
           break;
         }
 
+        this._oldWifiTetheringEnabledState = this.tetheringSettings[SETTINGS_WIFI_TETHERING_ENABLED];
         this.handleWifiTetheringEnabled(aResult)
         break;
     };
   },
 
   handleError: function handleError(aErrorMessage) {
     debug("There was an error while reading Tethering settings.");
     this.tetheringSettings = {};