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 139487 9771837fd8958e6b662dbc2605ae0cd3c72ad8ab
parent 139486 07e9f171a894b0b8847f8bfe28dfe968d89e26ec
child 139488 9f89a757e41bdc5470a53267c3ca330140941aba
push idunknown
push userunknown
push dateunknown
reviewersmrbkap
bugs894737
milestone25.0a1
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 = {};