[Android] fix speed limit indicator activating when driving exactly at speed limit

the displayed speed is rounded, but the speedLimitExceeded check isn't, resulting in what appears to be incorrect activations. Fixed by rounding in speedLimitExceeded also.
fixes #544

Signed-off-by: Harry Bond <me@hbond.xyz>
This commit is contained in:
Harry Bond
2025-06-22 19:08:17 +01:00
committed by Konstantin Pastbin
parent 142759c4d0
commit a830e4b444

View File

@@ -266,7 +266,8 @@ public class NavigationController implements TrafficManager.TrafficCallback,
mSpeedLimit.setSpeedLimit(0, false);
return;
}
final boolean speedLimitExceeded = info.speedLimitMps < location.getSpeed();
mSpeedLimit.setSpeedLimit(StringUtils.nativeFormatSpeed(info.speedLimitMps), speedLimitExceeded);
final int fSpeedLimit = StringUtils.nativeFormatSpeed(info.speedLimitMps);
final boolean speedLimitExceeded = fSpeedLimit < StringUtils.nativeFormatSpeed(location.getSpeed());
mSpeedLimit.setSpeedLimit(fSpeedLimit, speedLimitExceeded);
}
}