From bd60624ba5de9c26cee929b9d7c24f3716ef430c Mon Sep 17 00:00:00 2001 From: mamutcho Date: Sat, 25 Apr 2020 01:25:28 +0300 Subject: [PATCH] * WatchX(Plus) - Fix unexpected bug in Activity Analysis --- .../watchxplus/WatchXPlusSampleProvider.java | 32 ++++++++----------- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/lenovo/watchxplus/WatchXPlusSampleProvider.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/lenovo/watchxplus/WatchXPlusSampleProvider.java index f6b6df6ea..da3a268ad 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/lenovo/watchxplus/WatchXPlusSampleProvider.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/lenovo/watchxplus/WatchXPlusSampleProvider.java @@ -95,6 +95,9 @@ public class WatchXPlusSampleProvider extends AbstractSampleProvider samples = getGBActivitySamples(timestamp_from, timestamp_to, ActivityKind.TYPE_ALL); int numEntries = samples.size(); + if (numEntries < 2) { + return getGBActivitySamples(timestamp_from, timestamp_to, ActivityKind.TYPE_ALL); + } // LOG.info(" testing: ts_from:" + timestamp_from + " ts_to: " + timestamp_to); @@ -154,8 +157,6 @@ public class WatchXPlusSampleProvider extends AbstractSampleProvider sleepStopIndex_1)) { - samples.get(i).setRawIntensity(500); + samples.get(i).setRawIntensity(600); resultList.add(samples.get(i)); } } + // add remaining activity if (newSleepStopIndex_1 < next_block) { for (int i = newSleepStopIndex_1; i < (next_block-1); i++) { @@ -337,24 +339,18 @@ public class WatchXPlusSampleProvider extends AbstractSampleProvider sleepStopIndex_2)) { - samples.get(i).setRawIntensity(500); + samples.get(i).setRawIntensity(600); resultList.add(samples.get(i)); } }