Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Bug 828174: Track Bluetooth discovery state in Settings app [r=ehung]

The settings app unconditionally stops Bluetooth discovery when
processing incoming events. Stopping discovery when no discovery
is actually running will make the Bluetooth daemon generate an
error.

This patch prevents this by tracking the discovery state in the
settings application and only stopping discovery if it's currently
running. We reuse the value 'discoverTimeout' for this purpose,
because it exposes the required behaviour.

Signed-off-by: Thomas Zimmermann <tdz@users.sourceforge.net>
  • Loading branch information...
commit 82e96a0626fa66d68e2286a24bb6763697f9ae24 1 parent 3204365
Thomas Zimmermann authored January 07, 2013

Showing 1 changed file with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. 4  apps/settings/js/bluetooth.js
4  apps/settings/js/bluetooth.js
@@ -593,7 +593,7 @@ onLocalized(function bluetoothSettings() {
593 593
     }
594 594
 
595 595
     function startDiscovery() {
596  
-      if (!bluetooth.enabled || !defaultAdapter)
  596
+      if (!bluetooth.enabled || !defaultAdapter || discoverTimeout)
597 597
         return;
598 598
 
599 599
       var req = defaultAdapter.startDiscovery();
@@ -616,7 +616,7 @@ onLocalized(function bluetoothSettings() {
616 616
     }
617 617
 
618 618
     function stopDiscovery() {
619  
-      if (!bluetooth.enabled || !defaultAdapter)
  619
+      if (!bluetooth.enabled || !defaultAdapter || !discoverTimeout)
620 620
         return;
621 621
       var req = defaultAdapter.stopDiscovery();
622 622
       req.onsuccess = function bt_discoveryStopped() {

0 notes on commit 82e96a0

Please sign in to comment.
Something went wrong with that request. Please try again.