1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-08 11:17:05 +01:00

fixed button overwrite for commuter

This commit is contained in:
dakhnod 2019-07-20 16:03:31 +02:00
parent c99a3c91b5
commit e2a573e3e2
2 changed files with 4 additions and 3 deletions

View File

@ -385,6 +385,7 @@ public class QHybridSupport extends QHybridBaseSupport {
switch (uploadFileRequest.state){
case ERROR:
buttonOverwriteListener.OnButtonOverwrite(false);
uploadFileRequest = null;
break;
case UPLOAD:
for(byte[] packet : this.uploadFileRequest.packets){

View File

@ -18,12 +18,12 @@ public class UploadFileRequest extends Request {
public ArrayList<byte[]> packets = new ArrayList<>();
public UploadFileRequest(short handle, byte[] file) {
int fileLength = file.length;
int fileLength = file.length + 4;
ByteBuffer buffer = this.createBuffer();
buffer.putShort(1, handle);
buffer.putInt(3, 0);
buffer.putInt(7, fileLength - 10);
buffer.putInt(11, fileLength - 10);
buffer.putInt(7, fileLength);
buffer.putInt(11, fileLength);
this.data = buffer.array();