diff --git a/lib/managers/location_manager.class.dart b/lib/managers/location_manager.class.dart index 3868337..b6e4449 100644 --- a/lib/managers/location_manager.class.dart +++ b/lib/managers/location_manager.class.dart @@ -27,7 +27,6 @@ class LocationManager { _isRunning = prefs.getBool("location-enabled") ?? false; if (_isRunning) { await _startLocationService(); - updateDeviceLocation(false); } } @@ -108,11 +107,7 @@ class LocationManager { await workManager.Workmanager.cancelByTag(backgroundTaskTag); } - updateDeviceLocation(bool force) async { - if (!force && !_isRunning) { - Logger.d("[Foreground location] Not enabled. Aborting."); - return; - } + updateDeviceLocation() async { Logger.d("[Foreground location] Started"); //Logger.d("[Foreground location] Forcing Android location manager..."); Geolocator geolocator = Geolocator()..forceAndroidLocationManager = true; diff --git a/lib/pages/integration_settings.page.dart b/lib/pages/integration_settings.page.dart index 9b51e6c..a65abee 100644 --- a/lib/pages/integration_settings.page.dart +++ b/lib/pages/integration_settings.page.dart @@ -94,7 +94,7 @@ class _IntegrationSettingsPageState extends State { _switchLocationTrackingState(bool state) async { if (state) { - await LocationManager().updateDeviceLocation(true); + await LocationManager().updateDeviceLocation(); } await LocationManager().setSettings(_locationTrackingEnabled, _locationInterval); setState(() {