mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-12-02 23:12:57 +01:00
fixed button overwrite for commuter
This commit is contained in:
parent
c99a3c91b5
commit
e2a573e3e2
@ -385,6 +385,7 @@ public class QHybridSupport extends QHybridBaseSupport {
|
|||||||
switch (uploadFileRequest.state){
|
switch (uploadFileRequest.state){
|
||||||
case ERROR:
|
case ERROR:
|
||||||
buttonOverwriteListener.OnButtonOverwrite(false);
|
buttonOverwriteListener.OnButtonOverwrite(false);
|
||||||
|
uploadFileRequest = null;
|
||||||
break;
|
break;
|
||||||
case UPLOAD:
|
case UPLOAD:
|
||||||
for(byte[] packet : this.uploadFileRequest.packets){
|
for(byte[] packet : this.uploadFileRequest.packets){
|
||||||
|
@ -18,12 +18,12 @@ public class UploadFileRequest extends Request {
|
|||||||
public ArrayList<byte[]> packets = new ArrayList<>();
|
public ArrayList<byte[]> packets = new ArrayList<>();
|
||||||
|
|
||||||
public UploadFileRequest(short handle, byte[] file) {
|
public UploadFileRequest(short handle, byte[] file) {
|
||||||
int fileLength = file.length;
|
int fileLength = file.length + 4;
|
||||||
ByteBuffer buffer = this.createBuffer();
|
ByteBuffer buffer = this.createBuffer();
|
||||||
buffer.putShort(1, handle);
|
buffer.putShort(1, handle);
|
||||||
buffer.putInt(3, 0);
|
buffer.putInt(3, 0);
|
||||||
buffer.putInt(7, fileLength - 10);
|
buffer.putInt(7, fileLength);
|
||||||
buffer.putInt(11, fileLength - 10);
|
buffer.putInt(11, fileLength);
|
||||||
|
|
||||||
this.data = buffer.array();
|
this.data = buffer.array();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user