Closed Bug 884603 Opened 12 years ago Closed 12 years ago

Issues re-connecting with a previously paired device when Settings->Bluetooth is enabled

Categories

(Firefox OS Graveyard :: Bluetooth, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 872976

People

(Reporter: mvikram, Assigned: shawnjohnjr)

Details

Attachments

(1 file)

Attached file BT_FFOS_logs.txt
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36 Steps to reproduce: This issue was noticed specifically with a LG-HBS-250 device (though the problem is probably generic). Here are the steps: 1) Turn on Bluetooth (Settings->Bluetooth->On) 2) Discover devices; this headset shows up 3) Pair successfully with the device (a PIN is required to be entered on the phone) 4) The headset shows as a paired device 5) Turn Bluetooth off (Settings->Bluetooth->Off) 6) Turn Bluetooth back on 7) The phone should connect reliably with the headset again (assuming it is on) Actual results: Observations: Sometimes, you see the Error screen saying "Device out of range" (Even though the device is near by) and once we press the OK button it eventually connects. Analysis (BT log attached): On analyzing the BT protocol exchange between the phone and the headset the following are the observations: • Phone initiates discovery of devices • Phone discovers headset • Phone initiates a HCI connection request to headset which fails because of a page timeout (note that inquiry scans are still going on at this time) • Phone re-initiates a HCI connection request • Headset switched role to Master and requests Link key from phone • Phone responds with link key • The connection is established with encryption on • L2CAP connection is established • Authentication is established (again) successfully with encryption on • Phone and headset exchange SDP records • Ultimately, a successful HFP connection is made • However, at the HFP profile level we see the error: "Failed to connect with a bluetooth headset!") (this is due to the connection failing due to the Page timeout) This is in BluetoothHfpManager.cpp: void BluetoothHfpManager::OnConnectError(BluetoothSocket* aSocket) { // Failed to create a SCO socket if (aSocket == mScoSocket) { OnScoConnectError(); return; } // For active connection request, we need to reply the DOMRequest if (mRunnable) { NS_NAMED_LITERAL_STRING(replyError, "Failed to connect with a bluetooth headset!"); DispatchBluetoothReply(mRunnable, BluetoothValue(), replyError); mRunnable = nullptr; } • Note that the phone does connect with the headset subsequently. Expected results: The phone should reliably connect with the headset almost every time. Recommendations: 1) The Bluetooth Settings app should first try to connect with a previously paired device and only after that initiate discovery of other devices. 2) Introducing a state machine in the app might be useful to respond asynchronously to events such as "pairing complete", "hfp status changed" etc, to avoid putting in delays (e.g, https://github.com/mozilla-b2g/gaia/pull/6047)
Component: General → Bluetooth
Assignee: nobody → shuang
Status: UNCONFIRMED → RESOLVED
Closed: 12 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: