diff options
author | mike wakerly <mikey@google.com> | 2012-10-03 13:08:07 -0700 |
---|---|---|
committer | mike wakerly <mikey@google.com> | 2012-10-03 14:12:21 -0700 |
commit | 55b2c9109e15be7965dd7b4385e6a68e47167e09 (patch) | |
tree | f239c0bd1ac4342e77930a342e22fbcfb5009738 | |
parent | ef953e21ec44e2512ae2cae082d98cf8d492ef2a (diff) | |
download | packages_apps_nfc-55b2c9109e15be7965dd7b4385e6a68e47167e09.zip packages_apps_nfc-55b2c9109e15be7965dd7b4385e6a68e47167e09.tar.gz packages_apps_nfc-55b2c9109e15be7965dd7b4385e6a68e47167e09.tar.bz2 |
NfcAdapterExtras: add driver name.
Bug: 7276355
Change-Id: If2732afd542a68dc440308dae9eb76eb7ff31e25
-rwxr-xr-x | nci/src/com/android/nfc/dhimpl/NativeNfcManager.java | 7 | ||||
-rwxr-xr-x | nxp/src/com/android/nfc/dhimpl/NativeNfcManager.java | 7 | ||||
-rw-r--r-- | src/com/android/nfc/DeviceHost.java | 2 | ||||
-rwxr-xr-x | src/com/android/nfc/NfcService.java | 6 |
4 files changed, 22 insertions, 0 deletions
diff --git a/nci/src/com/android/nfc/dhimpl/NativeNfcManager.java b/nci/src/com/android/nfc/dhimpl/NativeNfcManager.java index 921e266..dde0c08 100755 --- a/nci/src/com/android/nfc/dhimpl/NativeNfcManager.java +++ b/nci/src/com/android/nfc/dhimpl/NativeNfcManager.java @@ -38,6 +38,8 @@ public class NativeNfcManager implements DeviceHost { static final int DEFAULT_LLCP_MIU = 1980; static final int DEFAULT_LLCP_RWSIZE = 2; + static final String DRIVER_NAME = "android-nci"; + static { System.loadLibrary("nfc_nci_jni"); } @@ -99,6 +101,11 @@ public class NativeNfcManager implements DeviceHost { } @Override + public String getName() { + return DRIVER_NAME; + } + + @Override public native void enableDiscovery(); @Override diff --git a/nxp/src/com/android/nfc/dhimpl/NativeNfcManager.java b/nxp/src/com/android/nfc/dhimpl/NativeNfcManager.java index 903cafa..dc6ea7c 100755 --- a/nxp/src/com/android/nfc/dhimpl/NativeNfcManager.java +++ b/nxp/src/com/android/nfc/dhimpl/NativeNfcManager.java @@ -43,6 +43,8 @@ public class NativeNfcManager implements DeviceHost { private static final String PREF_FIRMWARE_MODTIME = "firmware_modtime"; private static final long FIRMWARE_MODTIME_DEFAULT = -1; + static final String DRIVER_NAME = "nxp"; + static final int DEFAULT_LLCP_MIU = 128; static final int DEFAULT_LLCP_RWSIZE = 1; @@ -161,6 +163,11 @@ public class NativeNfcManager implements DeviceHost { } @Override + public String getName() { + return DRIVER_NAME; + } + + @Override public native void enableDiscovery(); @Override diff --git a/src/com/android/nfc/DeviceHost.java b/src/com/android/nfc/DeviceHost.java index b7336ad..487d2ad 100644 --- a/src/com/android/nfc/DeviceHost.java +++ b/src/com/android/nfc/DeviceHost.java @@ -175,6 +175,8 @@ public interface DeviceHost { public boolean deinitialize(); + public String getName(); + public void enableDiscovery(); public void disableDiscovery(); diff --git a/src/com/android/nfc/NfcService.java b/src/com/android/nfc/NfcService.java index ca1713d..55570a1 100755 --- a/src/com/android/nfc/NfcService.java +++ b/src/com/android/nfc/NfcService.java @@ -1360,6 +1360,12 @@ public class NfcService extends Application implements DeviceHostListener { public void authenticate(String pkg, byte[] token) throws RemoteException { NfcService.this.enforceNfceeAdminPerm(pkg); } + + @Override + public String getDriverName(String pkg) throws RemoteException { + NfcService.this.enforceNfceeAdminPerm(pkg); + return mDeviceHost.getName(); + } } /** resources kept while secure element is open */ |