summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHamster Tian <haotia@gmail.com>2016-06-30 13:44:54 +0800
committerMichael Bestas <mikeioannina@gmail.com>2016-12-30 21:05:34 +0200
commitdcb2255e7f1bd21bd7c757f56e9ffdcd81467fad (patch)
tree92e30ee4c6ea0f8377c8122eee722dc27b7e9575
parentf11e21804a9ade9d258853bcc196c448ed10ba75 (diff)
downloadandroid_packages_apps_Nfc-dcb2255e7f1bd21bd7c757f56e9ffdcd81467fad.tar.gz
android_packages_apps_Nfc-dcb2255e7f1bd21bd7c757f56e9ffdcd81467fad.tar.bz2
android_packages_apps_Nfc-dcb2255e7f1bd21bd7c757f56e9ffdcd81467fad.zip
Nfc: read extra properties of Mifare Classic
* Fixes NFC TagInfo crash with MFC and native NFC stack. Change-Id: Ib5042f6969d34070fbf0b54b26596b86eda1cd26 (cherry picked from commit 018ec89d460f8b6389b4ffe787d293090dcc0bdd)
-rwxr-xr-xnci/src/com/android/nfc/dhimpl/NativeNfcTag.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/nci/src/com/android/nfc/dhimpl/NativeNfcTag.java b/nci/src/com/android/nfc/dhimpl/NativeNfcTag.java
index 6e5ffca7..51545bba 100755
--- a/nci/src/com/android/nfc/dhimpl/NativeNfcTag.java
+++ b/nci/src/com/android/nfc/dhimpl/NativeNfcTag.java
@@ -720,6 +720,17 @@ public class NativeNfcTag implements TagEndpoint {
break;
}
+ case TagTechnology.MIFARE_CLASSIC: {
+ byte[] actBytes = mTechActBytes[i];
+ if ((actBytes != null) && (actBytes.length > 0)) {
+ extras.putShort(NfcA.EXTRA_SAK, (short) (actBytes[0] & (short) 0xFF));
+ } else {
+ // ignore this case.
+ }
+ extras.putByteArray(NfcA.EXTRA_ATQA, mTechPollBytes[i]);
+ break;
+ }
+
case TagTechnology.NFC_BARCODE: {
// hard code this for now, this is the only valid type
extras.putInt(NfcBarcode.EXTRA_BARCODE_TYPE, NfcBarcode.TYPE_KOVIO);