Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Bug 819947 - No WiFi networks detected during FTU experience. Add more d... #7340

Merged
merged 1 commit into from

2 participants

@vingtetun
Collaborator

...ebug. r=vingtetun

@vingtetun vingtetun merged commit 59804bd into mozilla-b2g:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 7, 2013
  1. @mrbkap @vingtetun

    Bug 819947 - No WiFi networks detected during FTU experience. Add mor…

    mrbkap authored vingtetun committed
    …e debug. r=vingtetun
This page is out of date. Refresh to see the latest.
View
1  apps/communications/ftu/js/tutorial.js
@@ -54,6 +54,7 @@ var Tutorial = {
this.tutorialFinish.addEventListener('click', function ftuEnd() {
self.tutorialFinish.removeEventListener('click', ftuEnd);
+ WifiManager.finish();
window.close();
});
window.addEventListener('hashchange', this);
View
1  apps/communications/ftu/js/ui.js
@@ -82,6 +82,7 @@ var UIManager = {
});
this.skipTutorialButton.addEventListener('click', function() {
+ WifiManager.finish();
window.close();
});
this.letsGoButton.addEventListener('click', function() {
View
26 apps/communications/ftu/js/wifi.js
@@ -6,6 +6,11 @@ var WifiManager = {
if ('mozWifiManager' in window.navigator) {
this.api = window.navigator.mozWifiManager;
this.changeStatus();
+ // Ensure that wifi is on.
+ var lock = window.navigator.mozSettings.createLock();
+ this.enable(lock);
+ this.enableDebugging(lock);
+
this.gCurrentNetwork = this.api.connection.network;
if (this.gCurrentNetwork !== null) {
this.api.forget(this.gCurrentNetwork);
@@ -76,9 +81,24 @@ var WifiManager = {
callback(fakeNetworks);
}
},
- enable: function wn_enable(firstTime) {
- var settings = window.navigator.mozSettings;
- settings.createLock().set({'wifi.enabled': true});
+ enable: function wn_enable(lock) {
+ lock.set({'wifi.enabled': true});
+ },
+ enableDebugging: function wn_enableDebugging(lock) {
+ // For bug 819947: turn on wifi debugging output to help track down a bug
+ // in wifi. We turn on wifi output only while the FTU app is active.
+ this._prevDebuggingValue = false;
+ var req = lock.get('wifi.debugging.enabled');
+ req.onsuccess = function wn_getDebuggingSuccess() {
+ this._prevDebuggingValue = req.result['wifi.debugging.enabled'];
+ };
+ lock.set({ 'wifi.debugging.enabled': true });
+ },
+ finish: function wn_finish() {
+ if (!this._prevDebuggingValue) {
+ var resetLock = window.navigator.mozSettings.createLock();
+ resetLock.set({'wifi.debugging.enabled': false});
+ }
},
getNetwork: function wm_gn(ssid) {
var network;
Something went wrong with that request. Please try again.