diff --git a/services/updater_main.cpp b/services/updater_main.cpp index c8fed0fe410a37ba53ee24ebce301d621d413ccd..e106381cf46c47daee9a03109e3eb7b153afd74a 100644 --- a/services/updater_main.cpp +++ b/services/updater_main.cpp @@ -239,12 +239,22 @@ bool GetBatteryCapacity(int &capacity) return false; } +__attribute__((weak)) bool IsSpareBoardBoot(void) +{ + LOG(INFO) << "no need check spareboardboot"; + return false; +} + bool IsBatteryCapacitySufficient() { if (Utils::CheckUpdateMode(OTA_MODE)) { LOG(INFO) << "this is OTA update, on need to determine the battery"; return true; } + if (IsSpareBoardBoot()) { + LOG(INFO) << "this is spare board boot, no need to determine the battery"; + return true; + } static constexpr auto levelIdx = "lowBatteryLevel"; static constexpr auto jsonPath = "/etc/product_cfg.json"; diff --git a/services/updater_main.h b/services/updater_main.h index 29e0e41e6bc6644d1af4adc2428f75d5b8f84481..52b29d9f1433deb59b08b3ec596e9ead891966b3 100644 --- a/services/updater_main.h +++ b/services/updater_main.h @@ -68,6 +68,7 @@ UpdaterStatus ProcessOtherOption([[maybe_unused]] const std::string &option, bool PreStartBinaryEntry([[maybe_unused]] const std::string &path); int32_t VerifySpecialPkgs([[maybe_unused]]UpdaterParams &upParams); void UpdaterVerifyFailEntry(bool verifyret); +bool IsSpareBoardBoot(void); bool IsNeedWipe(); #ifdef __cplusplus #if __cplusplus