am 163bd407: Merge "Added getType() to NDEF technology class (API part)." into gingerbread
* commit '163bd407492bbadcdc8f0759191e1b9142d06859':
Added getType() to NDEF technology class (API part).
diff --git a/core/java/android/nfc/technology/Ndef.java b/core/java/android/nfc/technology/Ndef.java
index 53db0c5..04f0797 100644
--- a/core/java/android/nfc/technology/Ndef.java
+++ b/core/java/android/nfc/technology/Ndef.java
@@ -54,9 +54,20 @@
/** @hide */
public static final String EXTRA_NDEF_CARDSTATE = "ndefcardstate";
+ /** @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;
+
private final int mMaxNdefSize;
private final int mCardState;
private final NdefMessage mNdefMsg;
+ private final int mNdefType;
/**
* Internal constructor, to be used by NfcAdapter
@@ -68,6 +79,7 @@
mMaxNdefSize = extras.getInt(EXTRA_NDEF_MAXLENGTH);
mCardState = extras.getInt(EXTRA_NDEF_CARDSTATE);
mNdefMsg = extras.getParcelable(EXTRA_NDEF_MSG);
+ mNdefType = extras.getInt(EXTRA_NDEF_TYPE);
} else {
throw new NullPointerException("NDEF tech extras are null.");
}
@@ -92,6 +104,13 @@
}
/**
+ * Get NDEF card type
+ */
+ public int getType() {
+ return mNdefType;
+ }
+
+ /**
* Get maximum NDEF message size in bytes
*/
public int getMaxSize() {