summaryrefslogtreecommitdiffstats
path: root/nxp
diff options
context:
space:
mode:
authorMartijn Coenen <maco@google.com>2013-09-02 20:46:44 -0700
committerMartijn Coenen <maco@google.com>2013-09-03 13:49:04 -0700
commit31f39aee25964dad1038b7a9cc335d5a386113c8 (patch)
tree818b440fa62f49f01726a0ba0aa4225f2da1ad5b /nxp
parentf5cd84c3a7ffb66196ab3c0745569da937d7533b (diff)
downloadandroid_packages_apps_Nfc-31f39aee25964dad1038b7a9cc335d5a386113c8.tar.gz
android_packages_apps_Nfc-31f39aee25964dad1038b7a9cc335d5a386113c8.tar.bz2
android_packages_apps_Nfc-31f39aee25964dad1038b7a9cc335d5a386113c8.zip
Changes for callback model of reader mode APIs.
Bug: 10360259 Change-Id: I41c47ce84aa18bce01f6fb1ebe280fac0ed79070
Diffstat (limited to 'nxp')
-rwxr-xr-xnxp/src/com/android/nfc/dhimpl/NativeNfcTag.java16
1 files changed, 7 insertions, 9 deletions
diff --git a/nxp/src/com/android/nfc/dhimpl/NativeNfcTag.java b/nxp/src/com/android/nfc/dhimpl/NativeNfcTag.java
index 992e6d25..05de6a58 100755
--- a/nxp/src/com/android/nfc/dhimpl/NativeNfcTag.java
+++ b/nxp/src/com/android/nfc/dhimpl/NativeNfcTag.java
@@ -69,13 +69,17 @@ public class NativeNfcTag implements TagEndpoint {
private PresenceCheckWatchdog mWatchdog;
class PresenceCheckWatchdog extends Thread {
- private int watchdogTimeout = 125;
+ private int watchdogTimeout;
private boolean isPresent = true;
private boolean isStopped = false;
private boolean isPaused = false;
private boolean doCheck = true;
+ public PresenceCheckWatchdog(int presenceCheckDelay) {
+ watchdogTimeout = presenceCheckDelay;
+ }
+
public synchronized void pause() {
isPaused = true;
doCheck = false;
@@ -96,12 +100,6 @@ public class NativeNfcTag implements TagEndpoint {
this.notifyAll();
}
- public synchronized void setTimeout(int timeout) {
- watchdogTimeout = timeout;
- doCheck = false; // Do it only after we have waited "timeout" ms again
- this.notifyAll();
- }
-
@Override
public synchronized void run() {
if (DBG) Log.d(TAG, "Starting background presence check");
@@ -205,12 +203,12 @@ public class NativeNfcTag implements TagEndpoint {
}
@Override
- public synchronized void startPresenceChecking() {
+ public synchronized void startPresenceChecking(int presenceCheckDelay) {
// Once we start presence checking, we allow the upper layers
// to know the tag is in the field.
mIsPresent = true;
if (mWatchdog == null) {
- mWatchdog = new PresenceCheckWatchdog();
+ mWatchdog = new PresenceCheckWatchdog(presenceCheckDelay);
mWatchdog.start();
}
}