From 0bd65e050c73010ed33b60addc2681e71b0f10a9 Mon Sep 17 00:00:00 2001 From: cpfeiffer Date: Sun, 16 Aug 2015 23:18:32 +0200 Subject: [PATCH] Make intensity also always positive #91 I never experienced such values, but others apparently do... --- .../gadgetbridge/service/devices/miband/MiBandSupport.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/MiBandSupport.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/MiBandSupport.java index 28cac0a7..2e8e91a7 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/MiBandSupport.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/MiBandSupport.java @@ -918,7 +918,7 @@ public class MiBandSupport extends AbstractBTLEDeviceSupport { dbHandler.addGBActivitySample( (int) (activityStruct.activityDataTimestampProgress.getTimeInMillis() / 1000), SampleProvider.PROVIDER_MIBAND, - intensity, + (short) (intensity & 0xff), (short) (steps & 0xff), category); activityStruct.activityDataTimestampProgress.add(Calendar.MINUTE, 1);