Commit Graph

129 Commits

Author SHA1 Message Date
Martijn Coenen
7a1ac5c0fb Hide new interface to fix build.
Change-Id: I9d408ad5ab64399af67b37a01be973634a194ae2
2011-07-21 12:30:24 +02:00
Martijn Coenen
6d74894079 Interfaces for enabling/disabling zero-click.
Change-Id: If7a90e67ca0f05cb18bea2861001e9cb6a14f4d6
2011-07-21 09:57:28 +02:00
Martijn Coenen
63fc01d044 Merge "Support for getTimeout() (API)." 2011-07-21 00:32:11 -07:00
Jeff Hamilton
a77258b98e Remove the hidden My Tag APIs.
Bug: 5048185
Change-Id: Iaf8a77e301fd378738db632e23674facd2c8fccc
2011-07-20 23:15:51 -05:00
Martijn Coenen
20e62c9f14 Support for getTimeout() (API).
Bug: 4492175
Change-Id: Ibc9a1b78d8c0992f47664d33760e0ce8dca67c64
2011-07-20 16:06:34 +02:00
Ben Dodson
67671874dc unhide public apis
Change-Id: I3bbe0e7c1e135a4654f63c34c024d7aa10341279
2011-07-13 17:38:33 -07:00
Jeff Hamilton
8856c4278d Improve Tag.toString().
Change-Id: Iea254201d04dc45bc94c237aa4a57da096c5f134
2011-06-30 17:35:05 -05:00
Jeff Hamilton
1584af9d4e Add a string based createUri().
Change-Id: Ie26977684d0f48201daa605b8b6057ab9afb370e
2011-06-30 14:51:07 -05:00
Nick Pelly
b8a8c7a279 resolved conflicts for merge of 6ce70394 to master
Change-Id: I7a4a08409c0133a1738b03b476f2b388c7aec5bf
2011-06-22 20:32:36 -07:00
Nick Pelly
6ce7039482 am 6f1a8edc: am 17523abb: NFC Adapter Extras API update.
* commit '6f1a8edcc00db40a8ad300e15a23f7f1de298c3b':
  NFC Adapter Extras API update.
2011-06-20 15:58:40 -07:00
Ben Dodson
3da3a4582c Parser for uri records
Change-Id: I4b71ba7938aa83a1c6344e3da72a9495bc1e9a16
2011-06-17 15:37:32 -07:00
Nick Pelly
17523abb45 NFC Adapter Extras API update.
Remove
o registerTearDownApdus()
o deregisterTearDownApdus()
They were already NO-OPS, and don't work in the general case.

Add
o authenticate(byte[] token)
This future proofs us for a more flexible access control scheme.

Change-Id: I4cb67ceeb63d61cbc333c9b244a96d8687402168
2011-06-17 14:51:40 -07:00
Martijn Coenen
112fdf612d Support for setting the NfcA transceive timeout (API).
Change-Id: I2c40fbc7e9101462afae18125feba30cf76ea5f2
2011-06-13 18:22:57 +02:00
Nick Pelly
195c39cbce NFC: Submit the missing pieces of previous commit to fix build.
(remove stale code)

Change-Id: I0d08650b6d694ac4493cf0074696d4e1be7d9f87
2011-06-10 15:22:28 -07:00
Martijn Coenen
2dcae567ab Added support for rediscovering a Tag (API).
Bug: 3378764
Change-Id: I4697b814337270c4458ca2b8ce358de315904777
2011-06-08 23:26:42 +02:00
Nick Pelly
9eb5847777 Merge "Move NDEF URI helper method into android.nfc.NfcRecord" 2011-06-08 13:44:28 -07:00
Nick Pelly
e0180d053e Move NDEF URI helper method into android.nfc.NfcRecord
Change-Id: Ia044e45cbe2cd06c4844d15a57f1c1f392cf65cd
2011-06-08 11:26:11 -07:00
Martijn Coenen
a924973f22 Implement Felica timeout handling (API).
Allows controlling the timeout for transceive on Felica.

Change-Id: I5c62b3ea0e8a16bc006feac6ec759cdb730bc938
2011-06-08 20:00:02 +02:00
Martijn Coenen
ea51a4275a Connecting to a NFC technology may fail.
NotSupportedOperationException will be thrown in these cases,
unchecked for now.

Bug: 4195403
Change-Id: I48f4f277d43afba8bc505ae2a6c216cc387b1e97
2011-06-06 12:43:05 +02:00
Jeff Hamilton
e00ef00873 am 7c324a3f: am 5e654d02: am 14019abb: Merge "Swap Mifare for MIFARE." into honeycomb-mr2
* commit '7c324a3f7dde4be26b7a996b485a92ba25de3251':
  Swap Mifare for MIFARE.
2011-05-31 16:00:46 -07:00
Martijn Coenen
fe6dfd504b Implement Mifare Ultralight-C detection (API).
Bug: 3398465
Change-Id: Ieb60deedfde5af4494a14b3e322c5a61ae75aaf9
2011-05-31 10:30:56 -07:00
Martijn Coenen
8bede17047 Fix NdefRecord flags handling.
NdefMessages created from byte arrays set the wrong flags on
NdefRecord: every record had at least FLAG_MB|FLAG_ME set, instead of actually
setting the flags from the byte-stream itself. Fixed by creating an internal
constructor which can take the flags.

Public constructor remains the same, as we don't want to bother application
writers with these flags - they can be inferred from the context in which the
record is used. Getting the flags is not a public operation on an NdefRecord
either. However, applications can get the byte[] representation and it
is reasonable for them to expect the flags byte to be set correctly.

Change-Id: Ic32411688dd092c55b1aeccbba9635792e15a671
2011-05-27 08:18:18 -07:00
Jeff Hamilton
7c324a3f7d am 5e654d02: am 14019abb: Merge "Swap Mifare for MIFARE." into honeycomb-mr2
* commit '5e654d02457e0f90f8cdaf07843af1be7328ed7f':
  Swap Mifare for MIFARE.
2011-05-25 16:32:12 -07:00
Jeff Hamilton
5e654d0245 am 14019abb: Merge "Swap Mifare for MIFARE." into honeycomb-mr2
* commit '14019abb40785064ebef5d14e82586a910d33181':
  Swap Mifare for MIFARE.
2011-05-25 15:41:51 -07:00
Jeff Hamilton
734e9b0c73 Swap Mifare for MIFARE.
Change-Id: I45580d32f5ccebf906372c3c1664bc66718a672e
2011-05-25 17:37:51 -05:00
Jason parks
01425365a8 Add public API to do NDEF push.
Change-Id: I102da9bbc6d78577a26fa03ee363a60abc389d6c
2011-05-24 15:22:07 -05:00
Jason parks
ab8f48c2ee Implement teardown script.
Change-Id: I1a3feda3b1007b08fcaa24c3f8dd21abf1efd885
2011-04-01 14:41:18 -05:00
Nick Pelly
367f41f8f6 Implement new NFC-EE API's as shared library (frameworks/base).
Change-Id: I45c4eaf59ec78167fc236fdd59676465a5e1bcb7
2011-03-10 16:03:46 -08:00
Jeff Hamilton
5644d0e18a Support for NDEF on iCODE.
Change-Id: I9ce2ee5e739d34a9047ca494315cbc54b30fefb8
2011-02-24 22:03:20 -06:00
daniel_tomas
7bcd2c62eb New API added in NfcAdapter to enable/disable SE card emulation
Change-Id: Ia0c123873ba9265b45e847d1a30c1300de3c1346
2011-02-16 09:27:25 -08:00
Robert Ly
2deeefeb5e Adding package summary for nfc.tech package
Change-Id: Ibbf55c21dcaf48b4eb369e78c54fb1023abb3cb3
2011-02-15 17:41:47 -08:00
Jeff Hamilton
58c9d4726e Merge "More documentation updates for NFC." into gingerbread 2011-02-09 00:34:22 -08:00
Jeff Hamilton
28319c0cec More documentation updates for NFC.
Change-Id: Ie134d4296ee12333e6647ce76126f9767ba1ba34
2011-02-09 17:26:47 +09:00
Nick Pelly
39cf3a445e Document NFC permissions.
Change-Id: Ib1b1625058c9c673692f3fbcb3546ec7c2d54a07
2011-02-09 16:10:46 +09:00
Jeff Hamilton
167d9e473f Improve the docs a bit for foreground dispatch.
Change-Id: I4179133a0956bc66a49201c20f1dd2d6d67874d2
2011-02-09 12:30:18 +09:00
Nick Pelly
46797ac098 Fix docs type that broke build.
Change-Id: I5b5a2fc5baf95ace74bf90ff2c750ba890054d64
2011-02-03 16:23:58 -08:00
Nick Pelly
74fe6c6b24 NFC documentation overhaul.
Change-Id: I45dca95a24b2d0327e080436fbcc7b1dad79de02
2011-02-03 15:11:09 -08:00
Nick Pelly
f003e26df9 Final final final Gingerbread MR API changes.
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
2011-02-01 09:20:45 -08:00
Nick Pelly
3fcedf7728 API: Make close() throw an IOException.
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
2011-01-27 16:17:14 -08:00
Nick Pelly
21d0a173f1 Fix build - javadoc.
Change-Id: I0168fb4a75f4dff88e347c0dfd1f0b39e2dba0d6
2011-01-27 14:07:50 -08:00
Nick Pelly
4a5e253220 Clean up MifareUltralight API.
o Some javadoc updates
o writeBlock -> writePages  (Block means something else in NFC Forum).
o validate page offset

Change-Id: Icae54db3397d57aaa451caaa86d56e8ba82507f2
2011-01-27 12:22:56 -08:00
Jeff Hamilton
f126ad3b64 Merge "Use classnames instead of ints for NFC techs." into gingerbread 2011-01-25 14:35:46 -08:00
Jeff Hamilton
d88e9aa575 Use classnames instead of ints for NFC techs.
This makes the system more flexible and allows
adding new technology types without having to
update the API.

Change-Id: Iaee6b633965e501a70e8afc3f1d54d9d94a4d05a
2011-01-25 16:32:26 -06:00
Nick Pelly
b134223f91 Make Mifare Classic increment/decrement operands little endian
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
2011-01-25 07:45:07 -08:00
Sylvain Fonteneau
c5a418ecb7 Handle mock tags in android.nfc.Tag conversion to Parcel.
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
2011-01-24 12:15:13 -06:00
Nick Pelly
c896d85c15 Merge "Add operands to mifare classic increment, decrement." into gingerbread 2011-01-23 22:12:25 -08:00
Nick Pelly
1e233af3a7 Add operands to mifare classic increment, decrement.
Change-Id: Ib35f615142bda48a5e33888a09ebae2880624788
2011-01-23 22:11:44 -08:00
Nick Pelly
da01b4abb8 Merge "Make MifareClassic methods more consistent." into gingerbread 2011-01-23 21:36:14 -08:00
Nick Pelly
e45083b11b Make MifareClassic methods more consistent.
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
2011-01-23 21:32:57 -08:00
Jeff Hamilton
9f20cd7ff2 Allow null filters for foreground dispatch to act as catch all.
Change-Id: Idf3d2e344a6e87035ccb5b533ed9e81fec596132
2011-01-23 12:15:28 -06:00