From aa087ebea87a3685bed11a595cdbc6a3e196cc0d Mon Sep 17 00:00:00 2001 From: James Rich <2199651+jamesarich@users.noreply.github.com> Date: Sun, 14 Sep 2025 08:26:21 -0500 Subject: [PATCH] fix: detekt (#3090) (cherry picked from commit ba003487c1549b90de411fc0b2e34183f5badea3) --- .../com/geeksville/mesh/service/MeshService.kt | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/geeksville/mesh/service/MeshService.kt b/app/src/main/java/com/geeksville/mesh/service/MeshService.kt index 88bc52a40..341835539 100644 --- a/app/src/main/java/com/geeksville/mesh/service/MeshService.kt +++ b/app/src/main/java/com/geeksville/mesh/service/MeshService.kt @@ -1378,11 +1378,17 @@ class MeshService : val isRouter = localConfig.device.role == ConfigProtos.Config.DeviceConfig.Role.ROUTER val lsEnabled = localConfig.power.isPowerSaving || isRouter - val effectiveState = when (newState) { - ConnectionState.CONNECTED -> ConnectionState.CONNECTED - ConnectionState.DEVICE_SLEEP -> if (lsEnabled) ConnectionState.DEVICE_SLEEP else ConnectionState.DISCONNECTED - ConnectionState.DISCONNECTED -> ConnectionState.DISCONNECTED - } + val effectiveState = + when (newState) { + ConnectionState.CONNECTED -> ConnectionState.CONNECTED + ConnectionState.DEVICE_SLEEP -> + if (lsEnabled) { + ConnectionState.DEVICE_SLEEP + } else { + ConnectionState.DISCONNECTED + } + ConnectionState.DISCONNECTED -> ConnectionState.DISCONNECTED + } onConnectionChanged(effectiveState) }