diff --git a/ORLib/src/main/java/io/openremote/orlib/service/GeofenceProvider.kt b/ORLib/src/main/java/io/openremote/orlib/service/GeofenceProvider.kt index 634bfbe..6749f4f 100644 --- a/ORLib/src/main/java/io/openremote/orlib/service/GeofenceProvider.kt +++ b/ORLib/src/main/java/io/openremote/orlib/service/GeofenceProvider.kt @@ -356,39 +356,39 @@ class GeofenceProvider(val context: Context) { LOG.info("Enabling geofence provider") Thread { - val hasPermission = - when { - android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.Q -> { - context.checkSelfPermission(ACCESS_BACKGROUND_LOCATION) == - PackageManager.PERMISSION_GRANTED - } - else -> { - context.checkSelfPermission(ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED - } + val hasPermission = + when { + android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.Q -> { + context.checkSelfPermission(ACCESS_BACKGROUND_LOCATION) == + PackageManager.PERMISSION_GRANTED } + else -> { + context.checkSelfPermission(ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED + } + } - callback?.accept( - hashMapOf( - "action" to "PROVIDER_ENABLE", - "provider" to "geofence", - "hasPermission" to hasPermission, - "success" to true, - ) + callback?.accept( + hashMapOf( + "action" to "PROVIDER_ENABLE", + "provider" to "geofence", + "hasPermission" to hasPermission, + "success" to true, ) + ) - if (hasPermission) { - LOG.info("Has permission so fetching geofences") + if (hasPermission) { + LOG.info("Has permission so fetching geofences") - if (getGeofences(context).isEmpty()) { - // Could be first time getting geofences so wait a few seconds for backend to catch up - Timer().schedule(10000) { - refreshGeofences() - } - } else { + if (getGeofences(context).isEmpty()) { + // Could be first time getting geofences so wait a few seconds for backend to catch up + Timer().schedule(10000) { refreshGeofences() } + } else { + refreshGeofences() } } + } .start() } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 0449370..ce444ec 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -25,7 +25,7 @@ play-services-location = "21.4.0" play-services-vision = "20.1.3" protobuf = "4.36.2" protobuf-plugin = "0.10.0" -spotless = "8.10.1" +spotless = "8.10.3" [libraries] androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "androidx-appcompat" }