Closed Bug 1102019 Opened 10 years ago Closed 9 years ago

[User Story] [NFC] Making NFC APIs privileged so 3rd party apps can use them

Categories

(Firefox OS Graveyard :: NFC, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(feature-b2g:2.2+, tracking-b2g:backlog)

RESOLVED FIXED
2.2 S6 (20feb)
feature-b2g 2.2+
tracking-b2g backlog

People

(Reporter: skamat, Assigned: vchang)

References

Details

(Whiteboard: [ucid:NFC20, 2.2, FT:RIL])

User Story

Summary: 

As a developer, I would like to use NFC APIs for my 3rd party apps.

Details: 

Currently (upto release v2.1) the NFC APIs are "certified APIs" i.e. available for certified apps only. We would like to make these APIs available to 3rd party developer apps, so these need to be made into "privileged APIs".

Here are a couple of sample 3rd party apps I wanted to list as examples. 

1) For sharing, I had a use case like Android Beam in mind where 3rd party apps can push content from one device to another. (See http://developer.android.com/about/versions/android-4.0.html#AndroidBeam). 
=>This is optional. We should create another story.

2) In case of Tag reading & writing I had an app like NXP tag reader and writer in mind. (see the video here https://play.google.com/store/apps/details?id=com.nxp.nfc.tagwriter).
=> The story should cover B1, and B2 mentioned in comment 2.

Again, these are examples only. Our implementation can be different to fit the Firefox OS approach.
Summary: 

As a developer, I would like to use NFC APIs for my 3rd party apps.

Details: 

Currently (upto release v2.1) the NFC APIs are "certified APIs" i.e. available for certified apps only. We would like to make these APIs available to 3rd party developer apps, so these need to be made into "privileged APIs".
blocking-b2g: --- → backlog
feature-b2g: --- → 2.2?
Hi Yoshi,
Can you attach dependent bugs here?
This is the user story for making "Read/write NFC tag" API privileged.
feature-b2g: 2.2? → 2.2+
Flags: needinfo?(allstars.chh)
I think for this bug, what FirefoxOS needs is
"3rd party apps can use NFC feature", and not just using "NFC API".
Also in the User Story it already mentions "a use case like Android Beam", which definitely already involves Gaia part, and not just Gecko.

To use NFC feature, I'll divide it into several parts.

A. An app just wants to share data through NFC, like current Gallery, Contacts app.
* A-1, we need to have a nfc_share.js, and could be imported by Gaia apps, so app could simply include this JS library and implement some callbacks for passing data should be sent.

* A-2, we provide a MozActivity nfc-share, so when those apps could use this MozActivity to share the content.

* A-3, this is a follow-up for A-1 and A-2, we let another 3rd party app could implement the NFC-sharing UX, for example, implement/override nfc_share.js or nfc-share MozActivity.

B. An app wants to manipulate on the tag or override the Handover by itself.
* B-1: this mostly depends on Bug 1042851 and Bug 1082453.
* B-2: App could get the Tag/NDEF from MozActivity nfc-ndef-discovered, nfc-tag-discovered.
* B-3: Handling different Tag Technology. Bug 1082992.

If you plan to have A-1, A-2 and A-3 feature, we will also need input from UX and Gaia.
Otherwise please update User Story because our API doesn't involve UX feature like 'Android Beam'.
Flags: needinfo?(allstars.chh)
(In reply to Yoshi Huang[:allstars.chh] from comment #2)
> I think for this bug, what FirefoxOS needs is
> "3rd party apps can use NFC feature", and not just using "NFC API".
> Also in the User Story it already mentions "a use case like Android Beam",
> which definitely already involves Gaia part, and not just Gecko.
> 
> To use NFC feature, I'll divide it into several parts.
> 
> A. An app just wants to share data through NFC, like current Gallery,
> Contacts app.
> * A-1, we need to have a nfc_share.js, and could be imported by Gaia apps,
> so app could simply include this JS library and implement some callbacks for
> passing data should be sent.
> 
> * A-2, we provide a MozActivity nfc-share, so when those apps could use this
> MozActivity to share the content.
> 
> * A-3, this is a follow-up for A-1 and A-2, we let another 3rd party app
> could implement the NFC-sharing UX, for example, implement/override
> nfc_share.js or nfc-share MozActivity.
> 
> B. An app wants to manipulate on the tag or override the Handover by itself.
> * B-1: this mostly depends on Bug 1042851 and Bug 1082453.
> * B-2: App could get the Tag/NDEF from MozActivity nfc-ndef-discovered,
> nfc-tag-discovered.
> * B-3: Handling different Tag Technology. Bug 1082992.
> 
> If you plan to have A-1, A-2 and A-3 feature, we will also need input from
> UX and Gaia.
> Otherwise please update User Story because our API doesn't involve UX
> feature like 'Android Beam'.
If I understand correctly, for the new 2.2 scope we'll need to cover only B1, B2, B3.
Sandip, can you reconfirm and update user story accordingly? 
Looks like the modification will be to separate "1)" to an independent user story.
Flags: needinfo?(skamat)
(to elaborate based on comment 2 and comment 3)
Correction: Scope of new v2.2 covers only B1 and B2.
I left comments in user story description to avoid misleading.
Flags: needinfo?(skamat)
User Story: (updated)
Whiteboard: [ucid:NFC20, 2.2, FT:RIL]
(In reply to Yoshi Huang[:allstars.chh] from comment #2)
> B. An app wants to manipulate on the tag or override the Handover by itself.
> * B-1: this mostly depends on Bug 1042851 and Bug 1082453.
Bug 1082453 shouldn't be related to this.
No longer depends on: 1082453
Accidentally cleared the NI. 
Set again to seek confirmation from Sandip.
Flags: needinfo?(skamat)
No longer depends on: 1082992
Should Sandip, or Wesley, or Vincent to own this user story bug? Thanks.
Flags: in-moztrap?(ashiue)
I presume Vincent as EM will be the best fit.
Existing dependencies are being handled in his team.
Assignee: nobody → vchang
Target Milestone: --- → 2.2 S6 (20feb)
QA Whiteboard: [COM=NFC][2.2-feature-qa+]
The engineering bug is closed, let's close this user story.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Flags: needinfo?(skamat)
I believe most of the engineering bugs are fixed in Bug 1042851. Let's close this one after Bug 1042851 is closed.
Mark this as fixed.
Status: REOPENED → RESOLVED
Closed: 9 years ago9 years ago
Resolution: --- → FIXED
blocking-b2g: backlog → ---
@codingfree was trying this out on his own build and it wasn't working.

1. are there end-to-end automated tests for this?

2. are there any gonk changes that would require update of base build for this to work?
Flags: needinfo?(vchang)
Yoshi, Dimi, can you help to check Dietrich's comment?
Flags: needinfo?(vchang)
Flags: needinfo?(dlee)
Flags: needinfo?(allstars.chh)
(In reply to Dietrich Ayala (:dietrich) from comment #13)
> @codingfree was trying this out on his own build and it wasn't working.
> 
> 1. are there end-to-end automated tests for this?
> 
What do you mean by end-to-end?
Or you are refering sending NDEF to a NFC device and read/write NDEF to a NFC Tag, now it depends on Bug 964697.

> 2. are there any gonk changes that would require update of base build for
> this to work?

Generally you need system/bin/nfcd, with libnfc-nci.so,
and possibly some configuration files, the conf files depend on the OEM and the version of Android (KK or L)
Flags: needinfo?(dlee)
Flags: needinfo?(allstars.chh)
You need to log in before you can comment on or make changes to this bug.