diff --git a/app/build.gradle b/app/build.gradle index 6fb66a594..92bd2c669 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -293,7 +293,7 @@ dependencies { implementation 'com.android.volley:volley:1.2.1' // Bouncy Castle is included directly in GB, to avoid pulling the entire dependency - // it's included in the org.bouncycastle.shaded package, to prevent conflicts with + // It's included in the org.bouncycastle.shaded package, to fix conflicts with // roboelectric //implementation 'org.bouncycastle:bcpkix-jdk18on:1.76' //implementation 'org.bouncycastle:bcprov-jdk18on:1.76' 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 0060f251d..6d68ce2fc 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 @@ -31,6 +31,7 @@ import java.util.Arrays; import java.util.Collection; import java.util.List; +import nodomain.freeyourgadget.gadgetbridge.BuildConfig; import nodomain.freeyourgadget.gadgetbridge.GBException; import nodomain.freeyourgadget.gadgetbridge.R; import nodomain.freeyourgadget.gadgetbridge.activities.appmanager.AppManagerActivity; @@ -205,7 +206,8 @@ public abstract class XiaomiCoordinator extends AbstractBLEDeviceCoordinator { @Override public boolean supportsActivityTracks() { - return true; + // TODO It does, but not yet fully working + return BuildConfig.DEBUG; } @Override @@ -215,13 +217,14 @@ public abstract class XiaomiCoordinator extends AbstractBLEDeviceCoordinator { @Override public boolean supportsSpo2() { - return true; + // TODO it does, but not yet implemented, so let's not crash + return false; } @Override public boolean supportsHeartRateStats() { // TODO does it? - return true; + return false; } @Override @@ -233,12 +236,11 @@ public abstract class XiaomiCoordinator extends AbstractBLEDeviceCoordinator { @Override public boolean supportsSleepRespiratoryRate() { // TODO does it? - return true; + return false; } @Override public boolean supportsAlarmSnoozing() { - // TODO does it? return false; } @@ -267,8 +269,8 @@ public abstract class XiaomiCoordinator extends AbstractBLEDeviceCoordinator { @Override public int getWorldClocksSlotCount() { - // TODO how many? - return 5; + // TODO how many? also, map world clocks + return 0; } @Override @@ -291,7 +293,6 @@ public abstract class XiaomiCoordinator extends AbstractBLEDeviceCoordinator { @Override public boolean supportsManualHeartRateMeasurement(final GBDevice device) { - // TODO orchestrate return true; } @@ -302,7 +303,6 @@ public abstract class XiaomiCoordinator extends AbstractBLEDeviceCoordinator { @Override public boolean supportsRealtimeData() { - // TODO supports steps? return true; } @@ -461,13 +461,13 @@ public abstract class XiaomiCoordinator extends AbstractBLEDeviceCoordinator { @Override public boolean supportsNotificationVibrationPatterns() { - // TODO maybe can used this + // TODO maybe can use this return true; } @Override public boolean supportsNotificationVibrationRepetitionPatterns() { - // TODO maybe can used this + // TODO maybe can use this return true; } @@ -478,13 +478,13 @@ public abstract class XiaomiCoordinator extends AbstractBLEDeviceCoordinator { @Override public AbstractNotificationPattern[] getNotificationVibrationPatterns() { - // TODO maybe can used this + // TODO maybe can use this return new AbstractNotificationPattern[0]; } @Override public AbstractNotificationPattern[] getNotificationVibrationRepetitionPatterns() { - // TODO maybe can used this + // TODO maybe can use this return new AbstractNotificationPattern[0]; } diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/NotificationListener.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/NotificationListener.java index 33a352a3a..fd794c1f8 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/NotificationListener.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/NotificationListener.java @@ -786,7 +786,7 @@ public class NotificationListener extends NotificationListenerService { notificationsActive.removeAll(notificationsToRemove); // TODO prevent this from being called multiple times for the same ID - // TODO prevent thins from being called form notifications removed from the device + // TODO prevent this from being called form notifications removed from the device // Send notification remove request to device List devices = GBApplication.app().getDeviceManager().getDevices(); diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/DeviceSupportFactory.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/DeviceSupportFactory.java index 32d01343b..d6edb830b 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/DeviceSupportFactory.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/DeviceSupportFactory.java @@ -22,7 +22,6 @@ along with this program. If not, see . */ package nodomain.freeyourgadget.gadgetbridge.service; -import android.app.Service; import android.bluetooth.BluetoothAdapter; import android.content.Context; import android.util.Log; diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/xiaomi/XiaomiSupport.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/xiaomi/XiaomiSupport.java index 3cc33e6a9..bbb1bdec9 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/xiaomi/XiaomiSupport.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/xiaomi/XiaomiSupport.java @@ -378,15 +378,9 @@ public abstract class XiaomiSupport extends AbstractBTLEDeviceSupport { healthService.enableRealtimeStats(enable); } - @Override - public void onScreenshotReq() { - // TODO - super.onScreenshotReq(); - } - @Override public void onEnableHeartRateSleepSupport(final boolean enable) { - // TODO + // TODO onEnableHeartRateSleepSupport super.onEnableHeartRateSleepSupport(enable); } diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/xiaomi/activity/impl/SleepDetailsParser.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/xiaomi/activity/impl/SleepDetailsParser.java index 21748faa9..2164a69b3 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/xiaomi/activity/impl/SleepDetailsParser.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/xiaomi/activity/impl/SleepDetailsParser.java @@ -44,6 +44,7 @@ public class SleepDetailsParser extends XiaomiActivityParser { final int wakeupTime = buf.getInt(); LOG.info("Bed time: {}, wake up time: {}", bedTime, wakeupTime); + // TODO save timestamps and overlay on activity // TODO everything else... return false; diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/xiaomi/services/AbstractXiaomiService.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/xiaomi/services/AbstractXiaomiService.java index 02738de0e..044dd9563 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/xiaomi/services/AbstractXiaomiService.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/xiaomi/services/AbstractXiaomiService.java @@ -21,7 +21,6 @@ import android.content.Context; import nodomain.freeyourgadget.gadgetbridge.GBApplication; import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.XiaomiCoordinator; import nodomain.freeyourgadget.gadgetbridge.proto.xiaomi.XiaomiProto; -import nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder; import nodomain.freeyourgadget.gadgetbridge.service.devices.xiaomi.XiaomiSupport; import nodomain.freeyourgadget.gadgetbridge.util.Prefs; diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/xiaomi/services/XiaomiCalendarService.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/xiaomi/services/XiaomiCalendarService.java index 7082847c7..482467708 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/xiaomi/services/XiaomiCalendarService.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/xiaomi/services/XiaomiCalendarService.java @@ -29,7 +29,6 @@ import nodomain.freeyourgadget.gadgetbridge.GBApplication; import nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst; import nodomain.freeyourgadget.gadgetbridge.model.CalendarEventSpec; import nodomain.freeyourgadget.gadgetbridge.proto.xiaomi.XiaomiProto; -import nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder; import nodomain.freeyourgadget.gadgetbridge.service.devices.xiaomi.XiaomiSupport; import nodomain.freeyourgadget.gadgetbridge.util.Prefs; import nodomain.freeyourgadget.gadgetbridge.util.StringUtils; diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/xiaomi/services/XiaomiHealthService.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/xiaomi/services/XiaomiHealthService.java index 5f8bd59d6..a28d9c13b 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/xiaomi/services/XiaomiHealthService.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/xiaomi/services/XiaomiHealthService.java @@ -18,7 +18,6 @@ package nodomain.freeyourgadget.gadgetbridge.service.devices.xiaomi.services; import android.content.Intent; import android.location.Location; -import android.os.Build; import android.os.Handler; import androidx.localbroadcastmanager.content.LocalBroadcastManager; diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/xiaomi/services/XiaomiNotificationService.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/xiaomi/services/XiaomiNotificationService.java index 614dc5515..b0315c133 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/xiaomi/services/XiaomiNotificationService.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/xiaomi/services/XiaomiNotificationService.java @@ -114,8 +114,6 @@ public class XiaomiNotificationService extends AbstractXiaomiService implements LOG.warn("Unhandled notification command {}", cmd.getSubtype()); } - - public void onNotification(final NotificationSpec notificationSpec) { final XiaomiProto.Notification3.Builder notification3 = XiaomiProto.Notification3.newBuilder() .setId(notificationSpec.getId()) @@ -179,7 +177,6 @@ public class XiaomiNotificationService extends AbstractXiaomiService implements } public void onSetCallState(final CallSpec callSpec) { - // TODO handle callSpec.command if (callSpec.command == CallSpec.CALL_OUTGOING) { return; } diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/xiaomi/services/XiaomiSystemService.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/xiaomi/services/XiaomiSystemService.java index 7d3d3d14d..95028909e 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/xiaomi/services/XiaomiSystemService.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/xiaomi/services/XiaomiSystemService.java @@ -89,7 +89,6 @@ public class XiaomiSystemService extends AbstractXiaomiService implements Xiaomi @Override public void handleCommand(final XiaomiProto.Command cmd) { - // TODO switch (cmd.getSubtype()) { case CMD_DEVICE_INFO: handleDeviceInfo(cmd.getSystem().getDeviceInfo()); @@ -476,10 +475,6 @@ public class XiaomiSystemService extends AbstractXiaomiService implements Xiaomi unsetDeviceBusy(); - if (success) { - // TODO do we need to reboot? - } - fwHelper = null; } @@ -499,6 +494,7 @@ public class XiaomiSystemService extends AbstractXiaomiService implements Xiaomi } } + // TODO do we even need this? also prevent NPE when unknown private static final Map DISPLAY_ITEM_NAMES = new HashMap() {{ put("today_act", "Stats"); put("sport", "Workout"); diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/xiaomi/services/XiaomiWatchfaceService.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/xiaomi/services/XiaomiWatchfaceService.java index c2abbf3fd..28cc84e16 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/xiaomi/services/XiaomiWatchfaceService.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/xiaomi/services/XiaomiWatchfaceService.java @@ -59,11 +59,9 @@ public class XiaomiWatchfaceService extends AbstractXiaomiService implements Xia @Override public void handleCommand(final XiaomiProto.Command cmd) { - // TODO switch (cmd.getSubtype()) { case CMD_WATCHFACE_LIST: handleWatchfaceList(cmd.getWatchface().getWatchfaceList()); - // TODO handle return; case CMD_WATCHFACE_SET: LOG.debug("Got watchface set response, ack={}", cmd.getWatchface().getAck()); diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/xiaomi/services/XiaomiWeatherService.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/xiaomi/services/XiaomiWeatherService.java index b51d7e480..048cee6f7 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/xiaomi/services/XiaomiWeatherService.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/xiaomi/services/XiaomiWeatherService.java @@ -206,6 +206,5 @@ public class XiaomiWeatherService extends AbstractXiaomiService { .format(new Date(timestamp * 1000L))) .insert(22, ':') // FIXME: I bet this fails for some, but all this java date craps sucks .toString(); - } -} \ No newline at end of file +} diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 299ebda9b..9550da72b 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -2394,7 +2394,6 @@ Select whether device uses Celsius or Fahrenheit scale. Celsius Fahrenheit - Navigation app not installed on watch Navigation started but navigationApp not installed on watch. Please install it from the App Manager. Reject