From 8ea47c762428c5c968f367cf0de39b80e0d1c14d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Claes=20=27Letharion=27=20Gyllensv=C3=A4rd?= Date: Wed, 7 Oct 2026 11:41:01 +0200 Subject: [PATCH] fix: record GPS when location was off as the app started TrackerGPS.onInit replaced the deprecated getProvider(GPS_PROVIDER) == null with !isProviderEnabled(GPS_PROVIDER), which also reports "not supported" when location is merely switched off. A component that is not supported at init is skipped when the tracker connects, so if RunnerUp was opened with location off and location was then switched on, the run recorded no GPS: 0 points, 0 m and 0 s, while the start screen showed a good fix from its own listener. Check whether the device has a GPS provider, as before, with LocationManagerCompat.hasProvider. --- app/src/main/org/runnerup/tracker/component/TrackerGPS.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/org/runnerup/tracker/component/TrackerGPS.java b/app/src/main/org/runnerup/tracker/component/TrackerGPS.java index 95ae1d8d4..3ef533be7 100644 --- a/app/src/main/org/runnerup/tracker/component/TrackerGPS.java +++ b/app/src/main/org/runnerup/tracker/component/TrackerGPS.java @@ -76,7 +76,7 @@ public ResultCode onInit(final Callback callback, Context context) { return ResultCode.RESULT_OK; } try { - if (!locationManager.isProviderEnabled(GPS_PROVIDER)) { + if (!LocationManagerCompat.hasProvider(locationManager, GPS_PROVIDER)) { return ResultCode.RESULT_NOT_SUPPORTED; } } catch (Exception ex) {