Search in sources :

Example 1 with HuamiFirmwareType

use of nodomain.freeyourgadget.gadgetbridge.service.devices.huami.HuamiFirmwareType in project Gadgetbridge by Freeyourgadget.

the class MiBand2FWInstallHandler method maybeAddFontHint.

private void maybeAddFontHint(InstallActivity installActivity) {
    HuamiFirmwareType type = getFirmwareType();
    if (type == HuamiFirmwareType.FIRMWARE) {
        String newInfoText = installActivity.getInfoText() + "\n\n" + "Note: you may install Mili_pro.ft or Mili_pro.ft.en to enable text notifications.";
        installActivity.setInfoText(newInfoText);
    }
}
Also used : HuamiFirmwareType(nodomain.freeyourgadget.gadgetbridge.service.devices.huami.HuamiFirmwareType)

Example 2 with HuamiFirmwareType

use of nodomain.freeyourgadget.gadgetbridge.service.devices.huami.HuamiFirmwareType in project Gadgetbridge by Freeyourgadget.

the class MiBand2FWInstallHandler method maybeAddFw53Hint.

private void maybeAddFw53Hint(InstallActivity installActivity, GBDevice device) {
    HuamiFirmwareType type = getFirmwareType();
    if (type != HuamiFirmwareType.FIRMWARE) {
        return;
    }
    Version deviceVersion = getFirmwareVersionOf(device);
    if (deviceVersion != null) {
        Version v53 = MiBandConst.MI2_FW_VERSION_INTERMEDIATE_UPGRADE_53;
        if (deviceVersion.compareTo(v53) < 0) {
            String vInstall = getHelper().format(getHelper().getFirmwareVersion());
            try {
                if (vInstall == null || new Version(vInstall).compareTo(v53) > 0) {
                    String newInfoText = getContext().getString(R.string.mi2_fw_installhandler_fw53_hint, v53.get()) + "\n\n" + installActivity.getInfoText();
                    installActivity.setInfoText(newInfoText);
                }
            } catch (IllegalArgumentException e) {
                String newInfoText = getContext().getString(R.string.mi2_fw_installhandler_fw53_hint, v53.get()) + "\n\n" + installActivity.getInfoText() + "\n\n" + getContext().getString(R.string.error_version_check_extreme_caution, vInstall);
                installActivity.setInfoText(newInfoText);
            }
        }
    }
}
Also used : HuamiFirmwareType(nodomain.freeyourgadget.gadgetbridge.service.devices.huami.HuamiFirmwareType) Version(nodomain.freeyourgadget.gadgetbridge.util.Version)

Aggregations

HuamiFirmwareType (nodomain.freeyourgadget.gadgetbridge.service.devices.huami.HuamiFirmwareType)2 Version (nodomain.freeyourgadget.gadgetbridge.util.Version)1