Fix expanded zone id for high accuracy zone constraint (#3509)

- When checking if an expanded zone geofence should be created include the server ID in the comparison as that is what is used everywhere else. Otherwise expanded zones are never added, and as a result high accuracy mode won't work as expected.
This commit is contained in:
Joris Pelgröm 2023-05-13 04:43:38 +02:00 committed by GitHub
parent 97634e3903
commit 7e1dc203ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -947,7 +947,7 @@ class LocationSensorManager : LocationSensorManagerBase() {
val configuredZones = getZones(serverId, forceRefresh = true)
configuredZones.forEach {
addGeofenceToBuilder(geofencingRequestBuilder, serverId, it)
if (highAccuracyTriggerRange > 0 && highAccuracyZones.contains(it.entityId)) {
if (highAccuracyTriggerRange > 0 && highAccuracyZones.contains("${serverId}_${it.entityId}")) {
addGeofenceToBuilder(geofencingRequestBuilder, serverId, it, highAccuracyTriggerRange)
}
}
@ -963,7 +963,7 @@ class LocationSensorManager : LocationSensorManagerBase() {
zone: Entity<ZoneAttributes>,
triggerRange: Int = 0
) {
val postRequestId = if (triggerRange > 0)"_expanded" else ""
val postRequestId = if (triggerRange > 0) "_expanded" else ""
geofencingRequestBuilder
.addGeofence(
Geofence.Builder()