mirror of
https://github.com/permissionlesstech/bitchat-android.git
synced 2026-09-19 04:59:59 +00:00
Ignore stale system location callbacks
This commit is contained in:
parent
546c298efd
commit
61c9e94e46
@ -376,9 +376,13 @@ internal class SystemLocationProvider(private val context: Context) : LocationPr
|
||||
|
||||
removeLocationUpdates(callback)
|
||||
|
||||
val listener = object : LocationListener {
|
||||
lateinit var listener: LocationListener
|
||||
listener = object : LocationListener {
|
||||
override fun onLocationChanged(location: Location) {
|
||||
if (hasLocationPermission()) callback(location)
|
||||
val isCurrentListener = synchronized(activeListeners) {
|
||||
activeListeners[callback] === listener
|
||||
}
|
||||
if (isCurrentListener && hasLocationPermission()) callback(location)
|
||||
}
|
||||
|
||||
override fun onStatusChanged(provider: String?, status: Int, extras: Bundle?) = Unit
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user