Update the firmware-update notification based on the feedback we get from the band.
This commit is contained in:
parent
2208d5088b
commit
5b3510fade
|
@ -681,6 +681,7 @@ public class MiBandSupport extends AbstractBTLEDeviceSupport {
|
||||||
break;
|
break;
|
||||||
case MiBandService.NOTIFY_FIRMWARE_UPDATE_SUCCESS:
|
case MiBandService.NOTIFY_FIRMWARE_UPDATE_SUCCESS:
|
||||||
if (rebootWhenBandReady) {
|
if (rebootWhenBandReady) {
|
||||||
|
GB.updateInstallNotification("Firmware installation complete", false, 100, getContext());
|
||||||
onReboot();
|
onReboot();
|
||||||
}
|
}
|
||||||
rebootWhenBandReady = false;
|
rebootWhenBandReady = false;
|
||||||
|
@ -688,6 +689,7 @@ public class MiBandSupport extends AbstractBTLEDeviceSupport {
|
||||||
case MiBandService.NOTIFY_FIRMWARE_UPDATE_FAILED:
|
case MiBandService.NOTIFY_FIRMWARE_UPDATE_FAILED:
|
||||||
//TODO: the firmware transfer failed, but the miband should be still functional with the old firmware. What should we do?
|
//TODO: the firmware transfer failed, but the miband should be still functional with the old firmware. What should we do?
|
||||||
GB.toast("Problem with the firmware transfer. DO NOT REBOOT YOUR MIBAND!!!", Toast.LENGTH_LONG, GB.ERROR);
|
GB.toast("Problem with the firmware transfer. DO NOT REBOOT YOUR MIBAND!!!", Toast.LENGTH_LONG, GB.ERROR);
|
||||||
|
GB.updateInstallNotification("Firmware write failed", false, 0, getContext());
|
||||||
rebootWhenBandReady = false;
|
rebootWhenBandReady = false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -998,7 +1000,6 @@ public class MiBandSupport extends AbstractBTLEDeviceSupport {
|
||||||
LOG.info("Firmware update progress:" + firmwareProgress + " total len:" + len + " progress:" + (firmwareProgress / len));
|
LOG.info("Firmware update progress:" + firmwareProgress + " total len:" + len + " progress:" + (firmwareProgress / len));
|
||||||
if (firmwareProgress >= len) {
|
if (firmwareProgress >= len) {
|
||||||
builder.write(getCharacteristic(MiBandService.UUID_CHARACTERISTIC_CONTROL_POINT), new byte[]{MiBandService.COMMAND_SYNC});
|
builder.write(getCharacteristic(MiBandService.UUID_CHARACTERISTIC_CONTROL_POINT), new byte[]{MiBandService.COMMAND_SYNC});
|
||||||
builder.add(new SetProgressAction("Firmware installation complete", false, 100, getContext()));
|
|
||||||
} else {
|
} else {
|
||||||
GB.updateInstallNotification("Firmware write failed", false, 0, getContext());
|
GB.updateInstallNotification("Firmware write failed", false, 0, getContext());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue