Skip to content

Commit

Permalink
Merge pull request mozilla-b2g#6879 from evelynhung/issue-818690
Browse files Browse the repository at this point in the history
bug 818690 don't try to stop discover mode when bluetooth is disabling.
  • Loading branch information
evelynhung committed Dec 7, 2012
2 parents 33536a0 + 566bf2f commit 4e94433
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions apps/settings/js/bluetooth.js
Expand Up @@ -288,7 +288,9 @@ onLocalized(function bluetoothSettings() {
enableMsg.hidden = false; enableMsg.hidden = false;
searchingItem.hidden = true; searchingItem.hidden = true;
optionMenu.close(); optionMenu.close();
stopDiscovery(); // clear discoverTimeout
clearTimeout(discoverTimeout);
discoverTimeout = null;
} }
} }


Expand Down Expand Up @@ -544,7 +546,7 @@ onLocalized(function bluetoothSettings() {
} }


function stopDiscovery() { function stopDiscovery() {
if (!defaultAdapter) if (!defaultAdapter || !bluetooth.enabled)
return; return;
var req = defaultAdapter.stopDiscovery(); var req = defaultAdapter.stopDiscovery();
req.onsuccess = function bt_discoveryStopped() { req.onsuccess = function bt_discoveryStopped() {
Expand Down

0 comments on commit 4e94433

Please sign in to comment.