From cb66cd742a87fe7bdfa61e665536e3aacbd6eb66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Rebelo?= Date: Wed, 20 Dec 2023 19:09:49 +0000 Subject: [PATCH] Xiaomi: Enable activity sync on debug and nightly builds --- .../freeyourgadget/gadgetbridge/GBApplication.java | 4 ++++ .../gadgetbridge/devices/xiaomi/XiaomiCoordinator.java | 7 +++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/GBApplication.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/GBApplication.java index 496ea4fde..46d7a4428 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/GBApplication.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/GBApplication.java @@ -1562,6 +1562,10 @@ public class GBApplication extends Application { return BuildConfig.APPLICATION_ID.contains("nightly"); } + public static boolean isDebug() { + return BuildConfig.DEBUG; + } + public String getVersion() { try { return getPackageManager().getPackageInfo(getPackageName(), PackageManager.GET_META_DATA).versionName; diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/xiaomi/XiaomiCoordinator.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/xiaomi/XiaomiCoordinator.java index 5ffea8ea8..66f87d3dd 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/xiaomi/XiaomiCoordinator.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/xiaomi/XiaomiCoordinator.java @@ -34,7 +34,6 @@ import java.util.List; import java.util.UUID; import java.util.regex.Pattern; -import nodomain.freeyourgadget.gadgetbridge.BuildConfig; import nodomain.freeyourgadget.gadgetbridge.GBApplication; import nodomain.freeyourgadget.gadgetbridge.GBException; import nodomain.freeyourgadget.gadgetbridge.R; @@ -226,19 +225,19 @@ public abstract class XiaomiCoordinator extends AbstractBLEDeviceCoordinator { @Override public boolean supportsActivityDataFetching() { // TODO It does, but not yet fully working - only in Mi Band 8 - return false; + return GBApplication.isDebug() || GBApplication.isNightly(); } @Override public boolean supportsActivityTracking() { // TODO It does, but not yet fully working - only in Mi Band 8 - return false; + return GBApplication.isDebug() || GBApplication.isNightly(); } @Override public boolean supportsActivityTracks() { // TODO It does, but not yet fully working - only in Mi Band 8 - return false; + return GBApplication.isDebug() || GBApplication.isNightly(); } @Override