Closed Bug 970238 Opened 6 years ago Closed 6 years ago

NFC: System app always send NFC_HW_STATE_DISABLE_DISCOVERY to Gecko

Categories

(Firefox OS Graveyard :: Gaia::System, defect)

ARM
Gonk (Firefox OS)
defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: allstars.chh, Assigned: allstars.chh)

References

Details

Attachments

(1 file)

I found now nfc_manager in System app always sends NFC_HW_STATE_DISABLE_DISCOVERY to gecko, so right now the device cannot detect tags nor devices anymore.

The root cause seems from 
https://github.com/mozilla-b2g/gaia/blob/master/apps/system/js/nfc_manager.js#L176

When the event type is 'unlock', evt.details is null,
so NFC_HW_STATE_DISABLE_DISCOVERY is always sent.
Also even when NFC is disabled in Settings,
nfc_manager still sends NFC_HW_STATE_DISABLE_DISCOVERY to Gecko.
This is triggered by the screenchange event.
Now I found if I disable Screen Lock from Settings App, the handleEvent in nfc_manager would not be called.
please ignore comment 3, I guess that's because I use an older branch. :(
My WIP patch.

https://github.com/allstarschh/gaia/commit/edd3e1ee41112007e44c7ac0df86faf3a32a2a73

However it still has some bugs,

When the Screen Lock is enabled, 
after the booting animation finishes,
screenchange event will come, at this time this.hwState is still off, so nothing will happend.

Then System app will get the value of nfc.enabled, so it will turn on the HW.
However at this time, the Screen is still locked, so supposely it should go into the DISABLE_DISCOVERY state, not ON state.
Attached file PullRequest
Assignee: nobody → allstars.chh
Attachment #8373988 - Flags: review?(alive)
Attachment #8373988 - Flags: review?(alive) → review+
BTW you have another bug's commit...
Component: NFC → Gaia::System
rebased, I'll merge it now.
merged,
https://github.com/mozilla-b2g/gaia/commit/a676cccc984bdf70f7be656796c5f2144ca35a21

Alive, you're the Man. :)
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.