summaryrefslogtreecommitdiffstats
path: root/core/java/android/nfc/NfcAdapter.java
Commit message (Collapse)AuthorAgeFilesLines
* Add hidden API to disable NFC (optional persist).Martijn Coenen2014-09-251-0/+14
| | | | | Bug: 17298769 Change-Id: I1fa59592a34f1207731dc75d2e548b3e614d94f5
* Add hidden API for pausing and resuming NFC polling.Andres Morales2014-09-111-0/+27
| | | | | Bug:17401266 Change-Id: Icce34787fc89dc33445f6c36f40f669a8b9b2f92
* Remove old NFC unlock apiAndres Morales2014-08-191-30/+0
| | | | | Bug: 16401635 Change-Id: I667d91c2346355ed0a2115644e6192f5f208e288
* Fix issue where unlock handlers are not properly updatedAndres Morales2014-08-151-15/+24
| | | | | | | | If an unlock handler already exists, we need to try to update the tech mask for it. Don't permit unlock handlers with no tech mask. Bug: 17054331 Change-Id: I54a885d28bdd8ce41d8646d968621c7d6abc9387
* NFC Unlock api changesAndres Morales2014-07-311-2/+87
| | | | | Bug: 16401635 Change-Id: I994bd80be40052c2f894199bb44ebbde40077f27
* Revert "NFC Unlock api changes"Andres Morales2014-07-301-87/+2
| | | | | | This reverts commit 9fef5fbcd6d47ef86823b3a2d82d34801f9be335. Change-Id: Idabe1c2901e0e26d38f84583308f69804ab2c1c3
* NFC Unlock api changesAndres Morales2014-07-301-2/+87
| | | | | Bug: 16401635 Change-Id: I138a9aa0bb156982b6c7656c51a1e2194776e4ed
* Make some NFC APIs @systemAPI.Martijn Coenen2014-07-301-1/+7
| | | | Change-Id: I12e292563a517211e4fae7a1f64021758f396d1a
* Add new IPC for direct Beam invoke.Martijn Coenen2014-07-011-0/+16
| | | | | | | | | Used by BeamShareActivity when Beam is invoked through the share menu. Also made these IPCs one-way as they can run asynchronously. Bug: 15939863 Change-Id: I7d048947c96c697e6b04bbda2ec3fbf28cccc29b
* Make unlock api take String instead of int codesAndres Morales2014-06-201-2/+5
| | | | | | int code method not exposed to third parties Change-Id: I18ad0703be9d06664db3fd00a6435f789979fe73
* Framework changes to support NFC trustlet.Andres Morales2014-06-201-0/+27
| | | | | | | Adds a system-only ability to register for receiving tags from NfcService at the lockscreen. Change-Id: I4b50941031e8d1f40ebb6314211226e70a2ad187
* Revert "Adding INfcUnlockSettings and NfcUnlock interface class."Andres Morales2014-05-201-24/+0
| | | | | | | | This will be re-added as a Trustlet in a subsequent CL. This reverts commit 38a7ed05f8fed0aa81f7214d827875f9876ffbe1. Change-Id: I5aa36df42a7751f165b4ef184e0cda57e5568b59
* Fix NFC docs breakage.Martijn Coenen2014-02-251-2/+2
| | | | Change-Id: I680dc7974316c77cb1835b5a81f30e6961ba3c49
* Add an API to manually invoke Android Beam.Martijn Coenen2014-02-141-0/+39
| | | | | | | | | | | | Activities can call NfcAdapter.invokeBeam() to manually invoke the Beam animation. Any NFC tap is then enough to complete the transaction. Also, added NdefRecord convenience method for creating Text records. Bug: 5134061 Change-Id: Ia9df360d1d7e8451157c85a6d12f2a4eec924960
* Adding INfcUnlockSettings and NfcUnlock interface class.Andres Morales2013-12-091-0/+24
| | | | Change-Id: Ie55a5d4bb58c2944952fc84cce32d3573a3a1a22
* additional javadoc for NfcAdapter.ReaderCallbackScott Main2013-10-171-2/+8
| | | | Change-Id: I3cad8b43d53992bb3d53920abb510456ee72afb5
* Rename FLAG_READER_NFC_KOVIO to FLAG_READER_NFC_BARCODE.Martijn Coenen2013-09-121-2/+2
| | | | | Bug: 10722206 Change-Id: I8b672cd7b9015e1ec88af96ef1fd0774d20b8d17
* Reader mode NFC API: move to callback model.Martijn Coenen2013-09-021-12/+37
| | | | | | | | | | | | | | | | | | Using intents for reader mode doesn't work well for 2 reasons: 1) Intents are used to resolve, but in reader mode we already know where to resolve to. Additionally, dispatching an intent causes additional latency. 2) Using intents with foreground dispatch was tricky; for every call to onNewIntent() with a new tag, there was a call to onPause(), which effectively disabled reader mode again, causing a discovery loop. Instead, let the app register a callback, and call that when we discover a new tag. Also, add new flag to disable platform sounds, and to change the presence check delay. Bug: 10360259 Change-Id: I8373543d6cf2f7ca73c9b3e42bb8b51e3ac48cac
* Add NFC reader-mode API.Martijn Coenen2013-08-271-0/+82
| | | | | | | | | Allows applications to temporarily force the NFC controller to only do tag discovery. This will allow Android applications to read and interact with devices that employ HCE. Bug: 10360259 Change-Id: I709ead9a26f8e6ae8582cc295d82bd896e7c5bba
* NFC: Host-based card emulation APIs.Martijn Coenen2013-08-021-0/+24
| | | | | | | | | | | | - New INfcCardEmulation interface to allow apps to interface with card emulation system. - New BIND_NFC_SERVICE permission to prevent malicious apps from binding to card emulation services. - ApduServiceInfo is now in the framework. - Added constants to Settings.Secure for storing defaults. - Modified XML grammar a bit. Change-Id: I56b3fa6b42eb5dc132c91c1386ab1e6bac779059
* Add direct NDEF push API.Martijn Coenen2013-03-261-7/+31
| | | | | | | | | | Hidden for now. Also, modified callback that is called from NfcService to pass all data in a single object (BeamShareData). This avoids having to do multiple IPCs at touch time. Bug: 5134061 Change-Id: I235f608cef9935041b33b4b7a6980f109c15576c
* Make NfcAdapter states public and fix build.Martijn Coenen2013-01-091-4/+0
| | | | Change-Id: Idb2dd5e524cda5e3c03d4f2689266fa03be4ea13
* Make NfcAdapter STATE_CHANGED intent action public.Martijn Coenen2013-01-091-4/+2
| | | | | Bug: 5141885 Change-Id: Ia357409a51fb45f1739bb37940fa746f94fa9056
* docs: clean up javadoc code snippets, unescaped entitiesScott Main2012-06-251-42/+31
| | | | Change-Id: Idc21caceccaaa2cc11a6c46b453b6a9b26164f34
* Small NFC API docs addition.Martijn Coenen2012-06-061-0/+6
| | | | | | | | Indicate that if the device does not support Bluetooth or WiFI, calling the API is a no-op. Bug: 6620788 Change-Id: Ib261e0e7855d0914e97803b3b808015b72f3a186
* NFC API documentation.Martijn Coenen2012-05-161-5/+132
| | | | | | Added docs for beam Uri push and added some sanity checks on params. Change-Id: I7c43b71c8a9ca4f742933d2d5b9473e0e2451dd3
* Added NFC disable during phone shutdownSunil Jogi2012-04-201-1/+2
| | | | | | | | NFC was not disabled/deinitialized when phone shutdown. This patch add NFC disable on phone shutdown which can complete any pending NFC transaction before phone shutdown. Change-Id: Id1e604be7c34adec8623a1e526d8ff99e18bf74b
* Unhide new Beam push APIs.Martijn Coenen2012-04-121-5/+38
| | | | | | Also added support for multiple Uris, removed mimeType argument. Change-Id: Iad2c4d0e36a174080d7bc9c9c8ab893f90231d02
* First cut at Bluetooth BeamNick Pelly2012-04-041-0/+13
| | | | Change-Id: I37e5759515ff8779095b6d8adf5ad9c456fa8529
* Document "disable default Beam" meta-data entry.Martijn Coenen2012-04-041-2/+24
| | | | Change-Id: Icaa767ee37fcca08b1ff5143eb94cf8e66be840c
* Use Application#registerLifecycleEvents() instead of a Fragment for Beam.Nick Pelly2012-03-291-56/+185
| | | | | | | | | | | | | | | | | | | | Fragments don't work as desired if called after life-cycle events such as onDestory() or onSaveInstanceState(). The new approach doesn't work after onDestroy() either, but we can more easily detect this now. For pre-JB apps, we will log an error, and for JB and onwards we will throw. Update documentation to make these rules clear, and to encourage the use of a single Activity per API call, and to make the call in onCreate(). Bug: 5199662 Bug: 5994691 Bug: 6034901 Bug: 6125297 Change-Id: Ib0dde6abfa44cd56c7ddc13ba0ad0e83bbe30058
* Hidden API for setting p2p NFC modes.Martijn Coenen2012-03-011-0/+11
| | | | Change-Id: I406bab36b441cf99b5b45f51701dbcbab588a9b0
* Add NdefMessage.getByteLength(), and more minor fixes:Nick Pelly2012-01-261-2/+2
| | | | | | | | Remove NdefMessage from dispatch(). It's already in the Tag. /*package*/ cleanup Fix sitemap after removal of NFCDemo Change-Id: Ie1f6d9ea98144aa97f56bb709a33f5d0ef916e8b
* Improve NDEF API'sNick Pelly2012-01-251-5/+31
| | | | | | | | | | | | | | | | | | o Add NdefRecord.toMimeType() Maps the record to a MIME type o Add NdefRecord.toUri() Maps the record to a URI o Add hidden NfcAdapter.dispatch() Helps test the dispatch path. o Modify createMime(), createUri() and createExternal(): Do not try and strictly follow RFC requirements for URI or MIME content types. This just leads to heartbreak - the RFC requirements are too strict. For example RFC1341 forbids the use of '.' in a MIME type, however this is in common use in types such as "application/vnd.companyname". I think the best approach is to only remove 'obvious' whitespace issues, and to convert uppercase to lowercase as per Android guidelines. Change-Id: Id686f5f3b05b2dceafad48e1cfcbdb2b3890b854
* am 201469f5: am bb7f590a: Merge "docs: Add developer guide cross-references, ↵Joe Fernandez2011-12-221-0/+6
|\ | | | | | | | | | | | | Project ACRE, round 4" into ics-mr1 * commit '201469f54522436be79d4d6665721049bfc74320': docs: Add developer guide cross-references, Project ACRE, round 4
| * docs: Add developer guide cross-references, Project ACRE, round 4Joe Fernandez2011-12-221-0/+6
| | | | | | | | Change-Id: I1b43414aaec8ea217b39a0d780c80a25409d0991
* | Rewrite NDEF parsing in Java, clean-up API.Nick Pelly2011-12-191-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Lots of documentation fixes. o Add NdefMessage(NdefRecord ... records) ctor o Add NdefRecord.createMime() o Add NdefRecord.createExternal() o Add toString(), equals() and hashCode() implementations o Deprecate NdefRecord(byte[]) and NdefRecord.toByteArray() o Remove framework dependency on libnfc_ndef.so o Remove NfcAdapter.getDefaultAdapter(), its been deprecated a while next step: o Attempt to move NdefMessage -> Intent conversion into NDEF, and make it CTS tested. This will ensure consistent NDEF -> Intent mapping across all Android devices. Change-Id: Ifed4910caa9a1d6bad32dbf0a507ab22bca35e22
* | Merge "Throw a nicer error message when using an invalid context to create Nfc"Nick Pelly2011-11-211-2/+5
|\ \
| * | Throw a nicer error message when using an invalid context to create NfcNick Pelly2011-11-211-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | This can happen when using getContext() instead of getTargetContext() in an InstrumentationTestCase. Bug: 5644274 Change-Id: I020a637c271e25bcf25ae2927fd878001d5fea0a
* | | am c6a0277b: am 63b7360e: Merge "Fix NPE on devices that don\'t have NFC." ↵Nick Pelly2011-11-171-0/+4
|\ \ \ | |/ / |/| / | |/ | | | | | | into ics-mr1 * commit 'c6a0277bca29359ec1aee123495065982d2eea7a': Fix NPE on devices that don't have NFC.
| * Fix NPE on devices that don't have NFC.Nick Pelly2011-11-161-0/+4
| | | | | | | | | | | | | | We should return null instead of NPE. Bug: 5622939 Change-Id: I802f4a99ea9f5e73453d5ea30da4e1d9fa279b9c
* | am 4780228f: am 48b651cb: Merge "Changes for access control." into ics-mr1Nick Pelly2011-11-111-24/+54
|\ \ | |/ | | | | | | * commit '4780228fb2476304e29ddf9a118c460ac4eb96ee': Changes for access control.
| * Changes for access control.Jeff Hamilton2011-11-111-24/+54
| | | | | | | | | | | | | | | | | | | | The package name is now required when using the NFC extras APIs so the context is stored away and used to derive the package name to be sent to the NfcService. Bug: 4515759 Change-Id: I1a3aba3fc026e0090a914b0686fc4b8dec25b927
| * Revert "Remove deprecated (hidden) enableForegroundNdefPush API's." (DO NOT ↵Martijn Coenen2011-11-101-0/+55
| | | | | | | | | | | | | | | | | | | | | | | | MERGE). This reverts commit 562dfff65ac79590c0b7c50019cd3d107e8b4e0e. These API's are still used by GMM in the version that ships with MR1, so we need them to keep Beam working for GMM. Note that these APIs are hidden. From version 5.13 onwards GMM will use the new API's. Change-Id: I316a9c9b7d0052a14f6c1df70f2ed463bca61800
* | API Change: add isNdefPushEnabled() & ACTION_NFC_SETTINGS.Nick Pelly2011-10-311-11/+25
|/ | | | | | | | Modify isNdefPushEnabled() semantics slightly - true only if isNfcEnabled && NDEF push enabled. Fix up docs. Change-Id: Icd2df9c636ecf2d8274851bbda423f2eae7bac5f
* Merge "Remove deprecated (and hidden) enableForegroundNdefPush callback API's."Nick Pelly2011-10-111-55/+0
|\
| * Remove deprecated (and hidden) enableForegroundNdefPush callback API's.Nick Pelly2011-09-231-55/+0
| | | | | | | | | | | | This were just left in until youtube and maps pre-builts were updated. Change-Id: I41d3ccb5c17f04be62c2ac854355fb6e66785176
* | docs: mix of BT and NFC javadoc updatesScott Main2011-09-271-9/+23
|/ | | | | | | Add Health profile to various discussions about profiles Add descriptions to NFC interfaces, tweak some desciptions, and fix some broken links Change-Id: Ib89434c78a4ad60b4358dca9a6c335451d1c4125
* NFC API updates.Nick Pelly2011-08-301-12/+34
| | | | | | | o NfcAdapter.set*(): enforce at least one activity is provided at compile time. o Unhide and update javadoc for some API's scheduled for ICS release. Change-Id: I2bf4ea101442dcdeb359be26d3869f82e6e3748b
* Improve NDEF push APINick Pelly2011-08-261-195/+254
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce setNdefPushMessage() setNdefPushMessageCallback() setNdefPushCompleteCallback() Deprecate public API enableForegroundNdefPush() disableForegroundNdefPush() Hide & Deprecate staged (public but never released) API enableForegroundNdefPushCallback() The new API's do not require the application to explicitly call enable()/disable() in onPause()/onResume(), we use a Fragment behind the scenes to manager this automatically. NDEF Push can be disabled by using a null parameter, so each enable()/disable() pair is collapsed to a single set() call. Application code should now look something like: public void onCreate() { NfcAdapter adapter = NfcAdapter.getDefaultAdapter(this); if (adapter != null) { // check that NFC is available on this device adapter.setNdefPushMessage(myNdefMessage, this); } } And that's it - no need to explicitly hook into onPause() and onResume() events. Also - introduce a generic NfcEvent class that is provided as a parameter on all NFC callbacks. Right now it just provides the NfcAdapter, but using the wrapper classes allows us to add more fields later without changing the callback signature. (i'm thinking Bluetooth). Change-Id: I371dcb026b535b8199225c1262eca64ce644458a