mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-12-28 11:35:48 +01:00
Merge pull request 'Made Mi Band activity fetching not crash the application in some rare cases' (#1931) from TaaviE/Gadgetbridge:patch-3 into master
Reviewed-on: https://codeberg.org/Freeyourgadget/Gadgetbridge/pulls/1931
This commit is contained in:
commit
34888e56ba
@ -153,6 +153,14 @@ public class FetchActivityOperation extends AbstractMiBand1Operation {
|
|||||||
|
|
||||||
public FetchActivityOperation(MiBandSupport support) {
|
public FetchActivityOperation(MiBandSupport support) {
|
||||||
super(support);
|
super(support);
|
||||||
|
if (support == null) {
|
||||||
|
LOG.error("MiBandSupport was null");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (support.getDeviceInfo() == null) {
|
||||||
|
LOG.error("MiBandSupport getDeviceInfo returned null");
|
||||||
|
return;
|
||||||
|
}
|
||||||
hasExtendedActivityData = support.getDeviceInfo().supportsHeartrate();
|
hasExtendedActivityData = support.getDeviceInfo().supportsHeartrate();
|
||||||
hasPacketCounter = support.getDeviceInfo().getProfileVersion() >= 0x02000700;
|
hasPacketCounter = support.getDeviceInfo().getProfileVersion() >= 0x02000700;
|
||||||
//temporary buffer, size is a multiple of 60 because we want to store complete minutes (1 minute = 3 or 4 bytes)
|
//temporary buffer, size is a multiple of 60 because we want to store complete minutes (1 minute = 3 or 4 bytes)
|
||||||
|
Loading…
Reference in New Issue
Block a user