mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-05-09 12:36:07 +02:00
fix(geolocation): use timeout for min,max,interval on android (#3010)
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
---
|
||||
geolocation: patch
|
||||
geolocation-js: patch
|
||||
---
|
||||
|
||||
On Android, use the `timeout` value for `setMinUpdateIntervalMillis`, `setMaxUpdateDelayMillis` and `setIntervalMillis` instead of just `minUpdateInterval`.
|
||||
@@ -91,9 +91,9 @@ public class Geolocation(private val context: Context) {
|
||||
val lowPrio = if (networkEnabled) Priority.PRIORITY_BALANCED_POWER_ACCURACY else Priority.PRIORITY_LOW_POWER
|
||||
val prio = if (enableHighAccuracy) Priority.PRIORITY_HIGH_ACCURACY else lowPrio
|
||||
|
||||
val locationRequest = LocationRequest.Builder(10000)
|
||||
val locationRequest = LocationRequest.Builder(timeout)
|
||||
.setMaxUpdateDelayMillis(timeout)
|
||||
.setMinUpdateIntervalMillis(5000)
|
||||
.setMinUpdateIntervalMillis(timeout)
|
||||
.setPriority(prio)
|
||||
.build()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user