Fix location updates in the background (#834)

This commit is contained in:
Daniel Shokouhi 2020-08-27 14:31:13 -07:00 committed by GitHub
parent e6f2e589d2
commit 51a6fa5c0c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -286,8 +286,6 @@ class LocationSensorManager : BroadcastReceiver(), SensorManager {
locationResult.lastLocation.accuracy <= MINIMUM_ACCURACY -> {
Log.d(TAG, "Location accurate enough, all done with high accuracy.")
runBlocking { sendLocationUpdate(locationResult.lastLocation) }
LocationServices.getFusedLocationProviderClient(context)
.removeLocationUpdates(this)
if (wakeLock?.isHeld == true) wakeLock.release()
}
numberCalls >= maxRetries -> {