diff options
Diffstat (limited to 'src/com')
-rwxr-xr-x[-rw-r--r--] | src/com/android/nfc/DeviceHost.java | 8 | ||||
-rwxr-xr-x | src/com/android/nfc/NfcService.java | 33 |
2 files changed, 41 insertions, 0 deletions
diff --git a/src/com/android/nfc/DeviceHost.java b/src/com/android/nfc/DeviceHost.java index e514bb6..bfd5d9c 100644..100755 --- a/src/com/android/nfc/DeviceHost.java +++ b/src/com/android/nfc/DeviceHost.java @@ -191,6 +191,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 d63f84f..952b391 100755 --- a/src/com/android/nfc/NfcService.java +++ b/src/com/android/nfc/NfcService.java @@ -864,6 +864,39 @@ public class NfcService 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 |