[NFC][Bluetooth] NFC headset auto connect always failed when user manually disconnect already connected NFC headset

VERIFIED FIXED in Firefox 40

Status

defect
VERIFIED FIXED
4 years ago
4 years ago

People

(Reporter: ashiue, Assigned: jaliu)

Tracking

unspecified
2.2 S10 (17apr)
ARM
Gonk (Firefox OS)
Dependency tree / graph

Firefox Tracking Flags

(blocking-b2g:2.2+, firefox38 wontfix, firefox39 wontfix, firefox40 fixed, b2g-v2.2 verified, b2g-master verified)

Details

Attachments

(2 attachments, 1 obsolete attachment)

(Reporter)

Description

4 years ago
+++ This bug was initially created as a clone of Bug #1146744 +++

Tried with following build, and found that NFC headset still cannot auto connect when user manually disconnect already connected it.

Build ID               20150412162502
Gaia Revision          cec00d643f517ffd96cde559cd3bbd43ab85816c
Gaia Date              2015-04-10 21:41:12
Gecko Revision         https://hg.mozilla.org/releases/mozilla-b2g37_v2_2/rev/5005522fd68e
Gecko Version          37.0
Device Name            flame
Firmware(Release)      4.4.2
Firmware(Incremental)  eng.cltbld.20150412.200029
Firmware Date          Sun Apr 12 20:00:40 EDT 2015
Bootloader             L1TC000118D0
(Reporter)

Updated

4 years ago
blocking-b2g: --- → 2.2?
QA Whiteboard: [COM=NFC]
(Reporter)

Updated

4 years ago
Flags: needinfo?(jaliu)
(Assignee)

Comment 1

4 years ago
The patch in Bug 1146744 use the attribute 'BluetoothDevice.connected' as the if-condition to determine whether to connect again. https://github.com/mozilla-b2g/gaia/blob/master/apps/system/js/nfc_handover_manager.js#L643 However, the value of 'BluetoothDevice.connected' isn't correct with BlueDroid stack. Therefore, gaia wouldn't trigger the connection process since it think its already connect.
Flags: needinfo?(jaliu)
(Assignee)

Updated

4 years ago
Assignee: nobody → jaliu
Comment on attachment 8592099 [details] [diff] [review]
Update Bluetooth connection state when BT stack updates device properties. (v1)

Review of attachment 8592099 [details] [diff] [review]:
-----------------------------------------------------------------

LGTM. I think we shall notice gaia guys that V2 API BluetoothDevice.IsConnected no longer been used?

::: dom/bluetooth/bluedroid/BluetoothServiceBluedroid.cpp
@@ +2010,5 @@
> +      return true;
> +    }
> +  }
> +
> +  // P.S. HID profile isn't support by BT API v1

I think you don't need to add this comment. I shall add it when we implement new profile.

@@ +2526,5 @@
>  
> +  // BlueDroid wouldn't notify the status of connection, query the connection
> +  // state and append to properties array
> +  bool isConnected = IsConnected(aBdAddr);
> +  BT_APPEND_NAMED_VALUE(props, "Connected", isConnected);

I think you can call IsConnected(aBdAddr) directly.
Attachment #8592099 - Flags: review?(shuang) → review+
(Assignee)

Comment 4

4 years ago
Thank Shawn for reviewing the patch.
Attachment #8592099 - Attachment is obsolete: true
(Assignee)

Comment 5

4 years ago
(In reply to Shawn Huang [:shawnjohnjr] from comment #3)
> Comment on attachment 8592099 [details] [diff] [review]
> LGTM. I think we shall notice gaia guys that V2 API
> BluetoothDevice.IsConnected no longer been used?
Sure, I will leave a comment on Bug 1090799.

> ::: dom/bluetooth/bluedroid/BluetoothServiceBluedroid.cpp
> I think you don't need to add this comment.

> @@ +2526,5 @@
> I think you can call IsConnected(aBdAddr) directly.
Got it. :)
(Assignee)

Updated

4 years ago
See Also: → 1146744
https://hg.mozilla.org/mozilla-central/rev/8aaa0ee014a4
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 2.2 S10 (17apr)
(Reporter)

Comment 9

4 years ago
Verified on 3.0
Build ID               20150415010203
Gaia Revision          8e28588496f82f8f069c171c65842d622b9d8d7d
Gaia Date              2015-04-14 18:43:50
Gecko Revision         https://hg.mozilla.org/mozilla-central/rev/de27ac2ab94f
Gecko Version          40.0a1
Device Name            flame
Firmware(Release)      4.4.2
Firmware(Incremental)  eng.cltbld.20150415.044739
Firmware Date          Wed Apr 15 04:47:48 EDT 2015
Bootloader             L1TC000118D0

Hi Jamin, could you please uplift this patch to v2.2? Thanks!
Flags: needinfo?(jaliu)

Comment 11

4 years ago
triage: move to 2.2+
blocking-b2g: 2.2? → 2.2+
(Assignee)

Comment 12

4 years ago
Comment on attachment 8592736 [details] [diff] [review]
(for 2.2) Update Bluetooth connection state when BT stack updates device properties. (v2), r=shuang

[Approval Request Comment]
> Bug caused by (feature/regressing bug #): 
Bug 1146744

> User impact if declined: 
User can't use NFC to connect a Bluetooth headset if it's been manually disconnected.

> Testing completed: 
Manually test on v2.2 and master branch by following the STR.

> Risk to taking this patch (and alternatives if risky): 
Currently, Bluetooth component supports HFP/HSP, A2DP/AVRCP and OPP profiles. 
When Gecko support a new profile in future, the developer must remember to check the connection state of that profile.

> String or UUID changes made by this patch:
no
Attachment #8592736 - Flags: approval-mozilla-b2g37?
Attachment #8592736 - Flags: approval-mozilla-b2g37? → approval-mozilla-b2g37+
(Reporter)

Comment 14

4 years ago
Verified on 2.2 

Build ID               20150419162502
Gaia Revision          c15a2b6d3a783813959c2b3bffd2a131f4270b9e
Gaia Date              2015-04-17 17:49:32
Gecko Revision         https://hg.mozilla.org/releases/mozilla-b2g37_v2_2/rev/cc02ee38b252
Gecko Version          37.0
Device Name            flame
Firmware(Release)      4.4.2
Firmware(Incremental)  eng.cltbld.20150419.201820
Firmware Date          Sun Apr 19 20:18:31 EDT 2015
Bootloader             L1TC100118D0
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.