summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorMartijn Coenen <martijn.coenen@nxp.com>2010-11-03 10:52:39 -0600
committerNick Pelly <npelly@google.com>2010-11-03 15:32:43 -0500
commit363e40d2df0d838076a68370467c0e3b9a68d4bf (patch)
treefa96658406bc35e40753eedaa75e6141c440a6f1 /src/com
parentd4f7791f25e5b80ace2e7915871cffa69c7f4f32 (diff)
downloadpackages_apps_nfc-363e40d2df0d838076a68370467c0e3b9a68d4bf.zip
packages_apps_nfc-363e40d2df0d838076a68370467c0e3b9a68d4bf.tar.gz
packages_apps_nfc-363e40d2df0d838076a68370467c0e3b9a68d4bf.tar.bz2
Implementation of poll bytes / activation bytes API
Change-Id: I92776225eafd39e0c4dad15b46d5e0ce63f7a991 Signed-off-by: Nick Pelly <npelly@google.com>
Diffstat (limited to 'src/com')
-rwxr-xr-xsrc/com/android/nfc/NativeNfcTag.java13
-rwxr-xr-xsrc/com/android/nfc/NfcService.java9
2 files changed, 19 insertions, 3 deletions
diff --git a/src/com/android/nfc/NativeNfcTag.java b/src/com/android/nfc/NativeNfcTag.java
index ac6d7a9..43ef644 100755
--- a/src/com/android/nfc/NativeNfcTag.java
+++ b/src/com/android/nfc/NativeNfcTag.java
@@ -26,6 +26,10 @@ public class NativeNfcTag {
private String mType;
+ private byte[] mPollBytes;
+
+ private byte[] mActivationBytes;
+
private byte[] mUid;
private final String TAG = "NativeNfcTag";
@@ -137,4 +141,13 @@ public class NativeNfcTag {
public byte[] getUid() {
return mUid;
}
+
+ public byte[] getPollBytes() {
+ return mPollBytes;
+ }
+
+ public byte[] getActivationBytes() {
+ return mActivationBytes;
+ }
+
}
diff --git a/src/com/android/nfc/NfcService.java b/src/com/android/nfc/NfcService.java
index 2c1b262..1f17c36 100755
--- a/src/com/android/nfc/NfcService.java
+++ b/src/com/android/nfc/NfcService.java
@@ -2063,7 +2063,8 @@ public class NfcService extends Application {
msgNdef[0] = new NdefMessage(buff);
NdefTag tag = new NdefTag(nativeTag.getUid(),
TagTarget.internalTypeToRawTargets(nativeTag.getType()),
- null, null, nativeTag.getHandle(),
+ nativeTag.getPollBytes(), nativeTag.getActivationBytes(),
+ nativeTag.getHandle(),
TagTarget.internalTypeToNdefTargets(nativeTag.getType()),
new NdefMessage[][] {msgNdef});
Intent intent = buildNdefTagIntent(tag);
@@ -2088,7 +2089,8 @@ public class NfcService extends Application {
// Create an intent with an empty ndef message array
NdefTag tag = new NdefTag(nativeTag.getUid(),
TagTarget.internalTypeToRawTargets(nativeTag.getType()),
- null, null, nativeTag.getHandle(),
+ nativeTag.getPollBytes(), nativeTag.getActivationBytes(),
+ nativeTag.getHandle(),
TagTarget.internalTypeToNdefTargets(nativeTag.getType()),
new NdefMessage[][] { {} });
Intent intent = buildNdefTagIntent(tag);
@@ -2105,7 +2107,8 @@ public class NfcService extends Application {
Intent intent = new Intent();
Tag tag = new Tag(nativeTag.getUid(), false,
TagTarget.internalTypeToRawTargets(nativeTag.getType()),
- null, null, nativeTag.getHandle());
+ nativeTag.getPollBytes(), nativeTag.getActivationBytes(),
+ nativeTag.getHandle());
intent.setAction(NfcAdapter.ACTION_TAG_DISCOVERED);
intent.putExtra(NfcAdapter.EXTRA_TAG, tag);
intent.putExtra(NfcAdapter.EXTRA_ID, tag.getId());