You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by fi...@apache.org on 2012/05/19 00:20:39 UTC
[1/8] android commit: Small spacing fixes
Updated Branches:
refs/heads/master 0850229c9 -> 6b24f2d54
Small spacing fixes
Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/commit/6b24f2d5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/tree/6b24f2d5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/diff/6b24f2d5
Branch: refs/heads/master
Commit: 6b24f2d547695db060a860abe0cd1780abdbef5b
Parents: 2d5dcf2
Author: Fil Maj <ma...@gmail.com>
Authored: Fri May 18 15:23:57 2012 -0700
Committer: Fil Maj <ma...@gmail.com>
Committed: Fri May 18 15:23:57 2012 -0700
----------------------------------------------------------------------
.../src/org/apache/cordova/AccelListener.java | 42 +++++++-------
1 files changed, 21 insertions(+), 21 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/6b24f2d5/framework/src/org/apache/cordova/AccelListener.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/AccelListener.java b/framework/src/org/apache/cordova/AccelListener.java
index 551e8bc..9e19d75 100755
--- a/framework/src/org/apache/cordova/AccelListener.java
+++ b/framework/src/org/apache/cordova/AccelListener.java
@@ -136,7 +136,7 @@ public class AccelListener extends Plugin implements SensorEventListener {
private int start() {
// If already starting or running, then just return
if ((this.status == AccelListener.RUNNING) || (this.status == AccelListener.STARTING)) {
- return this.status;
+ return this.status;
}
this.setStatus(AccelListener.STARTING);
@@ -146,28 +146,28 @@ public class AccelListener extends Plugin implements SensorEventListener {
// If found, then register as listener
if ((list != null) && (list.size() > 0)) {
- this.mSensor = list.get(0);
- this.sensorManager.registerListener(this, this.mSensor, SensorManager.SENSOR_DELAY_UI);
- this.setStatus(AccelListener.STARTING);
+ this.mSensor = list.get(0);
+ this.sensorManager.registerListener(this, this.mSensor, SensorManager.SENSOR_DELAY_UI);
+ this.setStatus(AccelListener.STARTING);
} else {
- this.setStatus(AccelListener.ERROR_FAILED_TO_START);
- this.fail(AccelListener.ERROR_FAILED_TO_START, "No sensors found to register accelerometer listening to.");
- return this.status;
+ this.setStatus(AccelListener.ERROR_FAILED_TO_START);
+ this.fail(AccelListener.ERROR_FAILED_TO_START, "No sensors found to register accelerometer listening to.");
+ return this.status;
}
// Wait until running
long timeout = 2000;
while ((this.status == STARTING) && (timeout > 0)) {
- timeout = timeout - 100;
- try {
- Thread.sleep(100);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
+ timeout = timeout - 100;
+ try {
+ Thread.sleep(100);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
}
if (timeout == 0) {
- this.setStatus(AccelListener.ERROR_FAILED_TO_START);
- this.fail(AccelListener.ERROR_FAILED_TO_START, "Accelerometer could not be started.");
+ this.setStatus(AccelListener.ERROR_FAILED_TO_START);
+ this.fail(AccelListener.ERROR_FAILED_TO_START, "Accelerometer could not be started.");
}
return this.status;
}
@@ -222,13 +222,13 @@ public class AccelListener extends Plugin implements SensorEventListener {
if (this.accuracy >= SensorManager.SENSOR_STATUS_ACCURACY_MEDIUM) {
- // Save time that event was received
- this.timestamp = System.currentTimeMillis();
- this.x = event.values[0];
- this.y = event.values[1];
- this.z = event.values[2];
+ // Save time that event was received
+ this.timestamp = System.currentTimeMillis();
+ this.x = event.values[0];
+ this.y = event.values[1];
+ this.z = event.values[2];
- this.win();
+ this.win();
}
}