From 0ab31d376e055f89e1a79be9915f704c3e88ecc1 Mon Sep 17 00:00:00 2001 From: chenzihan Date: Sat, 16 Apr 2022 13:50:03 +0800 Subject: [PATCH] Signed-off-by: chenzihan fix:fix adout user_wipe_data --- interfaces/kits/updaterkits/BUILD.gn | 1 + interfaces/kits/updaterkits/updaterkits.cpp | 9 +++------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/interfaces/kits/updaterkits/BUILD.gn b/interfaces/kits/updaterkits/BUILD.gn index fd59e521..2c68114f 100755 --- a/interfaces/kits/updaterkits/BUILD.gn +++ b/interfaces/kits/updaterkits/BUILD.gn @@ -30,6 +30,7 @@ ohos_static_library("libupdaterkits") { "//third_party/bounds_checking_function:libsec_static", ] + external_deps = [ "init:libbegetutil" ] subsystem_name = "updater" part_name = "updater" } diff --git a/interfaces/kits/updaterkits/updaterkits.cpp b/interfaces/kits/updaterkits/updaterkits.cpp index bfc2a6a4..227621f5 100755 --- a/interfaces/kits/updaterkits/updaterkits.cpp +++ b/interfaces/kits/updaterkits/updaterkits.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include "misc_info/misc_info.h" #include "parameters.h" #include "securec.h" @@ -38,12 +39,8 @@ static bool WriteToMiscAndRebootToUpdater(const std::string &miscFile, #ifndef UPDATER_UT int32_t propertyMaxSize = 92; char updateCmd[propertyMaxSize]; - void(snprintf_s(updateCmd, propertyMaxSize, propertyMaxSize - 1, "reboot,updater:%s", updateMsg.update)); - bool bRet = OHOS::system::SetParameter("ohos.startup.powerctrl", updateCmd); - if (!bRet) { - std::cout << "WriteToMiscAndRebootToUpdater SetParameter failed, errno: " << errno << std::endl; - return false; - } + void(snprintf_s(updateCmd, propertyMaxSize, propertyMaxSize - 1, "updater:%s", updateMsg.update)); + DoReboot(updateCmd); while (true) { pause(); } -- Gitee