1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-24 19:06:53 +01:00

Delegated error handling properly to the function that creates FetchActivityOperation

This commit is contained in:
TaaviE 2020-07-28 04:03:34 +03:00 committed by Gitea
parent bcac8e0d7f
commit 3ad1412a1d

View File

@ -151,15 +151,13 @@ public class FetchActivityOperation extends AbstractMiBand1Operation {
private ActivityStruct activityStruct;
public FetchActivityOperation(MiBandSupport support) {
public FetchActivityOperation(MiBandSupport support) throws IOException {
super(support);
if (support == null) {
LOG.error("MiBandSupport was null");
return;
throw new IOException("MiBandSupport was null");
}
if (support.getDeviceInfo() == null) {
LOG.error("MiBandSupport getDeviceInfo returned null");
return;
throw new IOException("MiBandSupport getDeviceInfo returned null");
}
hasExtendedActivityData = support.getDeviceInfo().supportsHeartrate();
hasPacketCounter = support.getDeviceInfo().getProfileVersion() >= 0x02000700;