mirror of
https://github.com/home-assistant/android
synced 2024-09-19 16:11:37 +00:00
Fix location updates in the background (#834)
This commit is contained in:
parent
e6f2e589d2
commit
51a6fa5c0c
|
@ -286,8 +286,6 @@ class LocationSensorManager : BroadcastReceiver(), SensorManager {
|
||||||
locationResult.lastLocation.accuracy <= MINIMUM_ACCURACY -> {
|
locationResult.lastLocation.accuracy <= MINIMUM_ACCURACY -> {
|
||||||
Log.d(TAG, "Location accurate enough, all done with high accuracy.")
|
Log.d(TAG, "Location accurate enough, all done with high accuracy.")
|
||||||
runBlocking { sendLocationUpdate(locationResult.lastLocation) }
|
runBlocking { sendLocationUpdate(locationResult.lastLocation) }
|
||||||
LocationServices.getFusedLocationProviderClient(context)
|
|
||||||
.removeLocationUpdates(this)
|
|
||||||
if (wakeLock?.isHeld == true) wakeLock.release()
|
if (wakeLock?.isHeld == true) wakeLock.release()
|
||||||
}
|
}
|
||||||
numberCalls >= maxRetries -> {
|
numberCalls >= maxRetries -> {
|
||||||
|
|
Loading…
Reference in a new issue