summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authordoug yeager <doug@simplytapp.com>2012-08-23 10:28:04 -0500
committerdoug yeager <doug@simplytapp.com>2012-08-28 10:06:28 -0500
commit36c83c8e17e8500e2d68ed5b3342fa3de916df54 (patch)
treef32de9f00f440d78f9ad878b6e153c9387e0e690 /src
parente926ef2bdf7a2e77bac3582b2e5b7413d1e080c4 (diff)
downloadpackages_apps_nfc-36c83c8e17e8500e2d68ed5b3342fa3de916df54.zip
packages_apps_nfc-36c83c8e17e8500e2d68ed5b3342fa3de916df54.tar.gz
packages_apps_nfc-36c83c8e17e8500e2d68ed5b3342fa3de916df54.tar.bz2
card emulation patch port to JB
Change-Id: I9d6ed9b15da69a346936cb4288c1cf5c7438ae87
Diffstat (limited to 'src')
-rwxr-xr-x[-rw-r--r--]src/com/android/nfc/DeviceHost.java8
-rwxr-xr-xsrc/com/android/nfc/NfcService.java33
-rwxr-xr-xsrc/com/android/nfc/nxp/NativeNfcManager.java15
3 files changed, 56 insertions, 0 deletions
diff --git a/src/com/android/nfc/DeviceHost.java b/src/com/android/nfc/DeviceHost.java
index 047e3d5..022c804 100644..100755
--- a/src/com/android/nfc/DeviceHost.java
+++ b/src/com/android/nfc/DeviceHost.java
@@ -179,6 +179,14 @@ public interface DeviceHost {
public void disableDiscovery();
+ public void enableCE_A();
+
+ public void disableCE_A();
+
+ public void enableCE_B();
+
+ public void disableCE_B();
+
public int[] doGetSecureElementList();
public void doSelectSecureElement();
diff --git a/src/com/android/nfc/NfcService.java b/src/com/android/nfc/NfcService.java
index 602b25d..06642f7 100755
--- a/src/com/android/nfc/NfcService.java
+++ b/src/com/android/nfc/NfcService.java
@@ -778,6 +778,39 @@ public class NfcService extends Application implements DeviceHostListener {
}
mNfcDispatcher.setForegroundDispatch(intent, filters, techLists);
+
+ //check for PCD A or PCD B technology
+ //turn on if in list
+ //turn off if not
+ boolean PCD_A = false;
+ boolean PCD_B = false;
+ if(techLists!=null)
+ {
+ for(short j=0;j<techLists.length;j++)
+ {
+ if(techLists[j]!=null)
+ {
+ for(short k=0;k<techLists[j].length;k++)
+ {
+ if(techLists[j][k]!=null)
+ {
+ if(techLists[j][k].equals("android.nfc.tech.IsoPcdA"))
+ PCD_A = true;
+ if(techLists[j][k].equals("android.nfc.tech.IsoPcdB"))
+ PCD_B = true;
+ }
+ }
+ }
+ }
+ }
+ if(PCD_A)
+ mDeviceHost.enableCE_A();
+ else
+ mDeviceHost.disableCE_A();
+ if(PCD_B)
+ mDeviceHost.enableCE_B();
+ else
+ mDeviceHost.disableCE_B();
}
@Override
diff --git a/src/com/android/nfc/nxp/NativeNfcManager.java b/src/com/android/nfc/nxp/NativeNfcManager.java
index 4bd8c24..832da7c 100755
--- a/src/com/android/nfc/nxp/NativeNfcManager.java
+++ b/src/com/android/nfc/nxp/NativeNfcManager.java
@@ -150,6 +150,19 @@ public class NativeNfcManager implements DeviceHost {
public native void disableDiscovery();
@Override
+ public native void enableCE_A();
+
+ @Override
+ public native void disableCE_A();
+
+ @Override
+ public native void enableCE_B();
+
+ @Override
+ public native void disableCE_B();
+
+
+ @Override
public native int[] doGetSecureElementList();
@Override
@@ -278,6 +291,8 @@ public class NativeNfcManager implements DeviceHost {
return 0; // PN544 does not support transceive of raw NfcB
case (TagTechnology.NFC_V):
return 253; // PN544 RF buffer = 255 bytes, subtract two for CRC
+ case (TagTechnology.ISO_PCD_A):
+ case (TagTechnology.ISO_PCD_B):
case (TagTechnology.ISO_DEP):
/* The maximum length of a normal IsoDep frame consists of:
* CLA, INS, P1, P2, LC, LE + 255 payload bytes = 261 bytes