mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-28 21:06:50 +01:00
Localized some firmware update texts and added some toasts on finish
This commit is contained in:
parent
41d8bcf634
commit
50960277dd
@ -93,7 +93,7 @@ public class UpdateFirmwareOperation extends AbstractBTLEOperation<MiBandSupport
|
|||||||
rebootWhenBandReady = true;
|
rebootWhenBandReady = true;
|
||||||
} else {
|
} else {
|
||||||
//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(getContext().getString(R.string.updatefirmwareoperation_updateproblem_do_not_reboot), Toast.LENGTH_LONG, GB.ERROR);
|
||||||
done();
|
done();
|
||||||
}
|
}
|
||||||
firmwareInfoSent = false;
|
firmwareInfoSent = false;
|
||||||
@ -101,23 +101,24 @@ public class UpdateFirmwareOperation extends AbstractBTLEOperation<MiBandSupport
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MiBandService.NOTIFY_FW_CHECK_FAILED:
|
case MiBandService.NOTIFY_FW_CHECK_FAILED:
|
||||||
GB.toast("Problem with the firmware metadata transfer", Toast.LENGTH_LONG, GB.ERROR);
|
GB.toast(getContext().getString(R.string.updatefirmwareoperation_metadata_updateproblem), Toast.LENGTH_LONG, GB.ERROR);
|
||||||
firmwareInfoSent = false;
|
firmwareInfoSent = false;
|
||||||
newFirmware = null;
|
newFirmware = null;
|
||||||
done();
|
done();
|
||||||
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());
|
GB.toast(getContext(), getContext().getString(R.string.updatefirmwareoperation_update_complete_rebooting), Toast.LENGTH_LONG, GB.INFO);
|
||||||
|
GB.updateInstallNotification(getContext().getString(R.string.updatefirmwareoperation_update_complete), false, 100, getContext());
|
||||||
getSupport().onReboot();
|
getSupport().onReboot();
|
||||||
|
rebootWhenBandReady = false;
|
||||||
}
|
}
|
||||||
rebootWhenBandReady = false;
|
|
||||||
done();
|
done();
|
||||||
break;
|
break;
|
||||||
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(getContext().getString(R.string.updatefirmwareoperation_updateproblem_do_not_reboot), Toast.LENGTH_LONG, GB.ERROR);
|
||||||
GB.updateInstallNotification("Firmware write failed", false, 0, getContext());
|
GB.updateInstallNotification(getContext().getString(R.string.updatefirmwareoperation_write_failed), false, 0, getContext());
|
||||||
rebootWhenBandReady = false;
|
rebootWhenBandReady = false;
|
||||||
done();
|
done();
|
||||||
break;
|
break;
|
||||||
|
@ -179,4 +179,9 @@
|
|||||||
<string name="pbwinstallhandler_correct_hw_revision">Correct hardware revision</string>
|
<string name="pbwinstallhandler_correct_hw_revision">Correct hardware revision</string>
|
||||||
<string name="pbwinstallhandler_incorrect_hw_revision">Hardware revision mismatch!</string>
|
<string name="pbwinstallhandler_incorrect_hw_revision">Hardware revision mismatch!</string>
|
||||||
<string name="pbwinstallhandler_app_item">%1$s (%2$s)</string>
|
<string name="pbwinstallhandler_app_item">%1$s (%2$s)</string>
|
||||||
|
<string name="updatefirmwareoperation_updateproblem_do_not_reboot">Problem with the firmware transfer. DO NOT REBOOT your Mi Band!</string>
|
||||||
|
<string name="updatefirmwareoperation_metadata_updateproblem">Problem with the firmware metadata transfer</string>
|
||||||
|
<string name="updatefirmwareoperation_update_complete">Firmware installation complete</string>
|
||||||
|
<string name="updatefirmwareoperation_update_complete_rebooting">Firmware installation complete, rebooting device…</string>
|
||||||
|
<string name="updatefirmwareoperation_write_failed">Firmware write failed</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
Loading…
Reference in New Issue
Block a user