Removes foreground location and Resolves #510
This commit is contained in:
parent
74c8ae35a1
commit
4bac0c092f
@ -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;
|
||||
|
@ -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(() {
|
||||
|
Reference in New Issue
Block a user