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 f186f88e..bc1facb3 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/database/ActivityDatabaseHandler.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/database/ActivityDatabaseHandler.java @@ -226,10 +226,10 @@ public class ActivityDatabaseHandler extends SQLiteOpenHelper implements DBHandl GBActivitySample sample = new GBActivitySample( provider, cursor.getInt(cursor.getColumnIndex(KEY_TIMESTAMP)), - cursor.getShort(cursor.getColumnIndex(KEY_INTENSITY)), - cursor.getShort(cursor.getColumnIndex(KEY_STEPS)), - (byte) cursor.getShort(cursor.getColumnIndex(KEY_TYPE)), - cursor.getShort(cursor.getColumnIndex(KEY_CUSTOM_SHORT))); + cursor.getInt(cursor.getColumnIndex(KEY_INTENSITY)), + cursor.getInt(cursor.getColumnIndex(KEY_STEPS)), + cursor.getInt(cursor.getColumnIndex(KEY_TYPE)), + cursor.getInt(cursor.getColumnIndex(KEY_CUSTOM_SHORT))); samples.add(sample); } while (cursor.moveToNext()); } diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/miband/MiBandSampleProvider.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/miband/MiBandSampleProvider.java index 6cde07e1..b9b622d3 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/miband/MiBandSampleProvider.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/miband/MiBandSampleProvider.java @@ -4,12 +4,12 @@ import nodomain.freeyourgadget.gadgetbridge.devices.SampleProvider; import nodomain.freeyourgadget.gadgetbridge.model.ActivityKind; public class MiBandSampleProvider implements SampleProvider { - public static final byte TYPE_DEEP_SLEEP = 5; - public static final byte TYPE_LIGHT_SLEEP = 4; - public static final byte TYPE_ACTIVITY = -1; - public static final byte TYPE_UNKNOWN = -1; - public static final byte TYPE_NONWEAR = 3; - public static final byte TYPE_CHARGING = 6; + public static final int TYPE_DEEP_SLEEP = 5; + public static final int TYPE_LIGHT_SLEEP = 4; + public static final int TYPE_ACTIVITY = -1; + public static final int TYPE_UNKNOWN = -1; + public static final int TYPE_NONWEAR = 3; + public static final int TYPE_CHARGING = 6; // public static final byte TYPE_NREM = 5; // DEEP SLEEP // public static final byte TYPE_ONBED = 7; diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/operations/FetchActivityOperation.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/operations/FetchActivityOperation.java index 2b056d9f..6b9b2ca1 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/operations/FetchActivityOperation.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/operations/FetchActivityOperation.java @@ -333,10 +333,10 @@ public class FetchActivityOperation extends AbstractMiBandOperation { samples[minutes] = new GBActivitySample( sampleProvider, timestampInSeconds, - (short) (intensity & 0xff), - (short) (steps & 0xff), - category, - (short) (heartrate & 0xff)); + intensity & 0xff, + steps & 0xff, + category & 0xff, + heartrate & 0xff); // next minute minutes++;