diff options
author | Nick Pelly <npelly@google.com> | 2011-01-03 22:37:37 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-01-03 22:37:37 -0800 |
commit | 894a5bda4b143936336d422c8f87f4e5fa631f7b (patch) | |
tree | 2044bd5d757a6faf80035e203e64d7fbdfec4e7b /core/java | |
parent | 47fc50e53c141d528ee26c52ec0eaaa2140b311b (diff) | |
parent | d81c68c31e916fa201f4cd608261afa4d1f0adb6 (diff) | |
download | frameworks_base-894a5bda4b143936336d422c8f87f4e5fa631f7b.zip frameworks_base-894a5bda4b143936336d422c8f87f4e5fa631f7b.tar.gz frameworks_base-894a5bda4b143936336d422c8f87f4e5fa631f7b.tar.bz2 |
am d81c68c3: am a743448a: Merge "Tweak Ndef.getType() API. Rename constants, expand javadoc." into gingerbread
* commit 'd81c68c31e916fa201f4cd608261afa4d1f0adb6':
Tweak Ndef.getType() API. Rename constants, expand javadoc.
Diffstat (limited to 'core/java')
-rw-r--r-- | core/java/android/nfc/technology/Ndef.java | 27 |
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; |