[Bluetooth][System] updateConnected is not functional

RESOLVED FIXED

Status

Firefox OS
Gaia::Bluetooth
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: gasolin@mozilla.com, Assigned: gasolin@mozilla.com)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Assignee)

Description

4 years ago
according to https://github.com/mozilla-b2g/gaia/blob/master/apps/system/js/bluetooth.js#L209

updateConnected function is always return early because the mozBluetooth.isConnected is not a valid API (should be adapter.isConnected)
Created attachment 8554414 [details] [review]
[PullReq] gasolin:issue-1125735 to mozilla-b2g:master
(Assignee)

Comment 2

4 years ago
Comment on attachment 8554414 [details] [review]
[PullReq] gasolin:issue-1125735 to mozilla-b2g:master

updateConnected is the Bluetooth.js only function.
Since BT headphone icon already shown correctly for a long time, the responsibility of updateConnected must has been covered elsewhere. I suggest just remove the function.

Test on device, the earphone icon shows correctly.
Attachment #8554414 - Flags: review?(iliu)
Attachment #8554414 - Flags: feedback?(alive)
(Assignee)

Comment 3

4 years ago
Created attachment 8554426 [details]
earphone icon shows without the function
(Assignee)

Updated

4 years ago
Assignee: nobody → gasolin
Comment on attachment 8554414 [details] [review]
[PullReq] gasolin:issue-1125735 to mozilla-b2g:master

Per offline discussion with Fred, the function is not used for a long time. Since Fred's manually test are working fine for Bluetooth status(connection, file transfer) icon, r+ with me.
Attachment #8554414 - Flags: review?(iliu) → review+
Comment on attachment 8554414 [details] [review]
[PullReq] gasolin:issue-1125735 to mozilla-b2g:master

Can you invesigate how headphone icon/state works if we don't need to update isConnected?
Attachment #8554414 - Flags: feedback?(alive) → feedback+
(Assignee)

Comment 7

4 years ago
I found setProfileConnected will trigger statusbar bt profile change.


BT.updateConnected and BT._setProfileConnected are always called together. 

they will trigger bluetoothconnectionchange/ bluetoothprofileconnectionchange event to system.


So bluetoothconnectionchange is always not called in statusbar
https://github.com/mozilla-b2g/gaia/blob/master/apps/system/js/statusbar.js#L436

I've test without listen to `bluetoothconnectionchange` event in statusbar.js and all Bluetooth status(connection, file transfer) icon shows normally. Would you prefer I remove the statusbar part in this patch or do it after statusbar refactor landed?
Flags: needinfo?(alive)
(In reply to Fred Lin [:gasolin] from comment #7)
> I found setProfileConnected will trigger statusbar bt profile change.
> 
> 
> BT.updateConnected and BT._setProfileConnected are always called together. 
> 
> they will trigger bluetoothconnectionchange/
> bluetoothprofileconnectionchange event to system.
> 
> 
> So bluetoothconnectionchange is always not called in statusbar
> https://github.com/mozilla-b2g/gaia/blob/master/apps/system/js/statusbar.
> js#L436
> 
> I've test without listen to `bluetoothconnectionchange` event in
> statusbar.js and all Bluetooth status(connection, file transfer) icon shows
> normally. Would you prefer I remove the statusbar part in this patch or do
> it after statusbar refactor landed?

Okay doki, thx
Flags: needinfo?(alive)
(Assignee)

Comment 9

4 years ago
I also remove the statusbar part in this patch and test passed.

merged https://github.com/mozilla-b2g/gaia/commit/26ff17176143e3f1494c9b63ba68d1c9b6059d01

thanks!
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.