Added a static update interval fail safe set of 15 minutes

Signed-off-by: Ricky Barrette <rickbarrette@gmail.com>
This commit is contained in:
2012-06-21 10:03:06 -04:00
parent d53fe7bdd5
commit 2abc43c3bf
4 changed files with 11 additions and 5 deletions

Binary file not shown.

View File

@@ -162,10 +162,10 @@ public class SkyHookService extends Service implements GeoPointLocationListener,
if(intent != null){ if(intent != null){
if (intent.hasExtra(LocationLibraryConstants.INTENT_EXTRA_PERIOD_BETWEEN_UPDATES)) if (intent.hasExtra(LocationLibraryConstants.INTENT_EXTRA_PERIOD_BETWEEN_UPDATES))
mPeriod = intent.getLongExtra(LocationLibraryConstants.INTENT_EXTRA_PERIOD_BETWEEN_UPDATES, 60000L); mPeriod = intent.getLongExtra(LocationLibraryConstants.INTENT_EXTRA_PERIOD_BETWEEN_UPDATES, LocationLibraryConstants.FAIL_SAFE_UPDATE_INVERVAL);
if (intent.hasExtra(LocationLibraryConstants.INTENT_EXTRA_REQUIRED_ACCURACY)) if (intent.hasExtra(LocationLibraryConstants.INTENT_EXTRA_REQUIRED_ACCURACY))
mRequiredAccuracy = intent.getIntExtra(LocationLibraryConstants.INTENT_EXTRA_REQUIRED_ACCURACY, -1); mRequiredAccuracy = intent.getIntExtra(LocationLibraryConstants.INTENT_EXTRA_REQUIRED_ACCURACY, LocationLibraryConstants.MINIMUM_REQUIRED_ACCURACY);
} }
} }

View File

@@ -8,6 +8,7 @@ package com.TwentyCodes.android.debug;
import com.TwentyCodes.android.location.BaseLocationReceiver; import com.TwentyCodes.android.location.BaseLocationReceiver;
import android.app.AlarmManager;
import android.hardware.SensorManager; import android.hardware.SensorManager;
import android.location.LocationManager; import android.location.LocationManager;
@@ -51,7 +52,7 @@ public final class LocationLibraryConstants {
* Minimum Required accuracy to report * Minimum Required accuracy to report
* @author ricky barrette * @author ricky barrette
*/ */
public static final int MINIMUM_REQUIRED_ACCURACY = 50; public static final int MINIMUM_REQUIRED_ACCURACY = 100;
public static final boolean SUPPORTS_FROYO; public static final boolean SUPPORTS_FROYO;
@@ -70,4 +71,9 @@ public final class LocationLibraryConstants {
* Used to tell the service how accurate of a location you want reported * Used to tell the service how accurate of a location you want reported
*/ */
public static final String INTENT_EXTRA_REQUIRED_ACCURACY = "required_accuracy"; public static final String INTENT_EXTRA_REQUIRED_ACCURACY = "required_accuracy";
/**
* used if the INTENT_EXTRA_PERIOD_BETWEEN_UPDATES is present, but contains no data
*/
public static final long FAIL_SAFE_UPDATE_INVERVAL = AlarmManager.INTERVAL_FIFTEEN_MINUTES;
} }

View File

@@ -165,10 +165,10 @@ public class LocationService extends Service implements LocationListener {
this.mIntent = intent; this.mIntent = intent;
if (intent.hasExtra(LocationLibraryConstants.INTENT_EXTRA_PERIOD_BETWEEN_UPDATES)) if (intent.hasExtra(LocationLibraryConstants.INTENT_EXTRA_PERIOD_BETWEEN_UPDATES))
mPeriod = intent.getLongExtra(LocationLibraryConstants.INTENT_EXTRA_PERIOD_BETWEEN_UPDATES, 60000L); mPeriod = intent.getLongExtra(LocationLibraryConstants.INTENT_EXTRA_PERIOD_BETWEEN_UPDATES, LocationLibraryConstants.FAIL_SAFE_UPDATE_INVERVAL);
if (intent.hasExtra(LocationLibraryConstants.INTENT_EXTRA_REQUIRED_ACCURACY)) if (intent.hasExtra(LocationLibraryConstants.INTENT_EXTRA_REQUIRED_ACCURACY))
mRequiredAccuracy = intent.getIntExtra(LocationLibraryConstants.INTENT_EXTRA_REQUIRED_ACCURACY, -1); mRequiredAccuracy = intent.getIntExtra(LocationLibraryConstants.INTENT_EXTRA_REQUIRED_ACCURACY, LocationLibraryConstants.MINIMUM_REQUIRED_ACCURACY);
} }
/** /**