From e0fd693c6098f59004f9e96ad75c058e26c337b0 Mon Sep 17 00:00:00 2001 From: Nick Pelly Date: Wed, 11 Jul 2012 10:26:13 -0700 Subject: Improve geofencing: throttle location updates with distance to fence. Previously any geofence (proximity alert) would turn the GPS on at full rate. Now, we modify the GPS interval with the distance to the nearest geofence. A speed of 100m/s is assumed to calculate the next GPS update. Also o Major refactor of geofencing code, to make it easier to continue to improve. o Discard proximity alerts when an app is removed. o Misc cleanup of nearby code. There are other upcoming changes that make this a good time for some house-keeping. TODO: The new geofencing heuristics are much better than before, but still relatively naive. The next steps could be: - Improve boundary detection - Improve update thottling for large geofences - Consider velocity when throttling Change-Id: Ie6e23d2cb2b931eba5d2a2fc759543bb96e2f7d0 --- .../com/android/internal/location/DummyLocationProvider.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'location/java/com/android/internal') diff --git a/location/java/com/android/internal/location/DummyLocationProvider.java b/location/java/com/android/internal/location/DummyLocationProvider.java index e7b5143..3122960 100644 --- a/location/java/com/android/internal/location/DummyLocationProvider.java +++ b/location/java/com/android/internal/location/DummyLocationProvider.java @@ -24,7 +24,7 @@ import android.location.LocationProvider; * A DummyLocationProvider may be queried to determine the properties * of the provider whcih it shadows, but does not actually provide location * data. - * + * * {@hide} */ public class DummyLocationProvider extends LocationProvider { @@ -86,6 +86,7 @@ public class DummyLocationProvider extends LocationProvider { * Returns true if the provider requires access to a * data network (e.g., the Internet), false otherwise. */ + @Override public boolean requiresNetwork() { return mRequiresNetwork; } @@ -95,6 +96,7 @@ public class DummyLocationProvider extends LocationProvider { * satellite-based positioning system (e.g., GPS), false * otherwise. */ + @Override public boolean requiresSatellite() { return mRequiresSatellite; } @@ -104,6 +106,7 @@ public class DummyLocationProvider extends LocationProvider { * cellular network (e.g., to make use of cell tower IDs), false * otherwise. */ + @Override public boolean requiresCell() { return mRequiresCell; } @@ -113,6 +116,7 @@ public class DummyLocationProvider extends LocationProvider { * monetary charge to the user, false if use is free. It is up to * each provider to give accurate information. */ + @Override public boolean hasMonetaryCost() { return mHasMonetaryCost; } @@ -123,6 +127,7 @@ public class DummyLocationProvider extends LocationProvider { * under most circumstances but may occassionally not report it * should return true. */ + @Override public boolean supportsAltitude() { return mSupportsAltitude; } @@ -133,6 +138,7 @@ public class DummyLocationProvider extends LocationProvider { * under most circumstances but may occassionally not report it * should return true. */ + @Override public boolean supportsSpeed() { return mSupportsSpeed; } @@ -143,6 +149,7 @@ public class DummyLocationProvider extends LocationProvider { * under most circumstances but may occassionally not report it * should return true. */ + @Override public boolean supportsBearing() { return mSupportsBearing; } @@ -153,6 +160,7 @@ public class DummyLocationProvider extends LocationProvider { * @return the power requirement for this provider, as one of the * constants Criteria.POWER_REQUIREMENT_*. */ + @Override public int getPowerRequirement() { return mPowerRequirement; } @@ -164,6 +172,7 @@ public class DummyLocationProvider extends LocationProvider { * @return the horizontal accuracy for this provider, as one of the * constants Criteria.ACCURACY_*. */ + @Override public int getAccuracy() { return mAccuracy; } -- cgit v1.1