From 011646b097166fead9df57d38465c769621e0a74 Mon Sep 17 00:00:00 2001 From: cpfeiffer Date: Tue, 29 Nov 2016 22:22:54 +0100 Subject: [PATCH] Fix activity data on Mi Band 1 #440 --- .../gadgetbridge/devices/miband/MiBand2Coordinator.java | 8 ++++++++ .../gadgetbridge/devices/miband/MiBandCoordinator.java | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/miband/MiBand2Coordinator.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/miband/MiBand2Coordinator.java index 12c945e05..5d40bfc18 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/miband/MiBand2Coordinator.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/miband/MiBand2Coordinator.java @@ -18,6 +18,9 @@ import java.util.Collections; import nodomain.freeyourgadget.gadgetbridge.GBApplication; import nodomain.freeyourgadget.gadgetbridge.R; import nodomain.freeyourgadget.gadgetbridge.devices.InstallHandler; +import nodomain.freeyourgadget.gadgetbridge.devices.SampleProvider; +import nodomain.freeyourgadget.gadgetbridge.entities.AbstractActivitySample; +import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession; import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice; import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate; import nodomain.freeyourgadget.gadgetbridge.model.DeviceType; @@ -78,6 +81,11 @@ public class MiBand2Coordinator extends MiBandCoordinator { return true; } + @Override + public SampleProvider getSampleProvider(GBDevice device, DaoSession session) { + return new MiBand2SampleProvider(device, session); + } + @Override public InstallHandler findInstallHandler(Uri uri, Context context) { return null; // not supported at the moment diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/miband/MiBandCoordinator.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/miband/MiBandCoordinator.java index 3597706cf..abff3bc15 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/miband/MiBandCoordinator.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/miband/MiBandCoordinator.java @@ -100,7 +100,7 @@ public class MiBandCoordinator extends AbstractDeviceCoordinator { @Override public SampleProvider getSampleProvider(GBDevice device, DaoSession session) { - return new MiBand2SampleProvider(device, session); + return new MiBandSampleProvider(device, session); } @Override