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.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/org/broeuschmeul/android/gps/bluetooth/provider/BlueetoothGpsManager.java b/src/org/broeuschmeul/android/gps/bluetooth/provider/BlueetoothGpsManager.java
index e114b45..2ccc28d 100644
--- a/src/org/broeuschmeul/android/gps/bluetooth/provider/BlueetoothGpsManager.java
+++ b/src/org/broeuschmeul/android/gps/bluetooth/provider/BlueetoothGpsManager.java
@@ -147,13 +147,12 @@ public class BlueetoothGpsManager {
/**
* @return true if the bluetooth GPS is enabled
*/
- public boolean isEnabled() {
+ public synchronized boolean isEnabled() {
return enabled;
}
public synchronized void enable() {
if (! enabled){
- this.enabled = true;
final BluetoothAdapter bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
if (bluetoothAdapter == null) {
// Device does not support Bluetooth
@@ -228,6 +227,7 @@ public class BlueetoothGpsManager {
}
}
};
+ this.enabled = true;
notificationPool = Executors.newSingleThreadExecutor();
notificationPool.execute(connectThread);
// enableMockLocationProvider(LocationManager.GPS_PROVIDER);