summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartijn Coenen <maco@google.com>2011-07-20 16:05:29 +0200
committerMartijn Coenen <maco@google.com>2011-07-20 20:00:36 +0200
commit358d8b6ad611aba11e69a3b1dd9d132dbc9a7605 (patch)
tree2d5de796184da30ca93bdff30135a61decf14f23 /src
parenta39fb7629fdaafbf728cc484facac6d64d2f2170 (diff)
downloadpackages_apps_nfc-358d8b6ad611aba11e69a3b1dd9d132dbc9a7605.zip
packages_apps_nfc-358d8b6ad611aba11e69a3b1dd9d132dbc9a7605.tar.gz
packages_apps_nfc-358d8b6ad611aba11e69a3b1dd9d132dbc9a7605.tar.bz2
Support for getTimeout() (NFC service).
Bug: 4492175 Change-Id: I289e40d1527e7b570e8fd46f9968094b92a31902
Diffstat (limited to 'src')
-rw-r--r--src/com/android/nfc/DeviceHost.java2
-rwxr-xr-xsrc/com/android/nfc/NfcService.java7
-rwxr-xr-xsrc/com/android/nfc/nxp/NativeNfcManager.java5
3 files changed, 14 insertions, 0 deletions
diff --git a/src/com/android/nfc/DeviceHost.java b/src/com/android/nfc/DeviceHost.java
index 4456d98..9693446 100644
--- a/src/com/android/nfc/DeviceHost.java
+++ b/src/com/android/nfc/DeviceHost.java
@@ -151,4 +151,6 @@ public interface DeviceHost {
public void resetTimeouts();
public boolean setTimeout(int technology, int timeout);
+
+ public int getTimeout(int technology);
}
diff --git a/src/com/android/nfc/NfcService.java b/src/com/android/nfc/NfcService.java
index 31e9a60..10f4115 100755
--- a/src/com/android/nfc/NfcService.java
+++ b/src/com/android/nfc/NfcService.java
@@ -1407,6 +1407,13 @@ public class NfcService extends Application implements DeviceHostListener {
}
@Override
+ public int getTimeout(int tech) throws RemoteException {
+ mContext.enforceCallingOrSelfPermission(NFC_PERM, NFC_PERM_ERROR);
+
+ return mDeviceHost.getTimeout(tech);
+ }
+
+ @Override
public void resetTimeouts() throws RemoteException {
mContext.enforceCallingOrSelfPermission(NFC_PERM, NFC_PERM_ERROR);
diff --git a/src/com/android/nfc/nxp/NativeNfcManager.java b/src/com/android/nfc/nxp/NativeNfcManager.java
index 59a1ac1..8a59370 100755
--- a/src/com/android/nfc/nxp/NativeNfcManager.java
+++ b/src/com/android/nfc/nxp/NativeNfcManager.java
@@ -100,6 +100,11 @@ public class NativeNfcManager implements DeviceHost {
return doSetTimeout(tech, timeout);
}
+ private native int doGetTimeout(int tech);
+ @Override
+ public int getTimeout(int tech) {
+ return doGetTimeout(tech);
+ }
/**
* Notifies Ndef Message (TODO: rename into notifyTargetDiscovered)