1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-07-16 18:34:03 +02:00

Fix an invalid leftover check for array length

Also removed a method invocation that did not belong there.
This commit is contained in:
cpfeiffer 2016-11-24 22:15:06 +01:00
parent df4293108a
commit 7da328d5db

View File

@ -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);
} }