Fix an invalid leftover check for array length

Also removed a method invocation that did not belong there.
here
cpfeiffer 2016-11-24 22:15:06 +01:00
parent df4293108a
commit 7da328d5db
1 changed files with 1 additions and 2 deletions

View File

@ -173,7 +173,7 @@ public class FetchActivityOperation extends AbstractMiBand2Operation {
return;
}
if (value.length == 17) {
if ((value.length % 4) == 1) {
if ((byte) (lastPacketCounter + 1) == value[0] ) {
lastPacketCounter++;
bufferActivityData(value);
@ -182,7 +182,6 @@ public class FetchActivityOperation extends AbstractMiBand2Operation {
handleActivityFetchFinish();
return;
}
handleActivityMetadata(value);
} else {
GB.toast("Error fetching activity data, unexpected package length: " + value.length, Toast.LENGTH_LONG, GB.ERROR);
}