diff --git a/client/update_client.cpp b/client/update_client.cpp index a8390c80747fb7faa6b86cbb7e7928fd53539ffa..8249a603b2829fe87feb86e1862a58516a6fc5fc 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 abebd163c687f22a0a98b38b3f44b69ec2c440c5..4212b4700e0e97a03b612dc6627521d5cf112bbe 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