Merge pull request #101 from liinahamari/issue-100-lack-on-nlm-unsubscribing

Fixing bug with lack of proper unsubscribing of networkLocationListener
master
y20k 2021-04-08 20:07:12 +02:00 committed by GitHub
commit 2ef054f29e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 */
fun removeNetworkLocationListener() {
if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
locationManager.removeUpdates(gpsLocationListener)
locationManager.removeUpdates(networkLocationListener)
networkLocationListenerRegistered = false
LogHelper.v(TAG, "Removed Network location listener.")
} else {