Commit bd19c13b authored by Chris Scott's avatar Chris Scott

Only reset stationary alarm when we have an accurate location and speed

parent e8cd77de
...@@ -383,8 +383,8 @@ public class LocationUpdateService extends Service implements LocationListener { ...@@ -383,8 +383,8 @@ public class LocationUpdateService extends Service implements LocationListener {
if (isDebugging) { if (isDebugging) {
startTone("beep"); startTone("beep");
} }
// Only reset stationaryAlarm when speed is detected, prevents spurious locations from resetting when stopped. // Only reset stationaryAlarm when accurate speed is detected, prevents spurious locations from resetting when stopped.
if (location.getSpeed() > 0) { if ( (location.getSpeed() >= 1) && (location.getAccuracy() <= stationaryRadius) ) {
resetStationaryAlarm(); resetStationaryAlarm();
} }
// Calculate latest distanceFilter, if it changed by 5 m/s, we'll reconfigure our pace. // Calculate latest distanceFilter, if it changed by 5 m/s, we'll reconfigure our pace.
...@@ -440,7 +440,7 @@ public class LocationUpdateService extends Service implements LocationListener { ...@@ -440,7 +440,7 @@ public class LocationUpdateService extends Service implements LocationListener {
tone = ToneGenerator.TONE_CDMA_ALERT_NETWORK_LITE; tone = ToneGenerator.TONE_CDMA_ALERT_NETWORK_LITE;
} else if (name.equals("chirp_chirp_chirp")) { } else if (name.equals("chirp_chirp_chirp")) {
tone = ToneGenerator.TONE_CDMA_ALERT_CALL_GUARD; tone = ToneGenerator.TONE_CDMA_ALERT_CALL_GUARD;
} else if (name.equals("hoo")) { } else if (name.equals("dialtone")) {
tone = ToneGenerator.TONE_SUP_RINGTONE; tone = ToneGenerator.TONE_SUP_RINGTONE;
} }
toneGenerator.startTone(tone, duration); toneGenerator.startTone(tone, duration);
...@@ -557,7 +557,7 @@ public class LocationUpdateService extends Service implements LocationListener { ...@@ -557,7 +557,7 @@ public class LocationUpdateService extends Service implements LocationListener {
{ {
Log.i(TAG, "- stationaryLocationMonitorReceiver fired"); Log.i(TAG, "- stationaryLocationMonitorReceiver fired");
if (isDebugging) { if (isDebugging) {
startTone("hoo"); startTone("dialtone");
} }
criteria.setAccuracy(Criteria.ACCURACY_FINE); criteria.setAccuracy(Criteria.ACCURACY_FINE);
criteria.setHorizontalAccuracy(Criteria.ACCURACY_HIGH); criteria.setHorizontalAccuracy(Criteria.ACCURACY_HIGH);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment