Commit Graph

159 Commits

Author SHA1 Message Date
Joe Fernandez
2b07267753 am 201469f5: am bb7f590a: Merge "docs: Add developer guide cross-references, Project ACRE, round 4" into ics-mr1
* commit '201469f54522436be79d4d6665721049bfc74320':
  docs: Add developer guide cross-references, Project ACRE, round 4
2011-12-22 15:59:34 -08:00
Joe Fernandez
3aef8e1d1b docs: Add developer guide cross-references, Project ACRE, round 4
Change-Id: I1b43414aaec8ea217b39a0d780c80a25409d0991
2011-12-22 15:08:23 -08:00
Nick Pelly
eca6d909f7 Merge "Rewrite NDEF parsing in Java, clean-up API." 2011-12-19 15:53:10 -08:00
Nick Pelly
a356bf1cd8 Rewrite NDEF parsing in Java, clean-up API.
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
2011-12-19 15:48:35 -08:00
Martijn Coenen
23fc93a7c1 Fix NPE on mock NDEF tech operations.
Change-Id: Ib67bd03b6275fdb86a5d6dedc6c7e4fed07ef8b0
2011-12-15 10:28:52 -08:00
Nick Pelly
cee040eb27 Merge "Throw a nicer error message when using an invalid context to create Nfc" 2011-11-21 17:31:45 -08:00
Nick Pelly
b04cce0eb5 Throw a nicer error message when using an invalid context to create Nfc
This can happen when using getContext() instead of getTargetContext()
in an InstrumentationTestCase.

Bug: 5644274
Change-Id: I020a637c271e25bcf25ae2927fd878001d5fea0a
2011-11-21 17:09:31 -08:00
Nick Pelly
f955d057dd am c6a0277b: am 63b7360e: Merge "Fix NPE on devices that don\'t have NFC." into ics-mr1
* commit 'c6a0277bca29359ec1aee123495065982d2eea7a':
  Fix NPE on devices that don't have NFC.
2011-11-17 15:12:56 -08:00
Nick Pelly
a5193b24c1 Fix NPE on devices that don't have NFC.
We should return null instead of NPE.

Bug: 5622939
Change-Id: I802f4a99ea9f5e73453d5ea30da4e1d9fa279b9c
2011-11-16 16:49:01 -08:00
Nick Pelly
34059a9125 am 4780228f: am 48b651cb: Merge "Changes for access control." into ics-mr1
* commit '4780228fb2476304e29ddf9a118c460ac4eb96ee':
  Changes for access control.
2011-11-11 13:59:09 -08:00
Jeff Hamilton
bb951c8939 Changes for access control.
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
2011-11-11 08:55:26 -08:00
Martijn Coenen
0946fe5be3 Revert "Remove deprecated (hidden) enableForegroundNdefPush API's." (DO NOT MERGE).
This reverts commit 562dfff65a. 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
2011-11-10 13:22:27 -08:00
Martijn Coenen
579117036b am b288f993: am 1eca250b: Merge "Fix disableForegroundNdefPush crash." into ics-mr0
* commit 'b288f99334348a21ffb465b37a4522998b452410':
  Fix disableForegroundNdefPush crash.
2011-11-01 21:59:16 +00:00
Martijn Coenen
b288f99334 am 1eca250b: Merge "Fix disableForegroundNdefPush crash." into ics-mr0
* commit '1eca250b9dad45893fead128539f112cbc513496':
  Fix disableForegroundNdefPush crash.
2011-10-31 22:54:43 +00:00
Martijn Coenen
deb0f20c3d Fix disableForegroundNdefPush crash.
It crashed due to the fact that we're committing a fragment change
after onSaveInstanceState() is called. Instead, commit without
storing the state - as the NfcFragment is something that needs
to be setup explicitly anyway, it is not something the user
expects to be restored.

Bug: 5540962
Change-Id: I5a8cd0e47306f2bbc14b592a0182083bb79cb21a
2011-10-31 15:42:13 -07:00
Nick Pelly
cccf01d3e2 API Change: add isNdefPushEnabled() & ACTION_NFC_SETTINGS.
Modify isNdefPushEnabled() semantics slightly - true only if isNfcEnabled && NDEF push enabled.

Fix up docs.

Change-Id: Icd2df9c636ecf2d8274851bbda423f2eae7bac5f
2011-10-31 14:49:40 -07:00
Martijn Coenen
fafc43b349 am 202b38cb: Merge "Remove NfcFragment from activity when no longer sharing." into ics-mr0
* commit '202b38cb71d123e4ebc8741643e84fa455ecd002':
  Remove NfcFragment from activity when no longer sharing.
2011-10-14 13:00:45 -07:00
Martijn Coenen
2ec83936a1 Remove NfcFragment from activity when no longer sharing.
This fixes scenarios where the same activity sets, unsets
and re-sets an NdefMessage and/or callback.

Bug: 5454848
Change-Id: I5ed98047b9cfe90d2f48656d978f2d08bb4bf0cc
2011-10-14 10:01:25 -07:00
Nick Pelly
79425fd600 Merge "Remove deprecated (and hidden) enableForegroundNdefPush callback API's." 2011-10-11 12:39:46 -07:00
Scott Main
2d68a6ba3c docs: mix of BT and NFC javadoc updates
Add Health profile to various discussions about profiles
Add descriptions to NFC interfaces, tweak some desciptions, and fix some broken links

Change-Id: Ib89434c78a4ad60b4358dca9a6c335451d1c4125
2011-09-27 14:04:48 -07:00
Nick Pelly
562dfff65a Remove deprecated (and hidden) enableForegroundNdefPush callback API's.
This were just left in until youtube and maps pre-builts were updated.

Change-Id: I41d3ccb5c17f04be62c2ac854355fb6e66785176
2011-09-23 14:59:07 -07:00
Martijn Coenen
0c8d57d124 Merge "Fix Activity ref-leak in NFC dispatch API." 2011-09-02 12:50:27 -07:00
Martijn Coenen
3433a8ae5a Fix Activity ref-leak in NFC dispatch API.
Change-Id: I7b1ee6927747b12eb94cfd6ece40c2c73003f07f
2011-09-01 19:19:29 -07:00
Nick Pelly
82328bfd40 NFC API updates.
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
2011-08-30 21:16:32 -07:00
Nick Pelly
e432de8493 Merge "Improve NDEF push API" 2011-08-26 17:31:02 -07:00
Nick Pelly
c84c89a6ca Improve NDEF push API
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
2011-08-26 17:28:45 -07:00
Martijn Coenen
faca12adc6 Add getMaxTransceiveLength() API.
Also moved canMakeReadOnly() down in the stack, and
cleaned up TransceiveResult.

Change-Id: I85576c52478ab79f0726606659b0c17d00b222e6
2011-08-26 16:30:58 -07:00
Nick Pelly
8d32a01bd2 Add NFC to airplane mode
NFC now observes airplanes mode, and is by default toggleable in airplane mode.

Change-Id: I5f19d35422c9eb1cffb0b5e0631b3f3c5eeaedcf
2011-08-09 16:31:46 -07:00
Martijn Coenen
a37fcbce59 Add Android app RTD type and convenience method.
Change-Id: I4e6351c86a0062efc9a9f90e75c04f6520e50c4f
2011-08-05 09:59:45 -07:00
Jeff Hamilton
c3afd39c67 Remove the binder interface for LLCP.
Change-Id: Idc9631cdbcac1435e285c656948a37315e32515d
2011-08-02 15:30:26 -05:00
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