From f983060cb2b2e848fa6d622c72ecb38bc16db50a Mon Sep 17 00:00:00 2001 From: Me7c7 Date: Fri, 30 Aug 2024 18:59:40 +0300 Subject: [PATCH] Huawei: Fixed min and max attitude values in workouts #4044 --- .../service/devices/huawei/HuaweiWorkoutGbParser.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huawei/HuaweiWorkoutGbParser.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huawei/HuaweiWorkoutGbParser.java index 3f89bcf10..4ae76f4d7 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huawei/HuaweiWorkoutGbParser.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huawei/HuaweiWorkoutGbParser.java @@ -412,11 +412,12 @@ public class HuaweiWorkoutGbParser { int cyclingPowerCount = 0; int avgAltitude = 0; int altitudeCount = 0; - int minAltitude = 0; - int maxAltitude = 0; + int minAltitude = Integer.MAX_VALUE; + int maxAltitude = Integer.MIN_VALUE; Integer previousAlt = null; int sumAltitudeUp = 0; int sumAltitudeDown = 0; + for (HuaweiWorkoutDataSample dataSample : dataSamples) { if (dataSample.getSpeed() != -1) { speed += dataSample.getSpeed();