181 bytes, text/html
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
Created attachment 750881 [details] Link to https://github.com/mozilla-b2g/gaia/pull/9835
Assignee: nobody → echou
Attachment #750881 - Flags: review?(ehung)
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+
merged into gaia-master https://github.com/mozilla-b2g/gaia/commit/5f266b4d7985ba51532acc9049a4dda0565b37a5
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?
:jhford, this patch has been merged to gaia master in comment 3, please help uplift to v1-train, Thanks!
Status: NEW → RESOLVED
Last Resolved: 5 years ago
status-b2g18: --- → affected
status-b2g18-v1.0.0: --- → wontfix
status-b2g18-v1.0.1: --- → wontfix
Resolution: --- → FIXED
Uplifted 5f266b4d7985ba51532acc9049a4dda0565b37a5 to: v1-train: 9a315b24d15a3d06e86c6eeb0789733b4b101a6e
status-b2g18: affected → fixed
You need to log in before you can comment on or make changes to this bug.