From 8f5bbec88124398e21441bd933bd9fbb80992ce4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Rebelo?= Date: Thu, 15 Jun 2023 22:07:08 +0100 Subject: [PATCH] Zepp OS: Only cache apps and watchfaces --- .../huami/AbstractHuami2021FWInstallHandler.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/AbstractHuami2021FWInstallHandler.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/AbstractHuami2021FWInstallHandler.java index 45e69a3b6..83669b99d 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/AbstractHuami2021FWInstallHandler.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/AbstractHuami2021FWInstallHandler.java @@ -50,10 +50,13 @@ public abstract class AbstractHuami2021FWInstallHandler extends AbstractMiBandFW @Override public void onStartInstall(final GBDevice device) { final AbstractHuamiFirmwareInfo firmwareInfo = getHelper().getFirmwareInfo(); - if (firmwareInfo instanceof Huami2021FirmwareInfo) { - saveToCache((Huami2021FirmwareInfo) firmwareInfo, device); - } else { - LOG.warn("firmwareInfo is {} - this should never happen", firmwareInfo.getClass()); + final boolean shouldCache = firmwareInfo.getFirmwareType().isApp() || firmwareInfo.getFirmwareType().isWatchface(); + if (shouldCache) { + if (firmwareInfo instanceof Huami2021FirmwareInfo) { + saveToCache((Huami2021FirmwareInfo) firmwareInfo, device); + } else { + LOG.warn("firmwareInfo is {} - this should never happen", firmwareInfo.getClass()); + } } // Unset the firmware bytes