aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/broeuschmeul/android/gps/nmea
diff options
context:
space:
mode:
authorHerbert von Broeuschmeul <Herbert.Broeuschmeul@gmail.com>2011-04-28 09:08:34 +0200
committerHerbert von Broeuschmeul <Herbert.Broeuschmeul@gmail.com>2011-04-28 09:08:34 +0200
commit22aecf56439e4d60e83f4718a3fb3ec80ed3e4df (patch)
treeaa670fc95d00149a742b815f3392a7665005e391 /src/org/broeuschmeul/android/gps/nmea
parent37fecb578d9b825678c20623593cb52bb0b3c020 (diff)
downloadBlueGPS-22aecf56439e4d60e83f4718a3fb3ec80ed3e4df.zip
BlueGPS-22aecf56439e4d60e83f4718a3fb3ec80ed3e4df.tar.gz
BlueGPS-22aecf56439e4d60e83f4718a3fb3ec80ed3e4df.tar.bz2
use the optional preference value to force auto-activation of the chosen location provider
Diffstat (limited to 'src/org/broeuschmeul/android/gps/nmea')
-rw-r--r--src/org/broeuschmeul/android/gps/nmea/util/NmeaParser.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/org/broeuschmeul/android/gps/nmea/util/NmeaParser.java b/src/org/broeuschmeul/android/gps/nmea/util/NmeaParser.java
index 792a6ba..fb9e906 100644
--- a/src/org/broeuschmeul/android/gps/nmea/util/NmeaParser.java
+++ b/src/org/broeuschmeul/android/gps/nmea/util/NmeaParser.java
@@ -73,7 +73,7 @@ public class NmeaParser {
this.lm = lm;
}
- public void enableMockLocationProvider(String gpsName){
+ public void enableMockLocationProvider(String gpsName, boolean force){
try {
LocationProvider prov;
if (gpsName != null && gpsName != "" ){
@@ -87,7 +87,8 @@ public class NmeaParser {
Log.v(LOG_TAG, "Mock provider: "+prov.getName()+" "+prov.getPowerRequirement()+" "+prov.getAccuracy()+" "+lm.isProviderEnabled(mockLocationProvider));
}
lm.addTestProvider(mockLocationProvider, false, true,false, false, true, true, true, Criteria.POWER_MEDIUM, Criteria.ACCURACY_FINE);
- if ((prov == null)
+ if ( force
+ || (prov == null)
// || (! LocationManager.GPS_PROVIDER.equals(mockLocationProvider))
){
Log.d(LOG_TAG, "enabling Mock provider: "+mockLocationProvider);