diff options
author | Hamster Tian <haotia@gmail.com> | 2016-06-30 13:44:54 +0800 |
---|---|---|
committer | Steve Kondik <shade@chemlab.org> | 2016-07-15 14:22:32 -0700 |
commit | 018ec89d460f8b6389b4ffe787d293090dcc0bdd (patch) | |
tree | 9dd9448bfdc314482de3a5d230c87b3687b1f76a | |
parent | f7ea48ee445af7788ed0edac2857ffde63f244d0 (diff) | |
download | android_packages_apps_Nfc-018ec89d460f8b6389b4ffe787d293090dcc0bdd.tar.gz android_packages_apps_Nfc-018ec89d460f8b6389b4ffe787d293090dcc0bdd.tar.bz2 android_packages_apps_Nfc-018ec89d460f8b6389b4ffe787d293090dcc0bdd.zip |
Nfc: read extra properties of Mifare Classic
* Fixes NFC TagInfo crash with MFC and native NFC stack.
Change-Id: Ib5042f6969d34070fbf0b54b26596b86eda1cd26
-rwxr-xr-x | nci/src/com/android/nfc/dhimpl/NativeNfcTag.java | 11 |
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 ac7d6b80..fb8b145c 100755 --- a/nci/src/com/android/nfc/dhimpl/NativeNfcTag.java +++ b/nci/src/com/android/nfc/dhimpl/NativeNfcTag.java @@ -715,6 +715,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); |