Closed Bug 1170509 Opened 6 years ago Closed 6 years ago

Work around broken function |get_remote_service_record|

Categories

(Firefox OS Graveyard :: Bluetooth, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(b2g-master fixed)

RESOLVED FIXED
FxOS-S6 (04Sep)
Tracking Status
b2g-master --- fixed

People

(Reporter: tzimmermann, Assigned: tzimmermann)

References

Details

Attachments

(1 file)

Calls to |get_remote_service_record| return incomplete data in the notification callback. See the TODOs in |btif_dm_remote_service_record_evt| in [1]. This bug has been present since the first version of Bluedroid, so every recent Android phone is affected.

We need to work around the problem to make SDP lookups work in Gecko. There's also bug 1142007 to keep track of a real fix in Bluedroid.

[1] https://android.googlesource.com/platform/external/bluetooth/bluedroid/+/master/btif/src/btif_dm.c
Attached file Github pull request
Shawn,

This pull request contains a workaround for the broken Bluedroid function. I'd like to get this merged in preparation of bug 1141616 and bug 1088574.

In case you want to test this, you can do so by

 1) applying the patches of bug 1141616, and
 2) sending an image to a connected device.

This should invoke the SDP service discovery in Gecko and trigger the workaround.
Attachment #8614006 - Flags: review?(shuang)
Summary: Workaround broken function |get_remote_service_record| → Work around broken function |get_remote_service_record|
Thomas,
I'm so sorry to review this patch so late. I will review it tomorrow.
Hey, no problem! I'm thinking about fixing bug 1088574 during Q3. So there's no urgency.
Hi Shawn,

can you give an ETA for reviewing the pull request or hand it over to someone else if you're busy. (Bruce?) Thanks!
(In reply to Thomas Zimmermann [:tzimmermann] [:tdz] from comment #4)
> Hi Shawn,
> 
> can you give an ETA for reviewing the pull request or hand it over to
> someone else if you're busy. (Bruce?) Thanks!

Hi Thomas,
Sorry for delay here. I have some concerns and I've updated comments on github.
Comment on attachment 8614006 [details] [review]
Github pull request

I've updated comments for this PR.
Attachment #8614006 - Flags: review?(shuang)
Comment on attachment 8614006 [details] [review]
Github pull request

Updated Github pull request:

  - added comment in sdpsrvc.c
  - fixed comment for workaround
  - use |ARRAY_LENGTH| when sanitizing service name
  - return an empty string for unknown service records
  - added comment about service names

I also submitted the bug to Google: https://code.google.com/p/android/issues/detail?id=179772
Attachment #8614006 - Flags: review?(shuang)
(In reply to Thomas Zimmermann [:tzimmermann] [:tdz] from comment #7)
> Comment on attachment 8614006 [details] [review]
> Github pull request
> 
> Updated Github pull request:
> I also submitted the bug to Google:
> https://code.google.com/p/android/issues/detail?id=179772

Is it correct title? Should be invalid response?
Right, but there seems to be no way of changing it now. I left a comment in the bug report. Maybe someone at Google can fix this.
Master: https://github.com/mozilla-b2g/platform_system_bluetoothd/commit/b0f9410d2f7111d2fc9b30e2f7bb14dd89af0259
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → FxOS-S6 (04Sep)
See Also: → 1204617
You need to log in before you can comment on or make changes to this bug.