mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-08-25 00:30:37 +02:00
Pebble: Speed up app/firmware installation by sending 2000 bytes at once instead of 512. Closes #22.
This commit is contained in:
parent
29d4f7d615
commit
2eb62ebff3
@ -146,9 +146,14 @@ public class PebbleIoThread extends GBDeviceIoThread {
|
||||
}
|
||||
break;
|
||||
case APP_UPLOAD_CHUNK:
|
||||
int bytes = mZis.read(buffer);
|
||||
int bytes = 0;
|
||||
do {
|
||||
int read = mZis.read(buffer, bytes, 2000 - bytes);
|
||||
if (read <= 0) break;
|
||||
bytes += read;
|
||||
} while (bytes < 2000);
|
||||
|
||||
if (bytes != -1) {
|
||||
if (bytes > 0) {
|
||||
writeInstallApp(mPebbleProtocol.encodeUploadChunk(mAppInstallToken, buffer, bytes));
|
||||
mAppInstallToken = -1;
|
||||
mInstallState = PebbleAppInstallState.APP_WAIT_TOKEN;
|
||||
|
Loading…
Reference in New Issue
Block a user