diff --git a/services/BUILD.gn b/services/BUILD.gn index 85bf7979b1c8307fc6293c1722890bf612949876..f1c260f5391422ab84ef6d0e5fb9c02234288ef6 100755 --- a/services/BUILD.gn +++ b/services/BUILD.gn @@ -80,6 +80,7 @@ ohos_static_library("libupdater_static") { deps += [ "${updater_path}/interfaces/kits/misc_info:libmiscinfo", "${updater_path}/services/sdcard_update:libsdupdate", + "${updater_path}/interfaces/kits/slot_info:libslotinfo", ] if (defined(use_ptable)) { diff --git a/services/updater_binary/update_processor.cpp b/services/updater_binary/update_processor.cpp index 49e841e31dff3c7db638e24ed67a3f124d783798..78a1732597899883131ba71743a6ac634c61fd43 100644 --- a/services/updater_binary/update_processor.cpp +++ b/services/updater_binary/update_processor.cpp @@ -526,11 +526,6 @@ int ProcessUpdater(bool retry, int pipeFd, const std::string &packagePath, const } }); PkgManager::ReleasePackageInstance(pkgManager); -#ifndef UPDATER_UT - if (ret == 0) { - SetActiveSlot(); - } -#endif return ret; } -} // Updater \ No newline at end of file +} // Updater diff --git a/services/updater_main.cpp b/services/updater_main.cpp index 6f31d80c5d7d2d69cc9e20cd4c4e43a94d55f3ee..c92a607f81c6ad686c4025322223bfb2d6a97ee8 100644 --- a/services/updater_main.cpp +++ b/services/updater_main.cpp @@ -50,6 +50,7 @@ #include "utils.h" #include "factory_reset/factory_reset.h" #include "write_state/write_state.h" +#include "slot_info/slot_info.h" namespace Updater { using Utils::String2Int; @@ -887,6 +888,9 @@ static void ShowSuccessUi(UpdaterParams &upParams, UpdaterStatus &status) __attribute__((weak)) UpdaterStatus CheckAndSetSlot([[maybe_unused]]UpdaterParams &upParams) { LOG(INFO) << "not need check and set slot"; +#ifndef UPDATER_UT + SetActiveSlot(); //UPDATER_AB_SUPPORT +#endif return UPDATE_SUCCESS; } diff --git a/updater_default_cfg.gni b/updater_default_cfg.gni index e2036f204ba0e0f2f69774d693df1f297926b271..4f84e9f209e4975b037210e40543cd5e11e7766a 100644 --- a/updater_default_cfg.gni +++ b/updater_default_cfg.gni @@ -13,7 +13,7 @@ import("//build/ohos.gni") -init_feature_ab_partition = true +init_feature_ab_partition = false declare_args() { updater_cfg_file = "" updater_ui_support = true @@ -45,7 +45,7 @@ template("updater_gen") { } else { ohos_executable(target_name) { if (!is_asan && !is_emulator && target_name == "updater_binary") { - static_link = false + static_link = true } forward_variables_from(invoker, "*")