[B2G][Bluetooth] Unable to pair flame device with iphone one

RESOLVED DUPLICATE of bug 1122177

Status

defect
RESOLVED DUPLICATE of bug 1122177
5 years ago
4 years ago

People

(Reporter: noemi, Assigned: ben.tian)

Tracking

unspecified
ARM
Gonk (Firefox OS)
Dependency tree / graph

Firefox Tracking Flags

(blocking-b2g:2.2+, b2g-v2.0 affected, b2g-v2.1 affected, b2g-v2.2 affected, b2g-master affected)

Details

(Whiteboard: [POVB])

Attachments

(7 attachments)

Description: Unable to pair a flame device with an iphone one (tested with iphone 5s: v8.0(12A365) and iphone 6 v8).

STRs:
Bluetooth is ON
1- Go to Contacts, select a specific contact -> Share Contact -> Bluetooth
2- Search for devices -> select the iphone one
3- "Unable to pair devices"(*) message appear (please see "Unable_To_Pair_Devices.png" screenshot)
Notice that, sometimes, some seconds after this message(*) is shown, "pairing message" appears in both devices but accepting it doesn't get the pairing process done.

Actual result:
"Unable to pair devices" message appears 

Expected result:
flame and iphone devices are properly paired

Environmental variables:
Today's (3/18) v2.2 build:
Flame device
Gecko: 3e33c08
Gaia: 306772a
Build Id: 20150318081247
Platform version: 37.0

Today's (3/18) master build:
Flame device
Gecko: cebcc63
Gaia: 70bac3a
Build Id: 20150318082350
Plarform version: 39.0a1

It was working before and has a huge user impact so setting "regression" keyword and blocking-b2g:2.2? flag.
blocking-b2g: 2.2? → 2.2+
The bug may relate to bug 1122177 comment 65. Does pairing succeed if you acknowledge the message and retry?
Flags: needinfo?(noemi.freiredecarlos)
The bug results from the same cause of bug 1122177. Pairing fails since gecko receives callback with |STATUS_FAIL| from bluetooth stack. The fix to bluetooth stack is already on bug 1122177 comment 50 but we are unable to land it to qcom/AOSP bluedroid codebase. See bug 1122177 comment 71 for more details.

===
Log analysis:

Pairing fails when bluetooth stack is still discovering nearby devices. After user triggers pairing, stack reports |STATUS_FAIL| to gecko bluetooth as following log:

  GeckoBluetooth: BondStateChangedNotification: bond state 0 status 1  <--- status 1 means STATUS_FAIL

With fix on bug 1122177 comment 50, I cannot reproduce this bug within 10 trials. The fix retries pairing and prints following log if original problem is hit.

  bt-btm  : btm_sec_rmt_name_request_complete: but canceled, retry with pairing BDA
Flags: needinfo?(noemi.freiredecarlos)
Bug 1122177 comment 72 states a quick way to verify the fix.
See Also: → 1122177
Posted file bluetooth.txt
(In reply to Ben Tian [:btian] from comment #1)
>Does pairing succeed if you
> acknowledge the message and retry?

Hi,

No, it doesn't. That works in case of pairing two flame devices or a flame device with an Android one but not when trying to do it between a flame device and an iphone one, in that case, there is no way to successfully pair them.

I've followed the steps gathered in Bug 1122177 comment 72, please find attached the corresponding log "bluetooth.txt". I am not seeing there: bt-btm  : btm_sec_rmt_name_request_complete: but canceled, retry with pairing BDA

please do not hesitate to ask me if further details or additional tests are needed. Thanks!
The log shows connection is already established but following JS error is encountered:

W/GeckoConsole(  209): [JavaScript Error: "TypeError: sendingFilesSchedule is undefined" {file: "app://system.gaiamobile.org/js/bluetooth_transfer.js" line: 544}]

Noemi, some more questions:
1) Does the iphone appear in "paired devices" list next time if you retry sharing (back to Contacts app and share again)? In my trials pairing failure message pops but the iphone appears in "paired devices" list afterwards.
2) Can you attach symptom video for me to align the behavior we see?
Flags: needinfo?(noemi.freiredecarlos)
Can you pair with iphone from Bluetooth Settings page? This make the phone pair with iPhone directly.

One thing noted that iPhone doesn't support OPP profile, so you can't send contacts/photo/music via Bluetooth OPP profile.
The STR you tried is to send contact to iPhone and because iPhone doesn't expose OPP server, so connection cannot be established. If the Bluetooth OPP connection cannot be made, the authentication procedure won't be initialized. This is why you saw this error.

1. Try to establish OPP connection. The remote device requires authentication somehow.
2. If the remote device requires authentication per link, the remote device sends packets(pairing request) to Firefox Phone. If the remote device doesn't require authentication per link, Firefox OS sends contacts/photos/music directly.
Also ni? gaia dev to comment following JS error. Ian, what does the error mean? Does it relate to bug 1140247?

(In reply to Ben Tian [:btian] from comment #5)
> The log shows connection is already established but following JS error is
> encountered:
> 
> W/GeckoConsole(  209): [JavaScript Error: "TypeError: sendingFilesSchedule
> is undefined" {file: "app://system.gaiamobile.org/js/bluetooth_transfer.js"
> line: 544}]
Flags: needinfo?(iliu)
(In reply to Ben Tian [:btian] from comment #5)
> The log shows connection is already established but following JS error is
> encountered:
> 
> W/GeckoConsole(  209): [JavaScript Error: "TypeError: sendingFilesSchedule
> is undefined" {file: "app://system.gaiamobile.org/js/bluetooth_transfer.js"
> line: 544}]
> 
> Noemi, some more questions:
> 1) Does the iphone appear in "paired devices" list next time if you retry
> sharing (back to Contacts app and share again)? In my trials pairing failure
> message pops but the iphone appears in "paired devices" list afterwards.
Yes, it does. In iphone device it appears listed under MY DEVICES but as Not Connected.
> 2) Can you attach symptom video for me to align the behavior we see?
sure!, i'll leave ni to me till attaching it
Flags: needinfo?(noemi.freiredecarlos)
(In reply to Shawn Huang [:shawnjohnjr] from comment #6)
> Can you pair with iphone from Bluetooth Settings page? This make the phone
> pair with iPhone directly.
> 
No, i can't, the same behavior is observed
(In reply to Noemí Freire (:noemi) from comment #8)
> (In reply to Ben Tian [:btian] from comment #5)
> > The log shows connection is already established but following JS error is
> > encountered:
> > 
> > W/GeckoConsole(  209): [JavaScript Error: "TypeError: sendingFilesSchedule
> > is undefined" {file: "app://system.gaiamobile.org/js/bluetooth_transfer.js"
> > line: 544}]
> > 
> > Noemi, some more questions:
> > 1) Does the iphone appear in "paired devices" list next time if you retry
> > sharing (back to Contacts app and share again)? In my trials pairing failure
> > message pops but the iphone appears in "paired devices" list afterwards.
> Yes, it does. In iphone device it appears listed under MY DEVICES but as Not
> Connected.
> > 2) Can you attach symptom video for me to align the behavior we see?
> sure!, i'll leave ni to me till attaching it

Forgot to mention also the corresponding log file for investigation. Thanks!
(In reply to Noemí Freire (:noemi) from comment #8)
> > 2) Can you attach symptom video for me to align the behavior we see?
> sure!, i'll leave ni to me till attaching it

Set ni? again till Noemi attach symptom video.
Flags: needinfo?(noemi.freiredecarlos)
Assignee: nobody → shuang
Depends on: 1122177
Steal this bug since I'm investigating it first.
Assignee: shuang → btian
Posted file bluetooth6.txt
Hi,

Please find attached the log corresponding to the symptom video available in the following link: https://www.youtube.com/watch?v=lf6A53ioZ5c
Flags: needinfo?(noemi.freiredecarlos)
Thanks for the video and log!

This is a different problem from comment 0 since pairing failure message doesn't appear in the video. Pairing already succeeds as iphone shows under "Paired Devices" of Flame but transfer is pending. Gecko logs show connection is disconnected:

  I/GeckoBluetooth(  209): OnSocketDisconnect: [client]
  I/GeckoBluetooth(  209): DiscardBlobsToSend: idx 0
  I/GeckoBluetooth(  209): ProcessNextBatch: REMOVE. 0 remaining

The symptom aligns what I see but some gaia error I met doesn't print.

Noemi, one more question, in the video did you reproduce with central or 2.2 build?

(In reply to Noemí Freire (:noemi) from comment #13)
> Created attachment 8579911 [details]
> bluetooth6.txt
> 
> Hi,
> 
> Please find attached the log corresponding to the symptom video available in
> the following link: https://www.youtube.com/watch?v=lf6A53ioZ5c
Flags: needinfo?(noemi.freiredecarlos)
(In reply to Ben Tian [:btian] from comment #14)
> Thanks for the video and log!
> 
> This is a different problem from comment 0 since pairing failure message
> doesn't appear in the video. Pairing already succeeds as iphone shows under
> "Paired Devices" of Flame but transfer is pending. Gecko logs show
> connection is disconnected:
> 
>   I/GeckoBluetooth(  209): OnSocketDisconnect: [client]
>   I/GeckoBluetooth(  209): DiscardBlobsToSend: idx 0
>   I/GeckoBluetooth(  209): ProcessNextBatch: REMOVE. 0 remaining
> 
> The symptom aligns what I see but some gaia error I met doesn't print.
> 
> Noemi, one more question, in the video did you reproduce with central or 2.2
> build?


Hi,

I'm not sure if pairing process success since iphone device is showing "Not Connected" message. Please notice that "Unable to pair device" message also appears, it depends on the attempt.
The behavior reported is observed in master and 2.2 branches (the video has been recorded on master branch)
Flags: needinfo?(noemi.freiredecarlos)
(In reply to Noemí Freire (:noemi) from comment #15)
> I'm not sure if pairing process success since iphone device is showing "Not
> Connected" message. Please notice that "Unable to pair device" message also
> appears, it depends on the attempt.

What to you mean "depends on the attempt"?
Flags: needinfo?(noemi.freiredecarlos)
(In reply to Ben Tian [:btian] from comment #16)
> (In reply to Noemí Freire (:noemi) from comment #15)
> > I'm not sure if pairing process success since iphone device is showing "Not
> > Connected" message. Please notice that "Unable to pair device" message also
> > appears, it depends on the attempt.
> 
> What to you mean "depends on the attempt"?

Sometimes when trying to pair with an iphone device you see "Unable to pair" message and some other times you see pairing screens appearing in both devices but the result is the same, devices are nor properly paired. Although flame device is showing the iphone device under Paired devices, the iphone is showing Not connected message and when clicking on it "Flame device not supported" message appears.
Flags: needinfo?(noemi.freiredecarlos)
Hi,

Please find attached a log corresponding to "Unable to pair" scenario. The video is available in the following link: https://www.youtube.com/watch?v=J0mDxp9jnYQ
(In reply to Noemí Freire (:noemi) from comment #17)
> Sometimes when trying to pair with an iphone device you see "Unable to pair"
> message and some other times you see pairing screens appearing in both
> devices but the result is the same, devices are nor properly paired.
> Although flame device is showing the iphone device under Paired devices, the
> iphone is showing Not connected message and when clicking on it "Flame
> device not supported" message appears.

Does "Unable to pair" still show after you apply steps in bug 1122177 comment 72? If so the behavior is inconsistent to what I met.
Flags: needinfo?(noemi.freiredecarlos)
(In reply to Ben Tian [:btian] from comment #19)
> (In reply to Noemí Freire (:noemi) from comment #17)
> > Sometimes when trying to pair with an iphone device you see "Unable to pair"
> > message and some other times you see pairing screens appearing in both
> > devices but the result is the same, devices are nor properly paired.
> > Although flame device is showing the iphone device under Paired devices, the
> > iphone is showing Not connected message and when clicking on it "Flame
> > device not supported" message appears.
> 
> Does "Unable to pair" still show after you apply steps in bug 1122177
> comment 72? If so the behavior is inconsistent to what I met.

mmm, the log and video gathered in comment 18 have been taken after applying steps in bug 1122177 comment 72 and after switching off/on again the device
Flags: needinfo?(noemi.freiredecarlos)
Noemi, some more things needs your help:

1) Can you upload the lib you use for me to double confirm? Steps:
   - connect your device to USB
   - type "adb pull system/lib/hw/bluetooth.default.so" in terminal
   - upload the pulled .so file
 
2) After you reproduce as comment 13, does notification tray contains the two items as attached jpg?

3) You mentioned this is a regression. So before 2.2 you have shared contacts from Flame to iphone successfully, right?
Flags: needinfo?(noemi.freiredecarlos)
Update investigation progress so far:

1) "Unable To Pair" message (as comment 18):
   Clarifying whether bug 1122177 comment 72 is applied correctly. In my trials the message never shows with patched bluedroid lib. 

2) "Not Connected" problem (as comment 13):
   Confirm whether error notification pops. Contacts sharing from Flame to iphone should never succeed before since iphone doesn't accept OPP connection (comment 6). Note Nexus-4 JB cannot share contacts to iphone either.
Noemi, some more things needs your help:

1) Can you upload the lib you use for me to double confirm? Steps:
   - connect your device to USB
   - type "adb pull system/lib/hw/bluetooth.default.so" in terminal
   - upload the pulled .so file

> Please find the lib attached 

2) After you reproduce as comment 13, does notification tray contains the two items as attached jpg?
>Yes, under comment 13 scenario, both notifications appear on notification tray. Notice that under "unable to pair" scenario (comment 18) there is no message at all on notification tray

3) You mentioned this is a regression. So before 2.2 you have shared contacts from Flame to iphone successfully, right?
sharing contacts from contact details screen via BT is a feature from 2.2. I think, pairing with an iphone device (i.e export contact via BT from settings) was working before, setting qawanted flag to verify it for 2.1 branch
Flags: needinfo?(noemi.freiredecarlos)
Keywords: qawanted
mmm, i see the same behavior, "paired but not connected" on an android device, when i try to pair it with an iphone (Not Connected massage here too)...there may be some apple's restriction?
I am checking in older FxOS versions (2.0 and 2.1) and it's not possible to pair a FxOS device (neither other Android one, at least in my testing) with an iphone, so I suspect that we have never been able to share any files with Iphone handsets.

For the time being, I am removing the regression keyword, but I am leaving the qawanted to confirm what I am seeing.
Keywords: regression
(In reply to Maria Angeles Oteo (:oteo) from comment #25)
> I am checking in older FxOS versions (2.0 and 2.1) and it's not possible to
> pair a FxOS device (neither other Android one, at least in my testing) with
> an iphone, so I suspect that we have never been able to share any files with
> Iphone handsets.
> 
> For the time being, I am removing the regression keyword, but I am leaving
> the qawanted to confirm what I am seeing.

I want to clarify one thing. 'Pair' is just to 'authenticate' with the remote device. It doesn't involve creating OPP connection in between and start to share files as I said in Comment 6.
iOS doesn't support OPP file transfer so you cannot send any file via Bluetooth OPP profile.

The original bug description mentioned that we fail to pair, and the screenshot also shows the symptom (bug 1122177). Later, we further clarify in Comment 8, FxOS actually paired but not connected, this is normal. So it's very likely the bug is related to bug 1122177 Comment 7, the error message shown in the dialog. I suggest to change the title of this bug.
Thanks Shawn for the clarification,
In that case, you are right, I am able to pair but I am not able to see in the iphone the paired device as connected and therefore it's not able to transfer any file.

Otherwise, the issue reported by Noemi originally and with the video/log included in comment 18 happens when trying to pair so it seems that there is still an issue with the pairing (therefore the title is correct), I've also been able to see it but it's not very often to reproduce.
(In reply to Maria Angeles Oteo (:oteo) from comment #27)
> Otherwise, the issue reported by Noemi originally and with the video/log
> included in comment 18 happens when trying to pair so it seems that there is
> still an issue with the pairing (therefore the title is correct), I've also
> been able to see it but it's not very often to reproduce.

I've checked the attachment bluetooth.default.so in this bug and the file size is different from attachment in bug 1122177 Comment 72. It looks like the patched binary library was not been pushed into the device. Can we make sure the library (bug 1122177 Comment 72) push correctly into device?
The behavior described on comment 25 applies to Flame 2.1 and Flame 2.0. Tested with an iPhone 6 Plus with OS version 8.3. On the iPhone device it would display the Flame as paired but not connected, and file transfers cannot be done between these two devices.

Device: Flame 2.1
BuildID: 20150319001227
Gaia: 13c85d57f49b4bfd657ff674f2b530c141c94803
Gecko: cd8d3214bffd
Gonk: b83fc73de7b64594cd74b33e498bf08332b5d87b
Version: 34.0 (2.1) 
Firmware Version: v18D-1
User Agent: Mozilla/5.0 (Mobile; rv:34.0) Gecko/34.0 Firefox/34.0

Device: Flame 2.0
BuildID: 20150319000203
Gaia: 896803174633fc6acd3fd105f81c349b8e9b9633
Gecko: 3db01d6d6df5
Gonk: b83fc73de7b64594cd74b33e498bf08332b5d87b
Version: 32.0 (2.0) 
Firmware Version: v18D-1
User Agent: Mozilla/5.0 (Mobile; rv:32.0) Gecko/32.0 Firefox/32.0
QA Whiteboard: [QAnalyst-Triage?]
Flags: needinfo?(ktucker)
Keywords: qawanted
QA Whiteboard: [QAnalyst-Triage?] → [QAnalyst-Triage+]
Flags: needinfo?(ktucker)
Hi,

I've just re-checked "unable to pair" issue using the lib attached. I've not been able to reproduce the issue in 10 attempts. It seems this lib fixes this issue, because of this, I'm marking this issue as DUPLICATE OF Bug 1122177. On the other hand, is there any estimate about when this patch will be included within qcom/AOSP bluedroid codebase?. Thanks!
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1122177
ni to Ben per comment 30, waiting for your feedback. thanks!
Flags: needinfo?(btian)
In my investigation, I'm able to use FFOS phone to pair with iPhone 6. Sometimes, I cannot pair with iPhone 6 in the first time. I have to try to pair twice. Then, it usually works fine for me.

Ben, per question you mentioned in comment 7, the JS error log is caused as following.

The error log is happened in summarizeSentFilesReport(). It means that _onTransferComplete() is called from system message 'bluetooth-opp-transfer-complete'[1]. 

Why the sendingFilesSchedule is undefined:
The 'bluetooth-opp-transfer-complete' system message is coming more quickly than postMessageToSystemApp()[2] from Bluetooth app. So that System app cannot access the sending file schedule which is trigger in Bluetooth app.

BTW, I see 'bluetooth-opp-transfer-complete' system message is coming twice for a file sending completely.
Sometimes, I see the JS error twice. Because both of the system message are coming earlier than postMessageToSystemApp().
Sometimes, I see the jS error once. Because the first of the 'bluetooth-opp-transfer-complete' system message is coming after postMessageToSystemApp(). And clean up the queue for sending file schedule. But the second 'bluetooth-opp-transfer-complete' system message, will trigger system app to access it again. In this time, there is no info for it.

In fact, if the above problem is reproduced, iPhone is already paired with FFOS phone. Bluetooth app only sends file(s) to a paired device. This is the basic criteria.

[1]: https://github.com/mozilla-b2g/gaia/blob/master/apps/system/js/bluetooth_transfer.js#L58-L59
[2]: https://github.com/mozilla-b2g/gaia/blob/master/apps/bluetooth/js/transfer.js#L189
Flags: needinfo?(iliu)
Noemi, I prefer to reopen to track this POVB bug. We don't have estimated time now as qcom refuses to review this patch (bug 1122177 comment 70).
Status: RESOLVED → REOPENED
Flags: needinfo?(btian)
Resolution: DUPLICATE → ---
Whiteboard: [POVB]
(In reply to Ben Tian [:btian][OOO since 3/26] from comment #34)
> Noemi, I prefer to reopen to track this POVB bug. We don't have estimated
> time now as qcom refuses to review this patch (bug 1122177 comment 70).

Hi Ben,

Thanks for the info. Per bug 1122177 comment 70 it seems the patch should be directly contributed to AOSP (Bluedroid), do you know if this process has been initiated?. Thanks!
Flags: needinfo?(btian)
The main root cause is the same as Bug 1122177 
Closed and keep tracing this issue on the Bug mentioned above
Status: REOPENED → RESOLVED
Closed: 5 years ago5 years ago
Resolution: --- → FIXED
Per comment 36 marking this issue as duplicate of Bug 1122177. Thanks!
Resolution: FIXED → DUPLICATE
Duplicate of bug: 1122177
Clear my ni? and track in bug 1122177 comment 74.
Flags: needinfo?(btian)
(In reply to Noemí Freire (:noemi) from comment #35)
> (In reply to Ben Tian [:btian][OOO since 3/26] from comment #34)
> > Noemi, I prefer to reopen to track this POVB bug. We don't have estimated
> > time now as qcom refuses to review this patch (bug 1122177 comment 70).
> 
> Hi Ben,
> 
> Thanks for the info. Per bug 1122177 comment 70 it seems the patch should be
> directly contributed to AOSP (Bluedroid), do you know if this process has
> been initiated?. Thanks!

I've summited to AOSP code review and also opened a bug.
Issue 162457: 	[bluedroid]Potential race condition cause create_bond fail while discoverying devices
https://code.google.com/p/android/issues/detail?id=162457&thanks=162457&ts=1427781250

I just sent my patch for review:
https://android-review.googlesource.com/144601
(In reply to Shawn Huang [:shawnjohnjr] from comment #39)
> (In reply to Noemí Freire (:noemi) from comment #35)
> > (In reply to Ben Tian [:btian][OOO since 3/26] from comment #34)
> > > Noemi, I prefer to reopen to track this POVB bug. We don't have estimated
> > > time now as qcom refuses to review this patch (bug 1122177 comment 70).
> > 
> > Hi Ben,
> > 
> > Thanks for the info. Per bug 1122177 comment 70 it seems the patch should be
> > directly contributed to AOSP (Bluedroid), do you know if this process has
> > been initiated?. Thanks!
> 
> I've summited to AOSP code review and also opened a bug.
> Issue 162457: 	[bluedroid]Potential race condition cause create_bond fail
> while discoverying devices
> https://code.google.com/p/android/issues/
> detail?id=162457&thanks=162457&ts=1427781250
> 
> I just sent my patch for review:
> https://android-review.googlesource.com/144601

Many Thanks!
You need to log in before you can comment on or make changes to this bug.