From 969628eec342710bc12d93ea05bbbd8916671892 Mon Sep 17 00:00:00 2001 From: Ross Ryles Date: Fri, 15 May 2026 09:05:11 +0100 Subject: [PATCH] fix(Running,Cycling,Hiking): disconnect GPS when GUI stops Release the early GPS location subscription started in onStartGUI when the GUI tears down after an activity, so the receiver is not left on. --- Apps/Cycling/Software/Libs/Sources/Service.cpp | 6 ++++++ Apps/Hiking/Software/Libs/Sources/Service.cpp | 6 ++++++ Apps/Running/Software/Libs/Sources/Service.cpp | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/Apps/Cycling/Software/Libs/Sources/Service.cpp b/Apps/Cycling/Software/Libs/Sources/Service.cpp index 2c7e1bc2..5a9f7b6d 100644 --- a/Apps/Cycling/Software/Libs/Sources/Service.cpp +++ b/Apps/Cycling/Software/Libs/Sources/Service.cpp @@ -333,6 +333,12 @@ void Service::onStopGUI() { mGuiStarted = false; + // GPS early-acquire is tied to GUI (see connectGps in onStartGUI). Release it when + // the GUI stops + if (mSensorGpsLocation.isConnected()) { + mSensorGpsLocation.disconnect(); + } + mSensorWristMotion.disconnect(); } diff --git a/Apps/Hiking/Software/Libs/Sources/Service.cpp b/Apps/Hiking/Software/Libs/Sources/Service.cpp index 3a5c4f13..9b37d4d5 100644 --- a/Apps/Hiking/Software/Libs/Sources/Service.cpp +++ b/Apps/Hiking/Software/Libs/Sources/Service.cpp @@ -356,6 +356,12 @@ void Service::onStopGUI() { mGuiStarted = false; + // GPS early-acquire is tied to GUI (see connectGps in onStartGUI). Release it when + // the GUI stops + if (mSensorGpsLocation.isConnected()) { + mSensorGpsLocation.disconnect(); + } + mSensorWristMotion.disconnect(); } diff --git a/Apps/Running/Software/Libs/Sources/Service.cpp b/Apps/Running/Software/Libs/Sources/Service.cpp index 49d18054..ac0f5af0 100644 --- a/Apps/Running/Software/Libs/Sources/Service.cpp +++ b/Apps/Running/Software/Libs/Sources/Service.cpp @@ -384,6 +384,12 @@ void Service::onStopGUI() { mGuiStarted = false; + // GPS early-acquire is tied to GUI (see connectGps in onStartGUI). Release it when + // the GUI stops + if (mSensorGpsLocation.isConnected()) { + mSensorGpsLocation.disconnect(); + } + mSensorWristMotion.disconnect(); }