1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-03 15:32:54 +01:00

Zepp OS: Only cache apps and watchfaces

This commit is contained in:
José Rebelo 2023-06-15 22:07:08 +01:00
parent fad7fa395b
commit 8f5bbec881

View File

@ -50,10 +50,13 @@ public abstract class AbstractHuami2021FWInstallHandler extends AbstractMiBandFW
@Override @Override
public void onStartInstall(final GBDevice device) { public void onStartInstall(final GBDevice device) {
final AbstractHuamiFirmwareInfo firmwareInfo = getHelper().getFirmwareInfo(); final AbstractHuamiFirmwareInfo firmwareInfo = getHelper().getFirmwareInfo();
if (firmwareInfo instanceof Huami2021FirmwareInfo) { final boolean shouldCache = firmwareInfo.getFirmwareType().isApp() || firmwareInfo.getFirmwareType().isWatchface();
saveToCache((Huami2021FirmwareInfo) firmwareInfo, device); if (shouldCache) {
} else { if (firmwareInfo instanceof Huami2021FirmwareInfo) {
LOG.warn("firmwareInfo is {} - this should never happen", firmwareInfo.getClass()); saveToCache((Huami2021FirmwareInfo) firmwareInfo, device);
} else {
LOG.warn("firmwareInfo is {} - this should never happen", firmwareInfo.getClass());
}
} }
// Unset the firmware bytes // Unset the firmware bytes