From d13120bcef872fd3ffd734f0398eef4f1a094cba Mon Sep 17 00:00:00 2001 From: woshipzs Date: Thu, 15 May 2014 02:18:10 -0500 Subject: [PATCH] Update SensorService.java filter out some bad location fixes --- .../src/edu/missouri/bas/service/SensorService.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/BodySensorApplication-master/src/edu/missouri/bas/service/SensorService.java b/BodySensorApplication-master/src/edu/missouri/bas/service/SensorService.java index b937f9a..d7248ce 100644 --- a/BodySensorApplication-master/src/edu/missouri/bas/service/SensorService.java +++ b/BodySensorApplication-master/src/edu/missouri/bas/service/SensorService.java @@ -977,7 +977,12 @@ else if(action.equals(SensorService.ACTION_SCHEDULE_LOCATION)){ //locationControl.startRecording(); currentUserActivity=intent.getIntExtra("activity",9); Location mCurrentLocation=mLocationClient.getLastLocation(); - writeLocationToFile(mCurrentLocation); + //filter out some bad location fixes + if(mCurrentLocation.hasAccuracy()){ + if(mCurrentLocation.getAccuracy() <= 35){ + writeLocationToFile(mCurrentLocation); + } + } } else if(action.equals(SensorService.ACTION_RESTART_RANDOM_SURVEY)) {