mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-25 03:16:51 +01:00
Delegated error handling properly to the function that creates FetchActivityOperation
This commit is contained in:
parent
bcac8e0d7f
commit
3ad1412a1d
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user