diff options
author | Martijn Coenen <maco@google.com> | 2011-07-20 16:05:29 +0200 |
---|---|---|
committer | Martijn Coenen <maco@google.com> | 2011-07-20 20:00:36 +0200 |
commit | 358d8b6ad611aba11e69a3b1dd9d132dbc9a7605 (patch) | |
tree | 2d5de796184da30ca93bdff30135a61decf14f23 /src | |
parent | a39fb7629fdaafbf728cc484facac6d64d2f2170 (diff) | |
download | packages_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.java | 2 | ||||
-rwxr-xr-x | src/com/android/nfc/NfcService.java | 7 | ||||
-rwxr-xr-x | src/com/android/nfc/nxp/NativeNfcManager.java | 5 |
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) |