summaryrefslogtreecommitdiffstats
path: root/core/java/android/nfc/tech
diff options
context:
space:
mode:
authorMartijn Coenen <maco@google.com>2011-05-27 18:00:36 -0700
committerMartijn Coenen <maco@google.com>2011-05-31 10:30:56 -0700
commitfe6dfd504bfa31d95382d80cc7acc5b1add01b34 (patch)
treeb22b2bd104dc02fefef29f7583f3191e12c253c7 /core/java/android/nfc/tech
parente368c9a8ad1c2f31b070bb68535190d7380c2a43 (diff)
downloadframeworks_base-fe6dfd504bfa31d95382d80cc7acc5b1add01b34.zip
frameworks_base-fe6dfd504bfa31d95382d80cc7acc5b1add01b34.tar.gz
frameworks_base-fe6dfd504bfa31d95382d80cc7acc5b1add01b34.tar.bz2
Implement Mifare Ultralight-C detection (API).
Bug: 3398465 Change-Id: Ieb60deedfde5af4494a14b3e322c5a61ae75aaf9
Diffstat (limited to 'core/java/android/nfc/tech')
-rw-r--r--core/java/android/nfc/tech/MifareUltralight.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/core/java/android/nfc/tech/MifareUltralight.java b/core/java/android/nfc/tech/MifareUltralight.java
index 87c8d99..42c2e3e 100644
--- a/core/java/android/nfc/tech/MifareUltralight.java
+++ b/core/java/android/nfc/tech/MifareUltralight.java
@@ -18,6 +18,7 @@ package android.nfc.tech;
import android.nfc.Tag;
import android.nfc.TagLostException;
+import android.os.Bundle;
import android.os.RemoteException;
import java.io.IOException;
@@ -69,6 +70,9 @@ public final class MifareUltralight extends BasicTagTechnology {
private static final int NXP_MANUFACTURER_ID = 0x04;
private static final int MAX_PAGE_COUNT = 256;
+ /** @hide */
+ public static final String EXTRA_IS_UL_C = "isulc";
+
private int mType;
/**
@@ -101,10 +105,12 @@ public final class MifareUltralight extends BasicTagTechnology {
mType = TYPE_UNKNOWN;
if (a.getSak() == 0x00 && tag.getId()[0] == NXP_MANUFACTURER_ID) {
- // could be UL or UL-C
- //TODO: stack should use NXP AN1303 procedure to make a best guess
- // attempt at classifying Ultralight vs Ultralight C.
- mType = TYPE_ULTRALIGHT;
+ Bundle extras = tag.getTechExtras(TagTechnology.MIFARE_ULTRALIGHT);
+ if (extras.getBoolean(EXTRA_IS_UL_C)) {
+ mType = TYPE_ULTRALIGHT_C;
+ } else {
+ mType = TYPE_ULTRALIGHT;
+ }
}
}