1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-28 12:56:49 +01:00

Fix ordering problem with firmwareInfoSent state variable #234

This commit is contained in:
cpfeiffer 2016-03-30 21:56:00 +02:00
parent cc7f5406ef
commit ffc006c21c

View File

@ -323,8 +323,8 @@ public class UpdateFirmwareOperation extends AbstractMiBandOperation {
TransactionBuilder builder = performInitialized("send firmware info");
getSupport().setLowLatency(builder);
builder.add(new SetDeviceBusyAction(getDevice(), getContext().getString(R.string.updating_firmware), getContext()));
builder.add(new FirmwareInfoSentAction()); // Note: *before* actually sending the info, otherwise it's too late!
builder.write(getCharacteristic(MiBandService.UUID_CHARACTERISTIC_CONTROL_POINT), getFirmwareInfo());
builder.add(new FirmwareInfoSucceededAction());
builder.queue(getQueue());
return true;
} catch (IOException e) {
@ -440,7 +440,7 @@ public class UpdateFirmwareOperation extends AbstractMiBandOperation {
}
}
private class FirmwareInfoSucceededAction extends PlainAction {
private class FirmwareInfoSentAction extends PlainAction {
@Override
public boolean run(BluetoothGatt gatt) {
if (isOperationRunning()) {