summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorNick Pelly <npelly@google.com>2011-01-04 17:29:14 +1100
committerNick Pelly <npelly@google.com>2011-01-04 17:31:48 +1100
commitddbb2c997b8462d7242b50ea1689a53122d4fce4 (patch)
treedbed36ca61f9c24c4c138c0db3b235e7420864ff /core
parentd27ebf1e698c4e6929cb635768031a2e25b18acd (diff)
downloadframeworks_base-ddbb2c997b8462d7242b50ea1689a53122d4fce4.zip
frameworks_base-ddbb2c997b8462d7242b50ea1689a53122d4fce4.tar.gz
frameworks_base-ddbb2c997b8462d7242b50ea1689a53122d4fce4.tar.bz2
Tweak Ndef.getType() API. Rename constants, expand javadoc.
Change-Id: I9d2c83411411fea4ef46bb7c30ebdbcd9ee3e7d8
Diffstat (limited to 'core')
-rw-r--r--core/java/android/nfc/technology/Ndef.java27
1 files changed, 20 insertions, 7 deletions
diff --git a/core/java/android/nfc/technology/Ndef.java b/core/java/android/nfc/technology/Ndef.java
index 04f0797..05872fe 100644
--- a/core/java/android/nfc/technology/Ndef.java
+++ b/core/java/android/nfc/technology/Ndef.java
@@ -57,12 +57,14 @@ public final class Ndef extends BasicTagTechnology {
/** @hide */
public static final String EXTRA_NDEF_TYPE = "ndeftype";
- public static final int UNKNOWN_TAG = 0;
- public static final int TYPE1_TAG = 1;
- public static final int TYPE2_TAG = 2;
- public static final int TYPE3_TAG = 3;
- public static final int TYPE4_TAG = 4;
- public static final int MIFARE_CLASSIC_TAG = 5;
+ //TODO: consider removing OTHER entirely - and not allowing Ndef to
+ // enumerate for tag types outside of (NFC Forum 1-4, MifareClassic)
+ public static final int OTHER = -1;
+ public static final int NFC_FORUM_TYPE_1 = 1;
+ public static final int NFC_FORUM_TYPE_2 = 2;
+ public static final int NFC_FORUM_TYPE_3 = 3;
+ public static final int NFC_FORUM_TYPE_4 = 4;
+ public static final int MIFARE_CLASSIC = 105;
private final int mMaxNdefSize;
private final int mCardState;
@@ -104,7 +106,18 @@ public final class Ndef extends BasicTagTechnology {
}
/**
- * Get NDEF card type
+ * Get NDEF tag type.
+ * <p>Returns one of {@link #NFC_FORUM_TYPE_1}, {@link #NFC_FORUM_TYPE_2},
+ * {@link #NFC_FORUM_TYPE_3}, {@link #NFC_FORUM_TYPE_4},
+ * {@link #MIFARE_CLASSIC} or {@link #OTHER}.
+ * <p>Platforms of this API revision will always return one of the above
+ * values. Platforms at future API revisions may return other values, which
+ * can be treated as {@link #OTHER} by applications targeting this API.
+ * <p>Android devices with NFC support must always correctly enumerate
+ * NFC Forum tag types, and may optionally enumerate
+ * {@link #MIFARE_CLASSIC} since it requires proprietary technology.
+ * Devices that cannot enumerate {@link #MIFARE_CLASSIC} will use
+ * {@link #OTHER} instead.
*/
public int getType() {
return mNdefType;