From f003e26df96067b4b136f0859012cb7ec3ed930f Mon Sep 17 00:00:00 2001 From: Nick Pelly Date: Mon, 31 Jan 2011 23:27:37 -0800 Subject: 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 --- core/java/android/nfc/NfcAdapter.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'core/java/android/nfc/NfcAdapter.java') diff --git a/core/java/android/nfc/NfcAdapter.java b/core/java/android/nfc/NfcAdapter.java index 4808032..d30a0c6 100644 --- a/core/java/android/nfc/NfcAdapter.java +++ b/core/java/android/nfc/NfcAdapter.java @@ -44,10 +44,10 @@ public final class NfcAdapter { /** * Intent to start an activity when a tag with NDEF payload is discovered. * If the tag has and NDEF payload this intent is started before - * {@link #ACTION_TECHNOLOGY_DISCOVERED}. + * {@link #ACTION_TECH_DISCOVERED}. * * If any activities respond to this intent neither - * {@link #ACTION_TECHNOLOGY_DISCOVERED} or {@link #ACTION_TAG_DISCOVERED} will be started. + * {@link #ACTION_TECH_DISCOVERED} or {@link #ACTION_TAG_DISCOVERED} will be started. */ @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) public static final String ACTION_NDEF_DISCOVERED = "android.nfc.action.NDEF_DISCOVERED"; @@ -63,7 +63,7 @@ public final class NfcAdapter { * If any activities respond to this intent {@link #ACTION_TAG_DISCOVERED} will not be started. */ @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) - public static final String ACTION_TECHNOLOGY_DISCOVERED = "android.nfc.action.TECH_DISCOVERED"; + public static final String ACTION_TECH_DISCOVERED = "android.nfc.action.TECH_DISCOVERED"; /** * Intent to start an activity when a tag is discovered. -- cgit v1.1