Closed
Bug 1168325
Opened 10 years ago
Closed 10 years ago
[Bluetooth][API v2]When user shares pictures with bluethooth in Gallery, sometimes the Bluetooth can't be invoked.
Categories
(Firefox OS Graveyard :: Gaia::Bluetooth, defect)
Tracking
(Not tracked)
VERIFIED
FIXED
People
(Reporter: wangxin, Assigned: iliu)
References
Details
Attachments
(3 files)
[1.Description]:
[Bluetooth][API v2]Share pictures with bluethooth in Gallery, the Bluetooth can't be invoked all the time.
Found time:14:50
See video:"1450.mp4"
See log:"logcat_1450.txt"
[2.Testing Steps]:
1. Launch "Galleary".
2. Share some picture with Bluethooth.
[3.Expected Result]:
2. Bluethooth should be invoked everytime.
[4.Actual Result]:
2. Sometimes the Bluetooth can't be invoked.
[5.Reproduction build]:
Bluetooth test device(Nexus-5-L) build(Affected):
Build ID 20150521135508
Gaia Revision d3d9e553628b11ebf326e63e757492383609a40a
Gaia Date 2015-05-20 21:12:02
Gecko Revision n/a
Gecko Version 41.0a1
Device Name hammerhead
Firmware(Release) 5.1
Firmware(Incremental) eng.bruce_sun.20150513.164544
Firmware Date Wed May 13 16:46:29 CST 2015
Bootloader HHZ12f
Flame 3.0 build(Unaffected):
Build ID 20150525160205
Gaia Revision 5bcc08a732163087999251b523e3643db397412c
Gaia Date 2015-05-24 14:44:40
Gecko Revision https://hg.mozilla.org/mozilla-central/rev/b6623a27fa64
Gecko Version 41.0a1
Device Name flame
Firmware(Release) 4.4.2
Firmware(Incremental) eng.cltbld.20150525.192755
Firmware Date Mon May 25 19:28:07 EDT 2015
Bootloader L1TC000118D0
Nexus5 3.0 build(Unaffected):
Build ID 20150525160205
Gaia Revision 5bcc08a732163087999251b523e3643db397412c
Gaia Date 2015-05-24 14:44:40
Gecko Revision https://hg.mozilla.org/mozilla-central/rev/b6623a27fa64
Gecko Version 41.0a1
Device Name hammerhead
Firmware(Release) 5.1
Firmware(Incremental) eng.cltbld.20150525.192207
Firmware Date Mon May 25 19:22:24 EDT 2015
Bootloader HHZ12f
[6.Reproduction Frequency]:
occasionally Recurrence,5/10
[7.TCID]:
Free Test
| Assignee | ||
Comment 2•10 years ago
|
||
Hi SandKing,
Per description[Bluetooth test device(Nexus-5-L) build(Affected):], is the issue only happened on Nexus-5-L with Bluetooth APIv2? Thanks.
Assignee: nobody → iliu
Flags: needinfo?(wangxin)
Comment 3•10 years ago
|
||
I would like to add another question here, is the issue also happened on flame-kk with Bluetooth APIv2? Thanks.
Hi Lan and Jocelyn,
Up to now, I can only reproduce this bug on the Nexus - 5 - L with Bluetooth APIv2.
Flags: needinfo?(wangxin)
Flags: needinfo?(joliu)
Flags: needinfo?(iliu)
Comment 5•10 years ago
|
||
| Assignee | ||
Comment 6•10 years ago
|
||
(In reply to Autolander from comment #5)
> Created attachment 8612134 [details] [review]
> [gaia]
> ian-liu:bluetooth/bug1168325_cannot_get_default_adatper_in_bluetooth_app >
> mozilla-b2g:master
Hi Jocelyn,
After my investigation, sometimes Bluetooth app |postError('cancelled')| to leave activity request. Because Bluetooth app cannot get default adapter. You can apply my debugging patch for the symptom.
* Cannot get default adapter in init process.
https://github.com/ian-liu/gaia/blob/bluetooth/bug1168325_cannot_get_default_adatper_in_bluetooth_app/apps/bluetooth/js/modules/bluetooth/bluetooth_adapter_manager.js#L101-L103
* There is no 'onattributechanged' event for updating 'defaultAdapter', if Bluetooth app cannot get default adapter.
https://github.com/ian-liu/gaia/blob/bluetooth/bug1168325_cannot_get_default_adatper_in_bluetooth_app/apps/bluetooth/js/modules/bluetooth/bluetooth_adapter_manager.js#L76-L81
If you need any helps, please let me know. Thanks.
Assignee: iliu → nobody
Flags: needinfo?(iliu)
| Assignee | ||
Comment 7•10 years ago
|
||
Re-take the issue since platform has fired BluetoothManager 'attributechanged' event already.
Assignee: nobody → iliu
Flags: needinfo?(joliu)
| Assignee | ||
Updated•10 years ago
|
Status: NEW → ASSIGNED
| Assignee | ||
Comment 8•10 years ago
|
||
Comment on attachment 8612134 [details] [review]
[gaia] ian-liu:bluetooth/bug1168325_cannot_get_default_adatper_in_bluetooth_app > mozilla-b2g:master
Arthur,
The root case is as following. On Nexus 5, Bluetooth app sometimes cannot get default adapter via BluetoothAdapterManager module in |_initDefaultAdapter|. And we listen an in-corrected event name 'onattributechanged' via |addEventListener|.
In part of TransferManager, it's better to check |if (oldAdapter)| instead of |if (oldAdapter !== null)|. Because it's possible TransferManager cannot get default adapter immediately. And the |oldAdapter| is 'undefined'. It will make Bluetooth app |postError| to leave activity request without waiting default adapter 'attributechanged'.
Could you please help to review my pull request? Thanks.
Attachment #8612134 -
Flags: review?(arthur.chen)
Comment 9•10 years ago
|
||
Comment on attachment 8612134 [details] [review]
[gaia] ian-liu:bluetooth/bug1168325_cannot_get_default_adatper_in_bluetooth_app > mozilla-b2g:master
The patch makes sense. Please also fix other occurrences of `onattributechanged` in comments while you are on it, thanks!
Attachment #8612134 -
Flags: review?(arthur.chen) → review+
| Assignee | ||
Comment 10•10 years ago
|
||
Thanks for Arthur's suggestion. Beside of some comments are copied from WebBluetooth v2 MDN, all the naming 'onattributechanged' are replaced with 'attributechanged'. Some function name '_watchMozBluetoothOnattributechanged' are also replaced without prefix 'On'. We can land the patch after all tests are passed.
| Assignee | ||
Comment 11•10 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
| Assignee | ||
Updated•10 years ago
|
Component: Bluetooth → Gaia::Bluetooth
Comment 12•10 years ago
|
||
Hi Eric,
We have no this bluetooth build to verify, could you help to verify this bug? thanks :)
Flags: needinfo?(echang)
Comment 13•10 years ago
|
||
Try local gecko with patch from bug 1167064, 5/5 works. Thanks Jocelyn for the patch.
Status: RESOLVED → VERIFIED
Flags: needinfo?(echang)
You need to log in
before you can comment on or make changes to this bug.
Description
•