refactor(trail): route gpsHasFix through ownPos/currentLocation

The last stray getLocationProvider/isValid duplicate (with its own
ENV_INCLUDE_GPS guard). Fold it into ownPos so every GPS lookup in the
nav screens goes through UITask::currentLocation.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Jakub
2026-06-04 00:16:28 +02:00
parent 1d0c655111
commit 7c25aa1ad4

View File

@@ -218,15 +218,8 @@ public:
return false;
}
// True when the global SensorManager has a usable GPS fix.
static bool gpsHasFix() {
#if ENV_INCLUDE_GPS == 1
LocationProvider* loc = sensors.getLocationProvider();
return loc && loc->isValid();
#else
return false;
#endif
}
// True when there's a usable GPS fix (same source as ownPos).
bool gpsHasFix() const { int32_t lat, lon; return ownPos(lat, lon); }
private:
void handleToggle() {