summaryrefslogtreecommitdiffstats
path: root/core/java/android/nfc
Commit message (Collapse)AuthorAgeFilesLines
* Really get the new GB APIs.Jean-Baptiste Queru2011-02-016-31/+97
| | | | Change-Id: Ib2bc4d964ad925977ed58e466cc50ed3e89f5924
* API: Make close() throw an IOException.Nick Pelly2011-01-273-4/+5
| | | | | | | | | | IOException on close() can be useful to indicate that in-progress transactions were canceled. I also audited all of our tech classes to make sure every function that needs to throw IOException does so. Change-Id: Iaa9c43d79d59ff85772d5c3e4b4d57a6fa8df4cf
* Fix build - javadoc.Nick Pelly2011-01-271-1/+1
| | | | Change-Id: I0168fb4a75f4dff88e347c0dfd1f0b39e2dba0d6
* Clean up MifareUltralight API.Nick Pelly2011-01-272-30/+74
| | | | | | | | o Some javadoc updates o writeBlock -> writePages (Block means something else in NFC Forum). o validate page offset Change-Id: Icae54db3397d57aaa451caaa86d56e8ba82507f2
* Merge "Use classnames instead of ints for NFC techs." into gingerbreadJeff Hamilton2011-01-258-42/+156
|\
| * Use classnames instead of ints for NFC techs.Jeff Hamilton2011-01-258-42/+156
| | | | | | | | | | | | | | | | This makes the system more flexible and allows adding new technology types without having to update the API. Change-Id: Iaee6b633965e501a70e8afc3f1d54d9d94a4d05a
* | Make Mifare Classic increment/decrement operands little endianNick Pelly2011-01-251-2/+13
|/ | | | | | | | | | | Also make sure they are non-negative. This is not documented in Mifare Classic spec, but based on findings from NXP: - Operand should be stored in little-endian format in the transceive buffer - Tag ignores the sign bit on the operand, its effectively 31-bit unsigned - Overflow and underflow generates an error. Change-Id: Id3389b3894ded732c4b00d564ca53f5df651359e
* Handle mock tags in android.nfc.Tag conversion to Parcel.Sylvain Fonteneau2011-01-241-2/+16
| | | | | | | | | | When generating a mock tag (after a NDEF exchange over LLCP), one of the internal fields is set to null. This was causing NullPointerException when being converted to a Parcel. This is fixed by not including this field in the Parcel for mock tags. Change-Id: I000e2faa54d71fd755ba7993e1e258743aad98fb
* Merge "Add operands to mifare classic increment, decrement." into gingerbreadNick Pelly2011-01-231-12/+19
|\
| * Add operands to mifare classic increment, decrement.Nick Pelly2011-01-231-12/+19
| | | | | | | | Change-Id: Ib35f615142bda48a5e33888a09ebae2880624788
* | Merge "Make MifareClassic methods more consistent." into gingerbreadNick Pelly2011-01-231-189/+186
|\ \ | |/
| * Make MifareClassic methods more consistent.Nick Pelly2011-01-231-189/+186
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove method overloading for combinations of sector+block addressing. Instead provide methods that more closly match the raw commands, and more efficient helpers to convert between blocks and sectors. o fix off-by-one bug in getBlockCountInSector() o add BLOCK_SIZE o remove DESFIRE not operating in classic emulation (SAK 0x20) o hide isEmulated(), there is no use case, and the info is available elsewhere o getTotalBlockCount() -> getBlockCount() o getBlockCount(int) -> getBlockCountInSector(int) o introduce blockToSector() and sectorToBlock() o remove authenticateBlock() make it really clear that authentication is per sector, and reduce function explosion. blockToSector() allows you to use authenticateSector... o explicit authenticateSectorWithKeyA() / authenticateSectorWithKeyB() get rid of magic boolean o remove all (int sector, int block) parameters always address by absolute block. this makes the API crystal clear, and helps reduce function explosion o validation of all sector and block indices o dont & 0xff when converting to byte - its redundant o Remove TYPE_OTHER. Mifare Classic types are well-known and stable. Change-Id: I3c9f8254ff307f31b388b3d7592c862d5de6afa5
* | 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-2114-160/+252
| | | | | Bug: 3366009 Change-Id: Ia28e03e1501421906b640b78d4c9a59a20e9c668
* Change signature of MifareClassic.authenticate*() to throw IOException.Nick Pelly2011-01-181-2/+2
| | | | | | Update API for this and the previous commit. Change-Id: I19275a5d00081bd0f00afea59a2b673344a32954
* Support for TagLostException (API).Martijn Coenen2011-01-186-6/+160
| | | | Change-Id: Idf2c3253f7bc5f371133c4f18bfc2afde69c3010
* Fix javadoc which broke build.Nick Pelly2011-01-181-1/+1
| | | | Change-Id: Ie3cac9bec04e80defae44ba02086ad0cdfd301a9
* hange the default IsoDep timeout to 300ms (docs update).Martijn Coenen2011-01-181-1/+1
| | | | Change-Id: I4fe5a6bf9fd42a28c9619e6e0bf11885bcc43f91
* Check NDEF before calling makeReadOnly().Martijn Coenen2011-01-181-12/+17
| | | | Change-Id: Iadbaf5c29821eff78ad487b248af529febcdc4ce
* Implement IsoDep timeout handling (API).Martijn Coenen2011-01-182-0/+33
| | | | | | Added a method for setting the timeout on IsoDep transactions. Change-Id: Ie627e7a826556e46295fefe69b9be83ebf911d93
* Javadoc updates for NFC.Jeff Hamilton2011-01-1813-194/+264
| | | | Change-Id: Ibd91829979576297599fbcc9eb8054924af1d527
* New APIs for NDEF Push Protocol.Jeff Hamilton2011-01-172-10/+66
| | | | | | | | 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-132-3/+70
|/ | | | | | | 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
* Implement canMakeReadonly().Martijn Coenen2011-01-101-12/+16
| | | | | | | | The method is needed since makeReadOnly() only works on T1T/T2T. Also removed makeLowlevelReadonly(), since NFC forum does not allow setting the CC and the lock bits separately. Change-Id: I8e6d7c065b1f017ef07d878c41df05e1a8193f5a
* Remove attemptDeadServiceRecovery() from TagTechnology's.Nick Pelly2011-01-105-49/+62
| | | | | | | | | | | | 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-1011-15/+23
| | | | | | The later feels less clumsy. Change-Id: I50f29aef23d2993dcfd25f4c4f2cb0d77bdc0610
* Clean up transceive().Nick Pelly2011-01-073-77/+27
| | | | | | | | | | | | | BasicTagTechnology.transceive(byte[] raw) should work for most child classes, except those that want to disable (raw) transceive. Current plan is not to add transceiveMifare() etc - use explicit methods instead. Add package scoped BasicTagTechnology.transceive(byte[] rata, boolean raw) as a helper to remove code duplication. Change-Id: Iaea161022751c99058d291e2ed0f8c475d1c7282
* Make the new NFC APIs public.Jeff Hamilton2011-01-0612-28/+25
| | | | Change-Id: Ia0acd9759d67683eaf1dc199dc2cc55e16a98e77
* Fix technology extra naming for IsoDep and NfcB (API part).Martijn Coenen2011-01-052-10/+24
| | | | Change-Id: Iaa8f1b4dec5d626ffb17a33d71d2f92dd0d99636
* Merge "Added response flags and DSFID extras for NfcV technology (API ↵Nick Pelly2011-01-032-0/+20
|\ | | | | | | part)." into gingerbread
| * Added response flags and DSFID extras for NfcV technology (API part).Martijn Coenen2011-01-042-0/+20
| | | | | | | | | | | | Also fixed a missing assignment in NfcB technology. Change-Id: Ic564a0a17a9638c11fa528056da40f74ed37e9e6
* | Merge "Tweak Ndef.getType() API. Rename constants, expand javadoc." into ↵Nick Pelly2011-01-031-7/+20
|\ \ | |/ | | | | gingerbread
| * Tweak Ndef.getType() API. Rename constants, expand javadoc.Nick Pelly2011-01-041-7/+20
| | | | | | | | Change-Id: I9d2c83411411fea4ef46bb7c30ebdbcd9ee3e7d8
* | Merge "Added getType() to NDEF technology class (API part)." into gingerbreadNick Pelly2011-01-031-0/+19
|\ \ | |/
| * Added getType() to NDEF technology class (API part).Martijn Coenen2011-01-041-0/+19
| | | | | | | | Change-Id: Idfa391dd9d4a401e1daa3dc90ca57e4a3d9e0fa3
* | Merge "Removed selectAid() from IsoDep." into gingerbreadNick Pelly2011-01-031-15/+0
|\ \ | |/
| * Removed selectAid() from IsoDep.Martijn Coenen2011-01-041-15/+0
| | | | | | | | | | | | | | It's a convenience method that can be implemented with transceive(); not really needed for now. Change-Id: Idd855c85b15d97ae679d11d908834be3cb2741d8
* | Added transfer/restore convience cmds to MF Classic tech.Martijn Coenen2011-01-041-2/+29
|/ | | | Change-Id: I675993bc3aae6a741d63be458a0dfea240dd5316
* Remove canBeFormatted().Jeff Hamilton2010-12-222-10/+1
| | | | | | | | | It's not easy to determine if this is possible, so instead apps should attempt a format and handle errors in the format request. Change-Id: I078a208b849e71ef3fb6b5970a9111ece4a2d201
* Clean up and polish Mifare Classic tech.Martijn Coenen2010-12-171-17/+74
| | | | | | | | | | - It's useful to have accessors at block level, so apps don't really have to know about the sector structure (and how many blocks there are in a sector). - There's no way to tell whether a read/write/ didn't work because of auth failure. The documentation should be changed to make this point clear. - Added increment/decrement commands, for atomic increment/decrement of value blocks. Change-Id: I590feacbcd1443f1be7a86ab046a5b1f33e2e04c
* Need to check ndef before writing ndef.Martijn Coenen2010-12-161-11/+17
| | | | | | Regression due to all the (re)connect changes. Change-Id: I637618f63518965e893a5a59db61002271666fa4
* Implement additional Mifare Ultralight convenience methods.Martijn Coenen2010-12-151-8/+31
| | | | Change-Id: I8d9dfadb5911b2d11d1ba6dcf1381decbb8386ef
* Expose reconnect(), to allow applications to reset tag state.Martijn Coenen2010-12-152-0/+39
| | | | Change-Id: Ib5432e7f6b6aaf6ec1cb06693592cb7c6440a6f8
* Implement multi-tech connect, enfore tech exclusivity.Martijn Coenen2010-12-158-5/+87
| | | | | | | - The NfcService now allows for connecting to a specific technology; - The "active" parts of technology classes may not be used at the same time. Change-Id: Ibb569f51cc6da4f3e24df9d0850c6f49a022b0c2
* Fixed API for active NDEF reading and NDEF formatting.Martijn Coenen2010-12-132-32/+50
| | | | | | | | - Added getNdefCached() to return the message read at discovery time. - Fixed format() to check ndef before doing the write: libnfc actually requires a checkNdef to be done before writing. Change-Id: I9b3108299c05539bdef92dd74f62f911fb5a16bf
* First pass at advanced NFC tag dispatching APIs and other cleanup.Jeff Hamilton2010-12-105-25/+40
| | | | Change-Id: I022fcd481274a2f68d93218026e77551cfae8cae
* Changed technology close() to reconnect to the tag instead of physical ↵Martijn Coenen2010-12-102-1/+5
| | | | | | disconnect. Change-Id: I8935e4aae452adeec472c0b3ff3c77f1400a264e