Fixing bug with lack of proper unsubscribing of networkLocationListener

master
liinahamari 2021-04-08 07:45:42 +03:00
parent 0be1904cba
commit 10a523a42f
1 changed files with 1 additions and 1 deletions

View File

@ -385,7 +385,7 @@ class TrackerService: Service(), CoroutineScope, SensorEventListener {
/* Adds location listeners to location manager */ /* Adds location listeners to location manager */
fun removeNetworkLocationListener() { fun removeNetworkLocationListener() {
if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) { if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
locationManager.removeUpdates(gpsLocationListener) locationManager.removeUpdates(networkLocationListener)
networkLocationListenerRegistered = false networkLocationListenerRegistered = false
LogHelper.v(TAG, "Removed Network location listener.") LogHelper.v(TAG, "Removed Network location listener.")
} else { } else {