[Bluetooth] Stop discovering before pairing or connecting

RESOLVED FIXED

Status

RESOLVED FIXED
6 years ago
5 years ago

People

(Reporter: echou, Assigned: echou)

Tracking

unspecified
ARM
Gonk (Firefox OS)
Bug Flags:
in-moztrap -

Firefox Tracking Flags

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

Details

Attachments

(1 attachment)

(Assignee)

Description

6 years ago
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)

Comment 1

6 years ago
Created attachment 750881 [details]
Link to https://github.com/mozilla-b2g/gaia/pull/9835
Assignee: nobody → echou
Attachment #750881 - Flags: review?(ehung)

Updated

6 years ago
See Also: → bug 872976

Comment 2

6 years ago
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+
(Assignee)

Comment 4

6 years ago
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+

Comment 5

6 years ago
:jhford, this patch has been merged to gaia master in comment 3, please help uplift to v1-train, Thanks!
Status: NEW → RESOLVED
Last Resolved: 6 years ago
status-b2g18: --- → affected
status-b2g18-v1.0.0: --- → wontfix
status-b2g18-v1.0.1: --- → wontfix
Flags: needinfo?(jhford)
Resolution: --- → FIXED
Uplifted 5f266b4d7985ba51532acc9049a4dda0565b37a5 to:
v1-train: 9a315b24d15a3d06e86c6eeb0789733b4b101a6e
status-b2g18: affected → fixed
Flags: needinfo?(jhford)
Flags: in-moztrap-
(Assignee)

Updated

5 years ago
See Also: → bug 942744
You need to log in before you can comment on or make changes to this bug.