Closed Bug 873352 Opened 11 years ago Closed 11 years ago

[Bluetooth] Stop discovering before pairing or connecting

Categories

(Firefox OS Graveyard :: Gaia::Settings, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(blocking-b2g:leo+, b2g18 fixed, b2g18-v1.0.0 wontfix, b2g18-v1.0.1 wontfix)

RESOLVED FIXED
blocking-b2g leo+
Tracking Status
b2g18 --- fixed
b2g18-v1.0.0 --- wontfix
b2g18-v1.0.1 --- wontfix

People

(Reporter: echou, Assigned: echou)

References

Details

Attachments

(1 file)

Discovering devices is a heavy operation in Bluetooth. If we try to establish an outbound connection with discovering, it would not only extends the time to complete connection procedure, it may be even easier to cause connection failed.

If you take a look at Android's API document, in function BluetoothAdapter::CancelDiscovery(), it also mentions that "Because discovery is a heavyweight procedure for the Bluetooth adapter, this method should always be called before attempting to connect to a remote device with connect()."*

* http://developer.android.com/reference/android/bluetooth/BluetoothAdapter.html#cancelDiscovery%28%29
Assignee: nobody → echou
Attachment #750881 - Flags: review?(ehung)
See Also: → 872976
Comment on attachment 750881 [details]
Link to https://github.com/mozilla-b2g/gaia/pull/9835

r=me, in this patch, we just reorder the API call sequence: always call stop discovery first.
Attachment #750881 - Flags: review?(ehung) → review+
Nominate this as leo+ since this small change could largely increase the successful rate of connecting. For bugs like bug 872976 and bug 871962, it would help. Please see bug 872976 comment 11 for more information.
blocking-b2g: --- → leo?
blocking-b2g: leo? → leo+
:jhford, this patch has been merged to gaia master in comment 3, please help uplift to v1-train, Thanks!
Status: NEW → RESOLVED
Closed: 11 years ago
Flags: needinfo?(jhford)
Resolution: --- → FIXED
Uplifted 5f266b4d7985ba51532acc9049a4dda0565b37a5 to:
v1-train: 9a315b24d15a3d06e86c6eeb0789733b4b101a6e
Flags: needinfo?(jhford)
Flags: in-moztrap-
See Also: → 942744
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: