Skip to content

Commit

Permalink
Merge pull request square#17 from square/doc-fixes
Browse files Browse the repository at this point in the history
Doc tweaks
  • Loading branch information
dnkoutso committed Jan 13, 2012
2 parents 4e03e83 + e1dbe6c commit bb6d3c6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions modules/android/src/retrofit/android/ShakeDetector.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;

import java.util.ArrayList;
import java.util.List;

Expand Down Expand Up @@ -62,7 +61,10 @@ public boolean start(SensorManager sensorManager) {
return accelerometer != null;
}

/** Stops listening, ignored on devices without appropriate hardware. */
/**
* Stops listening. Safe to call when already stopped. Ignored on devices
* without appropriate hardware.
*/
public void stop() {
if (accelerometer != null) {
sensorManager.unregisterListener(this, accelerometer);
Expand All @@ -71,7 +73,7 @@ public void stop() {
}
}

public void onSensorChanged(SensorEvent event) {
@Override public void onSensorChanged(SensorEvent event) {
boolean accelerating = isAccelerating(event);
long timestamp = event.timestamp;
queue.add(timestamp, accelerating);
Expand Down Expand Up @@ -223,6 +225,6 @@ void release(Sample sample) {
}
}

public void onAccuracyChanged(Sensor sensor, int accuracy) {
@Override public void onAccuracyChanged(Sensor sensor, int accuracy) {
}
}

0 comments on commit bb6d3c6

Please sign in to comment.