diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/database/ActivityDatabaseHandler.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/database/ActivityDatabaseHandler.java index e6cf750d..3948acd4 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/database/ActivityDatabaseHandler.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/database/ActivityDatabaseHandler.java @@ -115,7 +115,8 @@ public class ActivityDatabaseHandler extends SQLiteOpenHelper implements DBHandl * @param steps the sample's steps value * @param kind the raw activity kind of the sample */ - public void addGBActivitySample(int timestamp, byte provider, short intensity, byte steps, byte kind) { + @Override + public void addGBActivitySample(int timestamp, byte provider, short intensity, short steps, byte kind) { try (SQLiteDatabase db = this.getWritableDatabase()) { ContentValues values = new ContentValues(); values.put(KEY_TIMESTAMP, timestamp); diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/database/DBHandler.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/database/DBHandler.java index 8623735a..fb42e7ff 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/database/DBHandler.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/database/DBHandler.java @@ -24,7 +24,7 @@ public interface DBHandler { List getSleepSamples(int tsFrom, int tsTo, SampleProvider provider); - void addGBActivitySample(int timestamp, byte provider, short intensity, byte steps, byte kind); + void addGBActivitySample(int timestamp, byte provider, short intensity, short steps, byte kind); SQLiteDatabase getWritableDatabase(); } 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 b7c40c4b..28cac0a7 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 @@ -12,6 +12,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.IOException; +import java.nio.charset.Charset; import java.text.DateFormat; import java.util.ArrayList; import java.util.Arrays; @@ -918,7 +919,7 @@ public class MiBandSupport extends AbstractBTLEDeviceSupport { (int) (activityStruct.activityDataTimestampProgress.getTimeInMillis() / 1000), SampleProvider.PROVIDER_MIBAND, intensity, - steps, + (short) (steps & 0xff), category); activityStruct.activityDataTimestampProgress.add(Calendar.MINUTE, 1); }