aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/broeuschmeul/android/gps/bluetooth/provider/BlueetoothGpsManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/broeuschmeul/android/gps/bluetooth/provider/BlueetoothGpsManager.java')
-rw-r--r--src/org/broeuschmeul/android/gps/bluetooth/provider/BlueetoothGpsManager.java19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/org/broeuschmeul/android/gps/bluetooth/provider/BlueetoothGpsManager.java b/src/org/broeuschmeul/android/gps/bluetooth/provider/BlueetoothGpsManager.java
index b233168..3d2d0a8 100644
--- a/src/org/broeuschmeul/android/gps/bluetooth/provider/BlueetoothGpsManager.java
+++ b/src/org/broeuschmeul/android/gps/bluetooth/provider/BlueetoothGpsManager.java
@@ -456,11 +456,28 @@ public class BlueetoothGpsManager {
* @see NmeaParser#enableMockLocationProvider(java.lang.String)
* @param gpsName the name of the Location Provider to use for the bluetooth GPS
+ * @param force true if we want to force auto-activation of the mock location provider (and bypass user preference).
+ */
+ public void enableMockLocationProvider(String gpsName, boolean force){
+ if (parser != null){
+ Log.d(LOG_TAG, "enabling mock locations provider: "+gpsName);
+ parser.enableMockLocationProvider(gpsName, force);
+ }
+ }
+
+ /**
+ * Enables the Mock GPS Location Provider used for the bluetooth GPS.
+ * In fact, it delegates to the NMEA parser.
+ *
+ * @see NmeaParser#enableMockLocationProvider(java.lang.String)
+
+ * @param gpsName the name of the Location Provider to use for the bluetooth GPS
*/
public void enableMockLocationProvider(String gpsName){
if (parser != null){
Log.d(LOG_TAG, "enabling mock locations provider: "+gpsName);
- parser.enableMockLocationProvider(gpsName);
+ boolean force = sharedPreferences.getBoolean(BluetoothGpsProviderService.PREF_FORCE_ENABLE_PROVIDER, false);
+ parser.enableMockLocationProvider(gpsName, false);
}
}