[NFC] After viewing notification, the foreground app cannot receive NFC event.

VERIFIED FIXED in 2.2 S13 (29may)

Status

defect
VERIFIED FIXED
4 years ago
4 years ago

People

(Reporter: ashiue, Assigned: alive)

Tracking

unspecified
2.2 S13 (29may)
ARM
Gonk (Firefox OS)
Dependency tree / graph

Firefox Tracking Flags

(blocking-b2g:2.2+, b2g-v2.2 verified, b2g-master verified)

Details

Attachments

(3 attachments)

(Reporter)

Description

4 years ago
Build ID               20150517002501
Gaia Revision          b388a235e89dab76c24323767cd87ebd7c4c8b17
Gaia Date              2015-05-15 16:08:41
Gecko Revision         https://hg.mozilla.org/releases/mozilla-b2g37_v2_2/rev/54ae7c7182bc
Gecko Version          37.0
Device Name            flame
Firmware(Release)      4.4.2
Firmware(Incremental)  eng.cltbld.20150517.041427
Firmware Date          Sun May 17 04:14:38 EDT 2015
Bootloader             L1TC100118D0

STR:
1. Launch NFC test app, and go to NFC Read Tag
2. Receive an image from others
3. Open the received the image via notification (NFC test app still running on foreground)
4. Exit image preview, and tap a tag which contains URL on device

Expected result:
Show NFC tag information on test app

Actual result:
Open the URL via browser, please refer: https://youtu.be/nTJ2ldSSuV4
(Reporter)

Updated

4 years ago
QA Whiteboard: [COM=NFC]
Summary: [NFC] After received image was once previewed through notification, system app would still re-dispatch NFC event even if current app which can process it → [NFC] After viewing notification, the foreground app cannot receive NFC event.
(Reporter)

Comment 1

4 years ago
NFC app is launched. at line 897 : 
I/Gecko   (  208): -*- Nfc: Received message from content process: {"target":{},"name":"NFC:SetFocusApp","sync":false,"json":{"tabId":20,"isFocus":true},"data":{"tabId":20,"isFocus":true},"objects":{}}

The notification is viewed at line 1368
I/GeckoDump(  208): XXX FIXME : Got a mozContentEvent: activity-choice

And foreground app was set to the notifcation window at line 1414
I/Gecko   (  208): -*- Nfc: Received message from content process: {"target":{},"name":"NFC:SetFocusApp","sync":false,"json":{"tabId":26,"isFocus":true},"data":{"tabId":26,"isFocus":true},"objects":{}}

And the notification is dismissed in line 1441
I/Gecko   (  208): -*- Nfc: Received message from content process: {"target":{},"name":"NFC:SetFocusApp","sync":false,"json":{"tabId":26,"isFocus":false},"data":{"tabId":26,"isFocus":false},"objects":{}}

However I found System app doesn't call
setFocusApp(tabId: 20, isFocus: true) here.

It seems a bug from System app,

ni? for Alive to confirm this.
Flags: needinfo?(alive)
Assignee: nobody → alive
Flags: needinfo?(alive)
(In reply to Yoshi Huang[:allstars.chh] from comment #2)
> NFC app is launched. at line 897 : 
> I/Gecko   (  208): -*- Nfc: Received message from content process:
> {"target":{},"name":"NFC:SetFocusApp","sync":false,"json":{"tabId":20,
> "isFocus":true},"data":{"tabId":20,"isFocus":true},"objects":{}}
> 
> The notification is viewed at line 1368
> I/GeckoDump(  208): XXX FIXME : Got a mozContentEvent: activity-choice
> 
> And foreground app was set to the notifcation window at line 1414
> I/Gecko   (  208): -*- Nfc: Received message from content process:
> {"target":{},"name":"NFC:SetFocusApp","sync":false,"json":{"tabId":26,
> "isFocus":true},"data":{"tabId":26,"isFocus":true},"objects":{}}
> 
> And the notification is dismissed in line 1441
> I/Gecko   (  208): -*- Nfc: Received message from content process:
> {"target":{},"name":"NFC:SetFocusApp","sync":false,"json":{"tabId":26,
> "isFocus":false},"data":{"tabId":26,"isFocus":false},"objects":{}}
> 
> However I found System app doesn't call
> setFocusApp(tabId: 20, isFocus: true) here.
> 
> It seems a bug from System app,
> 
> ni? for Alive to confirm this.

Does this mean the nfc focus did not go back to the NFC app after closing the notification window?
(In reply to Alive Kuo [:alive][NEEDINFO!] from comment #3)
> Does this mean the nfc focus did not go back to the NFC app after closing
> the notification window?
Yeah, I think so, when opening/closing window, there are always two setFocusApp calls.
setFocusApp(newApp, true);
setFocusApp(oldApp, false);

But after notification is closed, only setFocusApp(oldApp, false); is called.
Comment on attachment 8608483 [details] [review]
[gaia] alivedise:bugzilla/1166595/set-nfc-focus-fail-to-fallback > mozilla-b2g:master

A missing case when introducing setNFCFocus
Attachment #8608483 - Flags: review?(etienne)
Attachment #8608483 - Flags: feedback?(allstars.chh)
Comment on attachment 8608483 [details] [review]
[gaia] alivedise:bugzilla/1166595/set-nfc-focus-fail-to-fallback > mozilla-b2g:master

yeah, it works.
Thanks
Attachment #8608483 - Flags: feedback?(allstars.chh) → feedback+
This should be 2.2+
blocking-b2g: --- → 2.2?
Component: NFC → Gaia::System::Window Mgmt
Comment on attachment 8608483 [details] [review]
[gaia] alivedise:bugzilla/1166595/set-nfc-focus-fail-to-fallback > mozilla-b2g:master

lgtm.
r=me with the extra console.log removed
Attachment #8608483 - Flags: review?(etienne) → review+

Updated

4 years ago
blocking-b2g: 2.2? → 2.2+
https://github.com/mozilla-b2g/gaia/commit/a1507a1c7e37f09737e7da332d7bd4f742e08fec
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Comment on attachment 8608483 [details] [review]
[gaia] alivedise:bugzilla/1166595/set-nfc-focus-fail-to-fallback > mozilla-b2g:master

[Approval Request Comment]
[Bug caused by] (feature/regressing bug #):
setNFCFocus missing feature
[User impact] if declined: NFC will malfunction once there is any activity opened and closed
[Testing completed]: Y
[Risk to taking this patch] (and alternatives if risky): riskless.
[String changes made]: N
Attachment #8608483 - Flags: approval-gaia-v2.2?

Updated

4 years ago
Keywords: verifyme
Requesting QA verify on master before approving 2.2
This bug has been verified as pass on latest Nightly build of Flame v3.0 and Nexus 5 v3.0 by the STR in Comment 0.

Actual results: After exiting image preview and then tapping a tag which contains URL,device shows NFC tag information on test app and will not go to Browser.
See attachment: verified_v3.0.mp4
Reproduce rate: 0/6

------------------------------------------------------------------------
Device: Flame v3.0 build(Pass)
Build ID               20150525160205
Gaia Revision          5bcc08a732163087999251b523e3643db397412c
Gaia Date              2015-05-24 14:44:40
Gecko Revision         https://hg.mozilla.org/mozilla-central/rev/b6623a27fa64
Gecko Version          41.0a1
Device Name            flame
Firmware(Release)      4.4.2
Firmware(Incremental)  eng.cltbld.20150525.192755
Firmware Date          Mon May 25 19:28:07 EDT 2015
Bootloader             L1TC000118D0

Device: Nexus 5 v3.0 build(Pass)
Build ID               20150525160205
Gaia Revision          5bcc08a732163087999251b523e3643db397412c
Gaia Date              2015-05-24 14:44:40
Gecko Revision         https://hg.mozilla.org/mozilla-central/rev/b6623a27fa64
Gecko Version          41.0a1
Device Name            hammerhead
Firmware(Release)      5.1
Firmware(Incremental)  eng.cltbld.20150525.192207
Firmware Date          Mon May 25 19:22:24 EDT 2015
Bootloader             HHZ12f

------------------------------------
Leaving "verifyme" for v2.2 uplift/verification.
QA Whiteboard: [COM=NFC] → [COM=NFC][MGSEI-Triage+]

Updated

4 years ago
Attachment #8608483 - Flags: approval-gaia-v2.2? → approval-gaia-v2.2+
(Reporter)

Comment 16

4 years ago
Verified on v2.2:
Build ID               20150526162504
Gaia Revision          15fa6e486b5c82956a8e8f8a99c39d297e8f0523
Gaia Date              2015-05-26 20:07:31
Gecko Revision         https://hg.mozilla.org/releases/mozilla-b2g37_v2_2/rev/663bf4703588
Gecko Version          37.0
Device Name            flame
Firmware(Release)      4.4.2
Firmware(Incremental)  eng.cltbld.20150526.201446
Firmware Date          Tue May 26 20:14:55 EDT 2015
Bootloader             L1TC100118D0
Status: RESOLVED → VERIFIED
Per Comment 13 and Comment 16,clear "verifyme" keywords.
Keywords: verifyme
You need to log in before you can comment on or make changes to this bug.