summaryrefslogtreecommitdiffstats
path: root/core/java/android/nfc/NfcAdapter.java
Commit message (Collapse)AuthorAgeFilesLines
* Add public API to do NDEF push.Jason parks2011-05-241-1/+70
| | | | Change-Id: I102da9bbc6d78577a26fa03ee363a60abc389d6c
* Implement new NFC-EE API's as shared library (frameworks/base).Nick Pelly2011-03-101-62/+3
| | | | Change-Id: I45c4eaf59ec78167fc236fdd59676465a5e1bcb7
* New API added in NfcAdapter to enable/disable SE card emulationdaniel_tomas2011-02-161-0/+24
| | | | Change-Id: Ia0c123873ba9265b45e847d1a30c1300de3c1346
* Merge "More documentation updates for NFC." into gingerbreadJeff Hamilton2011-02-091-15/+79
|\
| * More documentation updates for NFC.Jeff Hamilton2011-02-091-13/+77
| | | | | | | | Change-Id: Ie134d4296ee12333e6647ce76126f9767ba1ba34
* | Document NFC permissions.Nick Pelly2011-02-091-2/+9
|/ | | | Change-Id: Ib1b1625058c9c673692f3fbcb3546ec7c2d54a07
* Improve the docs a bit for foreground dispatch.Jeff Hamilton2011-02-091-6/+17
| | | | Change-Id: I4179133a0956bc66a49201c20f1dd2d6d67874d2
* NFC documentation overhaul.Nick Pelly2011-02-031-25/+48
| | | | Change-Id: I45dca95a24b2d0327e080436fbcc7b1dad79de02
* Final final final Gingerbread MR API changes.Nick Pelly2011-02-011-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is it. I promise. ACTION_TECHNOLOGY_DISCOVERED -> ACTION_TECH_DISCOVERED This was missed in our technology->tech rename. Hide TagTechnology.reconnect() This is used to reset any per-connection state in a tag, by reconnecting to it. The first problem is that it belongs on Tag, not TagTechnology. The second problem is that it may become redundant once we add Tag.rediscover() which will also reconnect to the tag, and will also return a new Tag with newly created technologies enumerated. And the third and most significant problem is that you can already achieve the same result by just calling close() followed by connect(). Hide Tag.createMockTag() This API cannot be used reliably. First it requires using int[] for the technology list, but those int constants are now hidden. Second it requires knowledge of the extras parcel used to fill technology specific data - also not public. Introduce TagTechnology.isConnected() Every child class already impelmented this, and given that connect() and close() are defined on the interface, then isConnected() should be there too. Modify Ndef.getType to return a string (not int) Allows more flexibility in adding new NDEF types. Current public strings are org.nfcforum.ndef.type1 org.nfcforum.ndef.type2 org.nfcforum.ndef.type3 org.nfcforum.ndef.type4 com.nxp.ndef.mifareclassic Add NdefFormatable.formatReadOnly() This allows you to make the tag read-only at the same time as performing format and write. It is important because we currently don't have any public API to re-enumerate a tag technology list after making a tag NDEF compatible, so you can't perform the format as a seperate step without physically removing the tag from field and returning it. Modify Readonly -> ReadOnly Make Tag class final Change-Id: Icf306aeb37b936ca3007e4868e99b6baceac4aff
* Use classnames instead of ints for NFC techs.Jeff Hamilton2011-01-251-3/+9
| | | | | | | | This makes the system more flexible and allows adding new technology types without having to update the API. Change-Id: Iaee6b633965e501a70e8afc3f1d54d9d94a4d05a
* Allow null filters for foreground dispatch to act as catch all.Jeff Hamilton2011-01-231-5/+11
| | | | Change-Id: Idf3d2e344a6e87035ccb5b533ed9e81fec596132
* API changes for NFC.Jeff Hamilton2011-01-211-11/+1
| | | | | Bug: 3366009 Change-Id: Ia28e03e1501421906b640b78d4c9a59a20e9c668
* Javadoc updates for NFC.Jeff Hamilton2011-01-181-10/+14
| | | | Change-Id: Ibd91829979576297599fbcc9eb8054924af1d527
* New APIs for NDEF Push Protocol.Jeff Hamilton2011-01-171-10/+64
| | | | | | | | The NPP is only usable by the foregorund activity to prevent dispatching confusion on the far end. Change-Id: I08475a52083fd7f81b79b7fe2faf4e126121a809
* Merge "Make sure service handles are live before passing to other objects." ↵Nick Pelly2011-01-141-0/+2
|\ | | | | | | into gingerbread
| * Make sure service handles are live before passing to other objects.Nick Pelly2011-01-131-0/+2
| | | | | | | | Change-Id: Ia3fa799b56463f313da0e84a50c4dc75d584eaca
* | Add dispatching overrides for foreground apps.Jeff Hamilton2011-01-131-3/+64
|/ | | | | | | Apps can register to override the default dispatching but only when they're in the foreground. Change-Id: I8e9a9254d3f79f097fb3c8c677d806043574ba4d
* New Intent defined for RF ON/OFF eventsdaniel_tomas2011-01-121-0/+14
| | | | Change-Id: Ie1bc056bd36eb999b4678c594a3edc801a0cf6a1
* Remove attemptDeadServiceRecovery() from TagTechnology's.Nick Pelly2011-01-101-2/+27
| | | | | | | | | | | | attemptDeadServiceRecovery() is a hack to recover from NfcService dying. It should be a rare event, and is only needed in NfcAdapter which is a long-lived object. TagTechnology objects are transient, it is acceptable for them to go stale when NFC service dies. Lets not complicate the code with recovery for a rare event. Change-Id: I101350e920b075c680eb4f250683f0a2bb878553
* Change Tag.getTechnology(NfcAdapter, int) to NfcAdapter.getTechnology(Tag, int)Nick Pelly2011-01-101-0/+11
| | | | | | The later feels less clumsy. Change-Id: I50f29aef23d2993dcfd25f4c4f2cb0d77bdc0610
* Make the new NFC APIs public.Jeff Hamilton2011-01-061-3/+0
| | | | Change-Id: Ia0acd9759d67683eaf1dc199dc2cc55e16a98e77
* First pass at advanced NFC tag dispatching APIs and other cleanup.Jeff Hamilton2010-12-101-0/+26
| | | | Change-Id: I022fcd481274a2f68d93218026e77551cfae8cae
* Make getSystemService(NFC_SERVICE) the NFC entry point.Nick Pelly2010-12-101-49/+78
| | | | | | | | | | | | | This gives NFC service a handle to the application context. Deprecate NfcAdapter.getDefaultAdapter(), it does not provide a context. Using this method will print a warning, and will later throw an exception if a method that requires a context is called. No 2.3 API's will fail, but new API's that do require a context might fail. Also add helper NfcAdapter.getDefaultAdapter(Context). Change-Id: I9a6378de4ef4b61ad922f8d53e64e2a1a1d5d60c
* Secure Element access implementationDaniel Tomas2010-11-191-8/+26
| | | | Change-Id: I907e6771ecc5babe895115c3a49288fa2144a187
* Rough first pass at the NFC technology API.Jeff Hamilton2010-11-191-74/+19
| | | | Change-Id: I903ad6bc124bf9a65af788dae45f55d58704ef7b
* Revert "Merge "Remove the My Tag feature." into gingerbread"Jeff Hamilton2010-11-111-0/+42
| | | | | This reverts commit ef5694692f88bb91ed6ee1191b11a66ec594ff39, reversing changes made to 65816a32ee2c2181895e3be636f3173a6e769f67.
* Remove the My Tag feature.Jeff Hamilton2010-11-031-42/+0
| | | | Change-Id: I9167121da2fa66ddae23386d24fef7bcc64eb3f1
* Hide some NFC API's.Nick Pelly2010-10-281-19/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | We are leaving enough API so that you can see when any Tag is discovered, get its ID, and get its NDEF messages. But for advanced use - creating tag connections and writing messages - we have 2 problems. Firstly a lot of the code is untested (RawTagConnection.transceive()), or in some cases known not to work (NdefTagConnection.write()). Secondly, there is still debate about how to best expose information about Tags. The set of data/methods exposed for a Tag changes completely depending on the tag technology. There may be multiple sets of technology implemented in a single tag. Tag A may have technology X and Y, Tag B may have technology Y and Z. Furthermore, some NFC controllers will be not be able to use all technologies, and so Android Device 1 may see technology X and Y on Tag A but Android device 2 may only see technology X. So we have a pretty challenging set of constraints to work under, and we are not convinced the current Tag and NdefTag class is the best approach going forwards. The Tag application should be able to remain unbundled, since it just needs to get incoming NDEF Messages. Change-Id: Ic09f094f33794e10f8d730fffe011c9a5957e0ac Signed-off-by: Nick Pelly <npelly@google.com>
* Make best effort attempt to recover NFC service when it dies.Nick Pelly2010-10-271-18/+44
| | | | | | | Retrieve the service again from ServiceManager on RemoteException. Change-Id: Ie227b52019e7deafeab712af1addd6d957f7a8ee Signed-off-by: Nick Pelly <npelly@google.com>
* Push Tag/NdefTag implementation details into the service.Nick Pelly2010-10-221-0/+12
| | | | | | | | | | | | | | | | | | | | | | Tag/NdefTag objects should just be simple data objects. Push the mapping of internal tag type to public rawTarget/ndefTarget into Nfc Service. This gives an oppurtunity to clean up some Tag/NdefTag API methods. Most significantly, adding createMockTag() and createMockNdefTag() to help with application testing. There will probably be some more tweaking of the types/targets in Tag/NdefTag to come, this commit makes that a lot easier. Also: - Introduce getActivationBytes() and getPollBytes(). These are just stubs for NFC service to implement, we have feedback these are really important to help identify NFC tags. - Based on outside advice, remove 3B_PRIME (roll into 3B) and TOPAZ (roll into 3A). Change-Id: I3e6789c047f6ee5c298bf76c65e0885cf3c15d97 Signed-off-by: Nick Pelly <npelly@google.com>
* NFC settings cleanup.Nick Pelly2010-10-211-4/+13
| | | | | | | | | | | | | | Remove NFC settings from Settings.System. The NFC Service tracks them internally using SharedPreference. Revert back to enable()/disable()/isEnabled() - Tag discovery is the only functionality NFC service performs right now so we don't need to break it up more explicitly yet. enable/disable is the global NFC on/off and later we'll add enableDiscovery(), enableTagEmulation(), enableSecureElement() etc as needed. Change-Id: Id5b23e89d4a29511835f509962842452075e56cb Signed-off-by: Nick Pelly <npelly@google.com>
* NFC: broadcast intent constants for adapter state changeBrad Fitzpatrick2010-10-181-0/+26
| | | | | | | These are @hide for now. Sent by Iec9596a and used in Ief09a5a4 Bug: 3097279 Change-Id: Ie5dc05e33a98366fbe1767d19ac0253651abe862
* Prevent use of NFC api if device is not featurized for NFC.Nick Pelly2010-10-181-1/+31
| | | | | Change-Id: I8724cb947223b7b60814d0be51e1122123ebb98a Signed-off-by: Nick Pelly <npelly@google.com>
* Fix up NFC permissions.Nick Pelly2010-10-181-6/+7
| | | | | | | | | | | | | | | | The initial (vendor) implementation had 4 perms, replace with 1. Requires no permissions: - Viewing UID, type of discovered tags and cards. - Viewing the NDEF message contents of NDEF formatted tags and cards. Requires android.permission.NFC - Get/Set the local tag "MyTag" - Creating or using a RawTagConnection (transceive()) - Creating or using a NdefTagConnection (write()/read()) Change-Id: I1b585c7d91738bed6261277061a48cf7c939482a Signed-off-by: Nick Pelly <npelly@google.com>
* Implement methods introduced in draft #5 NFC API.Sylvain Fonteneau2010-10-171-4/+12
| | | | | | | The API is implemented but still do not support muli-protocol tags. Change-Id: I5cea3eec7b5b92e8e1106d4660e2400e4433e943 Signed-off-by: Nick Pelly <npelly@google.com>
* Revise some javadocs for NFC; add package descriptionScott Main2010-10-151-1/+1
| | | | Change-Id: I60223e2ad24af98b3b16a74960365185096ae614
* NFC: Move NFC service implementation out of system_server.Nick Pelly2010-10-151-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | NFC service is now an application service in packages/apps/Nfc. NFC service is registered through ServiceManager.addService(), and the proxy object NfcAdapter obtains a handle to it through ServiceManager.getService(). **Important** Had to add new symbols AID_NFC / NFC_UID / android.uid.nfc and modify service_manager.c, Process.java and PackageManagerService.java in order to force the com.android.nfc process to take a fixed uid, so that it can use ServiceManager.addService(). Most of the JNI has moved to packages/apps/Nfc/jni. However NdefRecord and NdefMessage require some in-process native code, so android_com_NdefMessage.cpp and android_com_NdefRecord.cpp stay in frameworks/base/core/jni. They link to a very small library libnfc_ndef.so that implements NDEF message parsing. This has been added to core.mk so all devices (even without NFC hardware) can work with NDEF data. Bug: 3041259 Bug: 3097445 Change-Id: If8f00ce8f2053acfc9319ca366d4a9c02bd396e6 Signed-off-by: Nick Pelly <npelly@google.com>
* NFC API revision round 2.Nick Pelly2010-10-121-0/+302
- Add the second half of the new NFC API: NfcAdapter, Tag, NdefTag, RawTagConnection, NdefTagConnection. - Add implementations for all of the new NFC API. Change-Id: I8da9fd1d2971ed2c8b76f2a93f207fa9e305b0f6 Signed-off-by: Nick Pelly <npelly@google.com>