From a772acbd898bb728e00543771c43998f9eabe58a Mon Sep 17 00:00:00 2001 From: Bryce Curtis Date: Wed, 29 Sep 2010 20:52:39 -0500 Subject: [PATCH] Update lastAccessTime when calling getAcceleration() so we don't timeout. --- framework/src/com/phonegap/AccelListener.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/framework/src/com/phonegap/AccelListener.java b/framework/src/com/phonegap/AccelListener.java index 4f4cae62..b24261d0 100755 --- a/framework/src/com/phonegap/AccelListener.java +++ b/framework/src/com/phonegap/AccelListener.java @@ -21,7 +21,7 @@ import android.webkit.WebView; * This class listens to the accelerometer sensor and stores the latest * acceleration values x,y,z. */ -public class AccelListener implements SensorEventListener, Plugin{ +public class AccelListener implements SensorEventListener, Plugin { public static int STOPPED = 0; public static int STARTING = 1; @@ -118,6 +118,7 @@ public class AccelListener implements SensorEventListener, Plugin{ return new PluginResult(PluginResult.Status.IO_EXCEPTION, AccelListener.ERROR_FAILED_TO_START); } } + this.lastAccessTime = System.currentTimeMillis(); JSONObject r = new JSONObject(); r.put("x", this.x); r.put("y", this.y);