From 412d62044bdc0fb1fe812c02dc47911698e61eec Mon Sep 17 00:00:00 2001 From: zhong_ning Date: Fri, 30 Jul 2021 16:33:16 +0800 Subject: [PATCH] updater: fix bug for interface rebootandclean Signed-off-by: zhong_ning --- client/update_client.cpp | 3 ++- engine/src/update_service_stub.cpp | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/client/update_client.cpp b/client/update_client.cpp index a8390c80..8249a603 100644 --- a/client/update_client.cpp +++ b/client/update_client.cpp @@ -49,6 +49,7 @@ const int32_t MID_ARGC = 2; const int32_t CLIENT_STRING_MAX_LENGTH = 200; constexpr int PROGRESS_DOWNLOAD_FINISH = 100; const std::string MISC_FILE = "/dev/block/platform/soc/10100000.himci.eMMC/by-name/misc"; +const std::string CMD_WIPE_DATA = "--user_wipe_data"; const std::string UPDATER_PKG_NAME = "/data/updater/updater.zip"; UpdateClient::UpdateClient(napi_env env, napi_value thisVar) @@ -370,7 +371,7 @@ napi_value UpdateClient::RebootAndClean(napi_env env, napi_callback_info info) { napi_value retValue = StartSession(env, info, SESSION_REBOOT_AND_CLEAN, 0, [&](int32_t type, void *context) -> int { - result_ = UpdateServiceKits::GetInstance().RebootAndClean(MISC_FILE, UPDATER_PKG_NAME); + result_ = UpdateServiceKits::GetInstance().RebootAndClean(MISC_FILE, CMD_WIPE_DATA); return result_; }); CLIENT_CHECK(retValue != nullptr, return nullptr, "Failed to GetNewVersionInfo."); diff --git a/engine/src/update_service_stub.cpp b/engine/src/update_service_stub.cpp index abebd163..4212b470 100755 --- a/engine/src/update_service_stub.cpp +++ b/engine/src/update_service_stub.cpp @@ -141,7 +141,7 @@ static int32_t RebootAndInstallStub(UpdateServiceStub::UpdateServiceStubPtr serv ENGINE_CHECK(service != nullptr, return -1, "Invalid param"); string miscFile = Str16ToStr8(data.ReadString16()); string packageName = Str16ToStr8(data.ReadString16()); - int32_t ret = service->RebootAndClean(miscFile, packageName); + int32_t ret = service->RebootAndInstall(miscFile, packageName); reply.WriteInt32(ret); return 0; } @@ -174,4 +174,4 @@ int32_t UpdateServiceStub::OnRemoteRequest(uint32_t code, return IPCObjectStub::OnRemoteRequest(code, data, reply, option); } } -} // namespace OHO \ No newline at end of file +} // namespace OHO -- Gitee