mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
feat: add isGooglePlayAvailable check
This commit is contained in:
parent
ce66a9425d
commit
218aa4b86e
1 changed files with 2 additions and 1 deletions
|
|
@ -7,6 +7,7 @@ import android.os.Looper
|
|||
import com.geeksville.mesh.android.GeeksvilleApplication
|
||||
import com.geeksville.mesh.android.Logging
|
||||
import com.geeksville.mesh.android.hasBackgroundPermission
|
||||
import com.geeksville.mesh.android.isGooglePlayAvailable
|
||||
import com.google.android.gms.location.LocationCallback
|
||||
import com.google.android.gms.location.LocationRequest
|
||||
import com.google.android.gms.location.LocationResult
|
||||
|
|
@ -54,7 +55,7 @@ class SharedLocationManager constructor(
|
|||
trySend(result.lastLocation)
|
||||
}
|
||||
}
|
||||
if (!context.hasBackgroundPermission()) close()
|
||||
if (!context.hasBackgroundPermission() || !isGooglePlayAvailable(context)) close()
|
||||
|
||||
info("Starting location requests with interval=${desiredInterval}ms")
|
||||
_receivingLocationUpdates.value = true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue