Closed Bug 1029303 Opened 10 years ago Closed 10 years ago

[NFC][Bluetooth] NFC file sharing failed sometimes

Categories

(Firefox OS Graveyard :: NFC, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(blocking-b2g:2.0+, b2g-v2.0 fixed, b2g-v2.1 fixed)

VERIFIED FIXED
2.0 S5 (4july)
blocking-b2g 2.0+
Tracking Status
b2g-v2.0 --- fixed
b2g-v2.1 --- fixed

People

(Reporter: ashiue, Assigned: arthurcc)

References

Details

Attachments

(2 files)

Gaia      7bb5daea0f37d4371e9daa08045d45fef3b30344
Gecko     https://hg.mozilla.org/releases/mozilla-aurora/rev/304ea70beed9
BuildID   20140623160203
Version   32.0a2

STR:
1. Turn on "NFC" for 2 phones
2. Make sure 2 phones do not BT paired
3. Turn off "bluetooth" on receiver phone
4. Sender phone send an image via NFC

Expected result:
Receiver phone would get file successfully

Actual result:
2 phones do not pair and file transfer failed
blocking-b2g: --- → 2.0?
Blocks: b2g-NFC-2.0
Vance - Do we know if TCL would cert block on this for NFC?

Sandip - Can you make a product call on a blocking decision here?
Flags: needinfo?(vchen)
Flags: needinfo?(skamat)
are both devices fxos? what does the UX show upon failure?
Flags: needinfo?(skamat) → needinfo?(ashiue)
I tested on both fxos devices, and I tried again on today's build.
Gaia      552ef3e7d00384e4f7ac43d8fab6b91c69cc26c1
Gecko     https://hg.mozilla.org/releases/mozilla-aurora/rev/e2b83f618868
BuildID   20140624160200
Version   32.0a2

The problem now is file transfer would fail sometimes no matter BT on or off, I do not find the exact STR currently, but this issue can be reproduced easily.
Flags: needinfo?(ashiue)
Summary: [NFC][Bluetooth] NFC file sharing failed when receiver side turn off BT initial and does not paired device with sender side previously → [NFC][Bluetooth] NFC file sharing failed sometimes
Flags: needinfo?(vchen)
blocking-b2g: 2.0? → 2.0+
I tested with today's aurora (2.0), and I found that if the receiver's bt is off, file can't be sent. I checked the log and found two errors might be related:

 E/GeckoConsole(  293): [JavaScript Error: "Unable to create NFCPeer object, Reason:  Bad SessionToken {8ffae068-494b-437f-884b-0f84e875be1c}" {file: "jar:file:///system/b2g/omni.ja!/components/nsNfc.js" line: 202}]
E/GeckoConsole(  293): [JavaScript Error: "NS_ERROR_UNEXPECTED: " {file: "app://system.gaiamobile.org/js/nfc_handover_manager.js" line: 218}]

This is the same as the result that I tested on my Flame with the latest gecko/gaia master this Wednesday. Yoshi should be aware of it because I told him about this on that day.

ni? EPM Wesley who is responsible for NFC and hope he could find someone to take a look.
Flags: needinfo?(whuang)
As it seems not clear what the root cause is, perhaps Yoshi can take a look and clarify from the log where/why the error comes out.
Flags: needinfo?(whuang) → needinfo?(allstars.chh)
(In reply to Eric Chou [:ericchou] [:echou] from comment #4)
>  E/GeckoConsole(  293): [JavaScript Error: "Unable to create NFCPeer object,
> Reason:  Bad SessionToken {8ffae068-494b-437f-884b-0f84e875be1c}" {file:
> "jar:file:///system/b2g/omni.ja!/components/nsNfc.js" line: 202}]
> E/GeckoConsole(  293): [JavaScript Error: "NS_ERROR_UNEXPECTED: " {file:
> "app://system.gaiamobile.org/js/nfc_handover_manager.js" line: 218}]

This should be normal behavior, I reproduced this once with *rapidly and repeatly* tapping the other Flame, this error means the other phone has been away so the handover
cannot take place.

Also discussed with Alison she didn't re-produce this like way, so I think this should be some problems in BT-side.
Flags: needinfo?(allstars.chh)
(In reply to Yoshi Huang[:allstars.chh] from comment #6)
> (In reply to Eric Chou [:ericchou] [:echou] from comment #4)
> >  E/GeckoConsole(  293): [JavaScript Error: "Unable to create NFCPeer object,
> > Reason:  Bad SessionToken {8ffae068-494b-437f-884b-0f84e875be1c}" {file:
> > "jar:file:///system/b2g/omni.ja!/components/nsNfc.js" line: 202}]
> > E/GeckoConsole(  293): [JavaScript Error: "NS_ERROR_UNEXPECTED: " {file:
> > "app://system.gaiamobile.org/js/nfc_handover_manager.js" line: 218}]
> 
> This should be normal behavior, I reproduced this once with *rapidly and
> repeatly* tapping the other Flame, this error means the other phone has been
> away so the handover
> cannot take place.
> 
> Also discussed with Alison she didn't re-produce this like way, so I think
> this should be some problems in BT-side.

Per offline test and discussion with Yoshi and QA Alison, we found there may be two potential bugs here:

1) as I mentioned in comment 4, sometimes BT is on after NFC handover, however the file transfer doesn't begin, the error log shows. The complete log has been sent to Yoshi.

2) if Settings app has been launched, even if it's not at the foreground, once bluetooth is enabled after NFC handover, adapter.startDiscovery() would be called from the event handler which is written in Settings app. As I mentioned several times in other bugs (), discovery(inquiry) is a heavy procedure and we should only do it if it's truly necessary. At least we shouldn't start discovering while Settings app is not at the front. Talked with Arthur, the peer of Settings app, and he will follow up on this.
(In reply to Eric Chou [:ericchou] [:echou] from comment #7)
> (In reply to Yoshi Huang[:allstars.chh] from comment #6)
> > (In reply to Eric Chou [:ericchou] [:echou] from comment #4)
> > >  E/GeckoConsole(  293): [JavaScript Error: "Unable to create NFCPeer object,
> > > Reason:  Bad SessionToken {8ffae068-494b-437f-884b-0f84e875be1c}" {file:
> > > "jar:file:///system/b2g/omni.ja!/components/nsNfc.js" line: 202}]
> > > E/GeckoConsole(  293): [JavaScript Error: "NS_ERROR_UNEXPECTED: " {file:
> > > "app://system.gaiamobile.org/js/nfc_handover_manager.js" line: 218}]
> > 
> > This should be normal behavior, I reproduced this once with *rapidly and
> > repeatly* tapping the other Flame, this error means the other phone has been
> > away so the handover
> > cannot take place.
> > 
> > Also discussed with Alison she didn't re-produce this like way, so I think
> > this should be some problems in BT-side.
> 
> Per offline test and discussion with Yoshi and QA Alison, we found there may
> be two potential bugs here:
> 
> 1) as I mentioned in comment 4, sometimes BT is on after NFC handover,
> however the file transfer doesn't begin, the error log shows. The complete
> log has been sent to Yoshi.
> 
> 2) if Settings app has been launched, even if it's not at the foreground,
> once bluetooth is enabled after NFC handover, adapter.startDiscovery() would
> be called from the event handler which is written in Settings app. As I
> mentioned several times in other bugs (), discovery(inquiry) is a heavy

Forgot to fill out the bug number: bug 873352, bug 942744

> procedure and we should only do it if it's truly necessary. At least we
> shouldn't start discovering while Settings app is not at the front. Talked
> with Arthur, the peer of Settings app, and he will follow up on this.
(In reply to Eric Chou [:ericchou] [:echou] from comment #4)
>  E/GeckoConsole(  293): [JavaScript Error: "Unable to create NFCPeer object,
> Reason:  Bad SessionToken {8ffae068-494b-437f-884b-0f84e875be1c}" {file:
> "jar:file:///system/b2g/omni.ja!/components/nsNfc.js" line: 202}]
> E/GeckoConsole(  293): [JavaScript Error: "NS_ERROR_UNEXPECTED: " {file:
> "app://system.gaiamobile.org/js/nfc_handover_manager.js" line: 218}]
> 

File Bug 1031993 for this.
Per comment 7, let's not discover bluetooth devices when settings is in background. EJ, could you help review the patch? Thanks.
Attachment #8447823 - Flags: review?(ejchen)
Assignee: nobody → arthur.chen
Thanks!

master: 50ff5fca6838aebabc7deb733f25cc45c72284bc
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Verify on
Gaia      90605754e9bdbe20f3999522f9e1aec600c422a4
Gecko     https://hg.mozilla.org/releases/mozilla-aurora/rev/0bffc7e5d8a2
BuildID   20140702160207
Version   32.0a2

Following scenarios should not discover bluetooth devices:
1. Turn on BT via notification
2. BT on/off and kill settings app, and then share file via NFC 
3. BT on/off and let settings BT page running on the background, and then share file via NFC
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: