diff --git a/LocationLib/bin/locationlib.jar b/LocationLib/bin/locationlib.jar index db83dc2..c478c12 100644 Binary files a/LocationLib/bin/locationlib.jar and b/LocationLib/bin/locationlib.jar differ diff --git a/LocationLib/src/com/TwentyCodes/android/SkyHook/SkyHookService.java b/LocationLib/src/com/TwentyCodes/android/SkyHook/SkyHookService.java index 544a292..49bec25 100644 --- a/LocationLib/src/com/TwentyCodes/android/SkyHook/SkyHookService.java +++ b/LocationLib/src/com/TwentyCodes/android/SkyHook/SkyHookService.java @@ -162,10 +162,10 @@ public class SkyHookService extends Service implements GeoPointLocationListener, if(intent != null){ 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)) - mRequiredAccuracy = intent.getIntExtra(LocationLibraryConstants.INTENT_EXTRA_REQUIRED_ACCURACY, -1); + mRequiredAccuracy = intent.getIntExtra(LocationLibraryConstants.INTENT_EXTRA_REQUIRED_ACCURACY, LocationLibraryConstants.MINIMUM_REQUIRED_ACCURACY); } } diff --git a/LocationLib/src/com/TwentyCodes/android/debug/LocationLibraryConstants.java b/LocationLib/src/com/TwentyCodes/android/debug/LocationLibraryConstants.java index 42e4b33..d83824f 100644 --- a/LocationLib/src/com/TwentyCodes/android/debug/LocationLibraryConstants.java +++ b/LocationLib/src/com/TwentyCodes/android/debug/LocationLibraryConstants.java @@ -8,6 +8,7 @@ package com.TwentyCodes.android.debug; import com.TwentyCodes.android.location.BaseLocationReceiver; +import android.app.AlarmManager; import android.hardware.SensorManager; import android.location.LocationManager; @@ -51,7 +52,7 @@ public final class LocationLibraryConstants { * Minimum Required accuracy to report * @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; @@ -70,4 +71,9 @@ public final class LocationLibraryConstants { * Used to tell the service how accurate of a location you want reported */ 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; } \ No newline at end of file diff --git a/LocationLib/src/com/TwentyCodes/android/location/LocationService.java b/LocationLib/src/com/TwentyCodes/android/location/LocationService.java index 8be7829..64a690b 100644 --- a/LocationLib/src/com/TwentyCodes/android/location/LocationService.java +++ b/LocationLib/src/com/TwentyCodes/android/location/LocationService.java @@ -165,10 +165,10 @@ public class LocationService extends Service implements LocationListener { this.mIntent = intent; 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)) - mRequiredAccuracy = intent.getIntExtra(LocationLibraryConstants.INTENT_EXTRA_REQUIRED_ACCURACY, -1); + mRequiredAccuracy = intent.getIntExtra(LocationLibraryConstants.INTENT_EXTRA_REQUIRED_ACCURACY, LocationLibraryConstants.MINIMUM_REQUIRED_ACCURACY); } /**