From 9c2e40ecc0d3dd16fb504fecf21607cb3394f885 Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Sun, 11 Sep 2016 00:12:37 +0200 Subject: [PATCH] Pebble: fix mixup of userId and deviceId in contructor for Misfit and Morpheuz samples --- .../service/devices/pebble/AppMessageHandlerMisfit.java | 2 +- .../service/devices/pebble/AppMessageHandlerMorpheuz.java | 2 +- .../service/devices/pebble/DatalogSessionHealthSteps.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/AppMessageHandlerMisfit.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/AppMessageHandlerMisfit.java index 02183fb8..1bb51991 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/AppMessageHandlerMisfit.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/AppMessageHandlerMisfit.java @@ -83,7 +83,7 @@ public class AppMessageHandlerMisfit extends AppMessageHandler { Long deviceId = DBHelper.getDevice(getDevice(), db.getDaoSession()).getId(); for (int i = 0; i < samples; i++) { short sample = buf.getShort(); - misfitSamples[i] = new PebbleMisfitSample(timestamp + i * 60, userId, deviceId, sample & 0xffff); + misfitSamples[i] = new PebbleMisfitSample(timestamp + i * 60, deviceId, userId, sample & 0xffff); misfitSamples[i].setProvider(sampleProvider); int steps = misfitSamples[i].getSteps(); totalSteps += steps; diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/AppMessageHandlerMorpheuz.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/AppMessageHandlerMorpheuz.java index d6e01890..4f7a14a8 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/AppMessageHandlerMorpheuz.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/AppMessageHandlerMorpheuz.java @@ -114,7 +114,7 @@ public class AppMessageHandlerMorpheuz extends AppMessageHandler { Long userId = DBHelper.getUser(db.getDaoSession()).getId(); Long deviceId = DBHelper.getDevice(getDevice(), db.getDaoSession()).getId(); PebbleMorpheuzSampleProvider sampleProvider = new PebbleMorpheuzSampleProvider(getDevice(), db.getDaoSession()); - PebbleMorpheuzSample sample = new PebbleMorpheuzSample(recording_base_timestamp + index * 600, userId, deviceId, intensity); + PebbleMorpheuzSample sample = new PebbleMorpheuzSample(recording_base_timestamp + index * 600, deviceId, userId, intensity); sample.setProvider(sampleProvider); sampleProvider.addGBActivitySample(sample); } catch (Exception e) { diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/DatalogSessionHealthSteps.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/DatalogSessionHealthSteps.java index 8783c32a..3103dabd 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/DatalogSessionHealthSteps.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/DatalogSessionHealthSteps.java @@ -86,7 +86,7 @@ public class DatalogSessionHealthSteps extends DatalogSessionPebbleHealth { StepsRecord stepsRecord = stepsRecords[j]; samples[j] = new PebbleHealthActivitySample( stepsRecord.timestamp, - userId, deviceId, + deviceId, userId, stepsRecord.getRawData(), stepsRecord.intensity, stepsRecord.steps