mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2026-07-31 07:44:24 +02:00
Delegated error handling properly to the function that creates FetchActivityOperation
This commit is contained in:
+3
-5
@@ -151,15 +151,13 @@ public class FetchActivityOperation extends AbstractMiBand1Operation {
|
|||||||
|
|
||||||
private ActivityStruct activityStruct;
|
private ActivityStruct activityStruct;
|
||||||
|
|
||||||
public FetchActivityOperation(MiBandSupport support) {
|
public FetchActivityOperation(MiBandSupport support) throws IOException {
|
||||||
super(support);
|
super(support);
|
||||||
if (support == null) {
|
if (support == null) {
|
||||||
LOG.error("MiBandSupport was null");
|
throw new IOException("MiBandSupport was null");
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
if (support.getDeviceInfo() == null) {
|
if (support.getDeviceInfo() == null) {
|
||||||
LOG.error("MiBandSupport getDeviceInfo returned null");
|
throw new IOException("MiBandSupport getDeviceInfo returned null");
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
hasExtendedActivityData = support.getDeviceInfo().supportsHeartrate();
|
hasExtendedActivityData = support.getDeviceInfo().supportsHeartrate();
|
||||||
hasPacketCounter = support.getDeviceInfo().getProfileVersion() >= 0x02000700;
|
hasPacketCounter = support.getDeviceInfo().getProfileVersion() >= 0x02000700;
|
||||||
|
|||||||
Reference in New Issue
Block a user