Removes foreground location and Resolves #510

This commit is contained in:
Yegor Vialov 2019-11-26 20:54:36 +00:00
parent 74c8ae35a1
commit 4bac0c092f
2 changed files with 2 additions and 7 deletions

View File

@ -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;

View File

@ -94,7 +94,7 @@ class _IntegrationSettingsPageState extends State<IntegrationSettingsPage> {
_switchLocationTrackingState(bool state) async {
if (state) {
await LocationManager().updateDeviceLocation(true);
await LocationManager().updateDeviceLocation();
}
await LocationManager().setSettings(_locationTrackingEnabled, _locationInterval);
setState(() {