Fix an invalid leftover check for array length
Also removed a method invocation that did not belong there.
This commit is contained in:
parent
df4293108a
commit
7da328d5db
|
@ -173,7 +173,7 @@ public class FetchActivityOperation extends AbstractMiBand2Operation {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (value.length == 17) {
|
if ((value.length % 4) == 1) {
|
||||||
if ((byte) (lastPacketCounter + 1) == value[0] ) {
|
if ((byte) (lastPacketCounter + 1) == value[0] ) {
|
||||||
lastPacketCounter++;
|
lastPacketCounter++;
|
||||||
bufferActivityData(value);
|
bufferActivityData(value);
|
||||||
|
@ -182,7 +182,6 @@ public class FetchActivityOperation extends AbstractMiBand2Operation {
|
||||||
handleActivityFetchFinish();
|
handleActivityFetchFinish();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
handleActivityMetadata(value);
|
|
||||||
} else {
|
} else {
|
||||||
GB.toast("Error fetching activity data, unexpected package length: " + value.length, Toast.LENGTH_LONG, GB.ERROR);
|
GB.toast("Error fetching activity data, unexpected package length: " + value.length, Toast.LENGTH_LONG, GB.ERROR);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue