diff --git a/frameworks/native/backup_ext/src/ext_extension.cpp b/frameworks/native/backup_ext/src/ext_extension.cpp index e5d16903c99cce48e2ae9e955fa7955305a60a42..27e77e868b559a38ca92142bea40fbae28277e83 100644 --- a/frameworks/native/backup_ext/src/ext_extension.cpp +++ b/frameworks/native/backup_ext/src/ext_extension.cpp @@ -55,7 +55,6 @@ using namespace std; void BackupExtExtension::VerifyCaller() { - HILOGI("begin"); uint32_t tokenCaller = IPCSkeleton::GetCallingTokenID(); int tokenType = Security::AccessToken::AccessTokenKit::GetTokenType(tokenCaller); if (tokenType != Security::AccessToken::ATokenTypeEnum::TOKEN_NATIVE) { @@ -72,7 +71,7 @@ UniqueFd BackupExtExtension::GetFileHandle(const string &fileName) { try { if (extension_->GetExtensionAction() != BConstants::ExtensionAction::RESTORE) { - HILOGI("Failed to get file handle, because action is %{public}d invalid", extension_->GetExtensionAction()); + HILOGE("Failed to get file handle, because action is %{public}d invalid", extension_->GetExtensionAction()); throw BError(BError::Codes::EXT_INVAL_ARG, "Action is invalid"); } @@ -531,7 +530,7 @@ void BackupExtExtension::AsyncTaskRestoreForUpgrade() "extension handle have been already released"); auto callBackup = [obj]() { - HILOGI("begin call restore"); + HILOGI("extension onRestore end"); auto extensionPtr = obj.promote(); BExcepUltils::BAssert(extensionPtr, BError::Codes::EXT_BROKEN_FRAMEWORK, "Ext extension handle have been already released"); @@ -604,7 +603,7 @@ void BackupExtExtension::AsyncTaskOnBackup() "extension handle have been already released"); auto callBackup = [obj]() { - HILOGI("begin call backup"); + HILOGI("extension onbackup end"); auto extensionPtr = obj.promote(); BExcepUltils::BAssert(extensionPtr, BError::Codes::EXT_BROKEN_FRAMEWORK, "Ext extension handle have been already released"); diff --git a/frameworks/native/backup_ext/src/ext_extension_stub.cpp b/frameworks/native/backup_ext/src/ext_extension_stub.cpp index c98380a376c7e175ddfe1e36ea968c1b96d7a764..c589d74253c44ed95ae847396807d79cc983f85c 100644 --- a/frameworks/native/backup_ext/src/ext_extension_stub.cpp +++ b/frameworks/native/backup_ext/src/ext_extension_stub.cpp @@ -63,7 +63,6 @@ int32_t ExtExtensionStub::OnRemoteRequest(uint32_t code, ErrCode ExtExtensionStub::CmdGetFileHandle(MessageParcel &data, MessageParcel &reply) { - HILOGI("Begin"); string fileName; if (!data.ReadString(fileName)) { return BError(BError::Codes::EXT_INVAL_ARG, "Failed to receive fileName").GetCode(); @@ -78,7 +77,6 @@ ErrCode ExtExtensionStub::CmdGetFileHandle(MessageParcel &data, MessageParcel &r ErrCode ExtExtensionStub::CmdHandleClear(MessageParcel &data, MessageParcel &reply) { - HILOGI("Begin"); ErrCode res = HandleClear(); if (!reply.WriteInt32(res)) { stringstream ss; @@ -90,7 +88,6 @@ ErrCode ExtExtensionStub::CmdHandleClear(MessageParcel &data, MessageParcel &rep ErrCode ExtExtensionStub::CmdHandleBackup(MessageParcel &data, MessageParcel &reply) { - HILOGI("Begin"); ErrCode res = HandleBackup(); if (!reply.WriteInt32(res)) { stringstream ss; @@ -102,7 +99,6 @@ ErrCode ExtExtensionStub::CmdHandleBackup(MessageParcel &data, MessageParcel &re ErrCode ExtExtensionStub::CmdPublishFile(MessageParcel &data, MessageParcel &reply) { - HILOGI("Begin"); string fileName; if (!data.ReadString(fileName)) { return BError(BError::Codes::EXT_INVAL_ARG, "Failed to receive fileName"); @@ -119,7 +115,6 @@ ErrCode ExtExtensionStub::CmdPublishFile(MessageParcel &data, MessageParcel &rep ErrCode ExtExtensionStub::CmdHandleRestore(MessageParcel &data, MessageParcel &reply) { - HILOGI("Begin"); ErrCode res = HandleRestore(); if (!reply.WriteInt32(res)) { stringstream ss; diff --git a/services/backup_sa/src/module_external/bms_adapter.cpp b/services/backup_sa/src/module_external/bms_adapter.cpp index 2e2a25e94a0e13a645f6bdd624195bf356434acb..d3ad3df1dfca719c6882b10fbe5af8baaadd3267 100644 --- a/services/backup_sa/src/module_external/bms_adapter.cpp +++ b/services/backup_sa/src/module_external/bms_adapter.cpp @@ -76,13 +76,11 @@ static tuple GetAllowAndExtName(const vector BundleMgrAdapter::GetBundleInfos(int32_t use for (auto const &installedBundle : installedBundles) { if (installedBundle.applicationInfo.codePath == HMOS_HAP_CODE_PATH || installedBundle.applicationInfo.codePath == LINUX_HAP_CODE_PATH) { - HILOGI("Unsupported applications, name : %{public}s", installedBundle.name.data()); continue; } auto [allToBackup, extName, restoreDeps] = GetAllowAndExtName(installedBundle.extensionInfos); diff --git a/services/backup_sa/src/module_ipc/service.cpp b/services/backup_sa/src/module_ipc/service.cpp index 937146137211e0a1781b5604f962f71c147f19d0..137dae58f8a76f31eec6c17ed8dc526755335b6d 100644 --- a/services/backup_sa/src/module_ipc/service.cpp +++ b/services/backup_sa/src/module_ipc/service.cpp @@ -123,10 +123,10 @@ UniqueFd Service::GetLocalCapabilities() HILOGE("GetLocalCapabilities failed, errCode = %{public}d", e.GetCode()); return UniqueFd(-e.GetCode()); } catch (const exception &e) { - HILOGI("Catched an unexpected low-level exception %{public}s", e.what()); + HILOGE("Catched an unexpected low-level exception %{public}s", e.what()); return UniqueFd(-EPERM); } catch (...) { - HILOGI("Unexpected exception"); + HILOGE("Unexpected exception"); return UniqueFd(-EPERM); } } @@ -372,10 +372,10 @@ ErrCode Service::PublishFile(const BFileInfo &fileInfo) } catch (const BError &e) { return e.GetCode(); } catch (const exception &e) { - HILOGI("Catched an unexpected low-level exception %{public}s", e.what()); + HILOGE("Catched an unexpected low-level exception %{public}s", e.what()); return EPERM; } catch (...) { - HILOGI("Unexpected exception"); + HILOGE("Unexpected exception"); return EPERM; } } @@ -415,10 +415,10 @@ ErrCode Service::AppFileReady(const string &fileName, UniqueFd fd) } catch (const BError &e) { return e.GetCode(); // 任意异常产生,终止监听该任务 } catch (const exception &e) { - HILOGI("Catched an unexpected low-level exception %{public}s", e.what()); + HILOGE("Catched an unexpected low-level exception %{public}s", e.what()); return EPERM; } catch (...) { - HILOGI("Unexpected exception"); + HILOGE("Unexpected exception"); return EPERM; } } @@ -450,10 +450,10 @@ ErrCode Service::AppDone(ErrCode errCode) } catch (const BError &e) { return e.GetCode(); // 任意异常产生,终止监听该任务 } catch (const exception &e) { - HILOGI("Catched an unexpected low-level exception %{public}s", e.what()); + HILOGE("Catched an unexpected low-level exception %{public}s", e.what()); return EPERM; } catch (...) { - HILOGI("Unexpected exception"); + HILOGE("Unexpected exception"); return EPERM; } } @@ -492,10 +492,10 @@ ErrCode Service::LaunchBackupExtension(const BundleName &bundleName) } catch (const BError &e) { return e.GetCode(); } catch (const exception &e) { - HILOGI("Catched an unexpected low-level exception %{public}s", e.what()); + HILOGE("Catched an unexpected low-level exception %{public}s", e.what()); return EPERM; } catch (...) { - HILOGI("Unexpected exception"); + HILOGE("Unexpected exception"); return EPERM; } } @@ -536,10 +536,10 @@ ErrCode Service::GetFileHandle(const string &bundleName, const string &fileName) } catch (const BError &e) { return e.GetCode(); } catch (const exception &e) { - HILOGI("Catched an unexpected low-level exception %{public}s", e.what()); + HILOGE("Catched an unexpected low-level exception %{public}s", e.what()); return EPERM; } catch (...) { - HILOGI("Unexpected exception"); + HILOGE("Unexpected exception"); return EPERM; } } @@ -565,10 +565,10 @@ void Service::OnBackupExtensionDied(const string &&bundleName, ErrCode ret) } catch (const BError &e) { return; } catch (const exception &e) { - HILOGI("Catched an unexpected low-level exception %{public}s", e.what()); + HILOGE("Catched an unexpected low-level exception %{public}s", e.what()); return; } catch (...) { - HILOGI("Unexpected exception"); + HILOGE("Unexpected exception"); return; } } @@ -576,7 +576,7 @@ void Service::OnBackupExtensionDied(const string &&bundleName, ErrCode ret) void Service::ExtStart(const string &bundleName) { try { - HILOGE("begin %{public}s", bundleName.data()); + HILOGI("begin %{public}s", bundleName.data()); IServiceReverse::Scenario scenario = session_->GetScenario(); auto backUpConnection = session_->GetExtConnection(bundleName); auto proxy = backUpConnection->GetBackupExtProxy(); @@ -613,10 +613,10 @@ void Service::ExtStart(const string &bundleName) } catch (const BError &e) { return; } catch (const exception &e) { - HILOGI("Catched an unexpected low-level exception %{public}s", e.what()); + HILOGE("Catched an unexpected low-level exception %{public}s", e.what()); return; } catch (...) { - HILOGI("Unexpected exception"); + HILOGE("Unexpected exception"); return; } } @@ -651,10 +651,10 @@ void Service::ExtConnectFailed(const string &bundleName, ErrCode ret) } catch (const BError &e) { return; } catch (const exception &e) { - HILOGI("Catched an unexpected low-level exception %{public}s", e.what()); + HILOGE("Catched an unexpected low-level exception %{public}s", e.what()); return; } catch (...) { - HILOGI("Unexpected exception"); + HILOGE("Unexpected exception"); return; } } @@ -699,10 +699,10 @@ void Service::ExtConnectDone(string bundleName) } catch (const BError &e) { return; } catch (const exception &e) { - HILOGI("Catched an unexpected low-level exception %{public}s", e.what()); + HILOGE("Catched an unexpected low-level exception %{public}s", e.what()); return; } catch (...) { - HILOGI("Unexpected exception"); + HILOGE("Unexpected exception"); return; } } @@ -717,10 +717,10 @@ void Service::ClearSessionAndSchedInfo(const string &bundleName) } catch (const BError &e) { return; } catch (const exception &e) { - HILOGI("Catched an unexpected low-level exception %{public}s", e.what()); + HILOGE("Catched an unexpected low-level exception %{public}s", e.what()); return; } catch (...) { - HILOGI("Unexpected exception"); + HILOGE("Unexpected exception"); return; } } diff --git a/services/backup_sa/src/module_ipc/svc_session_manager.cpp b/services/backup_sa/src/module_ipc/svc_session_manager.cpp index 59d98db8e17d264b16755ecfca23dbabd53e3b1b..33d6be1e0027b5631e6a473a425fb6950cc3a297 100644 --- a/services/backup_sa/src/module_ipc/svc_session_manager.cpp +++ b/services/backup_sa/src/module_ipc/svc_session_manager.cpp @@ -190,7 +190,6 @@ UniqueFd SvcSessionManager::OnBunleExtManageInfo(const string &bundleName, Uniqu void SvcSessionManager::RemoveExtInfo(const string &bundleName) { - HILOGI("Begin"); unique_lock lock(lock_); auto it = impl_.backupExtNameMap.find(bundleName); if (it == impl_.backupExtNameMap.end()) { @@ -204,7 +203,6 @@ void SvcSessionManager::RemoveExtInfo(const string &bundleName) wptr SvcSessionManager::GetExtConnection(const BundleName &bundleName) { - HILOGI("Begin"); shared_lock lock(lock_); if (!impl_.clientToken) { throw BError(BError::Codes::SA_INVAL_ARG, "No caller token was specified"); @@ -278,7 +276,6 @@ void SvcSessionManager::InitClient(Impl &newImpl) void SvcSessionManager::SetExtFileNameRequest(const string &bundleName, const string &fileName) { - HILOGI("Begin"); unique_lock lock(lock_); if (!impl_.clientToken) { throw BError(BError::Codes::SA_INVAL_ARG, "No caller token was specified"); @@ -290,7 +287,6 @@ void SvcSessionManager::SetExtFileNameRequest(const string &bundleName, const st std::set SvcSessionManager::GetExtFileNameRequest(const std::string &bundleName) { - HILOGI("Begin"); unique_lock lock(lock_); if (!impl_.clientToken) { throw BError(BError::Codes::SA_INVAL_ARG, "No caller token was specified"); @@ -335,7 +331,6 @@ bool SvcSessionManager::GetSchedBundleName(string &bundleName) BConstants::ServiceSchedAction SvcSessionManager::GetServiceSchedAction(const std::string &bundleName) { - HILOGI("Begin"); shared_lock lock(lock_); if (!impl_.clientToken) { throw BError(BError::Codes::SA_INVAL_ARG, "No caller token was specified"); @@ -346,7 +341,6 @@ BConstants::ServiceSchedAction SvcSessionManager::GetServiceSchedAction(const st void SvcSessionManager::SetServiceSchedAction(const string &bundleName, BConstants::ServiceSchedAction action) { - HILOGI("Begin"); unique_lock lock(lock_); if (!impl_.clientToken) { throw BError(BError::Codes::SA_INVAL_ARG, "No caller token was specified"); @@ -361,7 +355,6 @@ void SvcSessionManager::SetServiceSchedAction(const string &bundleName, BConstan void SvcSessionManager::SetBackupExtName(const string &bundleName, const string &backupExtName) { - HILOGI("Begin"); unique_lock lock(lock_); if (!impl_.clientToken) { throw BError(BError::Codes::SA_INVAL_ARG, "No caller token was specified"); @@ -373,7 +366,6 @@ void SvcSessionManager::SetBackupExtName(const string &bundleName, const string string SvcSessionManager::GetBackupExtName(const string &bundleName) { - HILOGI("Begin"); shared_lock lock(lock_); if (!impl_.clientToken) { throw BError(BError::Codes::SA_INVAL_ARG, "No caller token was specified"); @@ -608,7 +600,7 @@ uint32_t SvcSessionManager::CalAppProcessTime(const std::string &bundleName) timeout = defaultTimeout; } resTimeoutMs = (uint32_t)(timeout * invertMillisecond % UINT_MAX); /* conver second to millisecond */ - HILOGI("Calculate App extension process run timeout=%{public}u(s), bundleName=%{public}s ", + HILOGI("Calculate App extension process run timeout=%{public}u(ms), bundleName=%{public}s ", resTimeoutMs, bundleName.c_str()); return resTimeoutMs; } diff --git a/services/backup_sa/src/module_sched/sched_scheduler.cpp b/services/backup_sa/src/module_sched/sched_scheduler.cpp index f7c009d7ce5477166e4fbeac2bf74285f607a113..0ec0b4cdbb29d2859c2c9bd63e7319d5ef029dc2 100644 --- a/services/backup_sa/src/module_sched/sched_scheduler.cpp +++ b/services/backup_sa/src/module_sched/sched_scheduler.cpp @@ -50,7 +50,7 @@ void SchedScheduler::Sched(string bundleName) sessionPtr_->SetServiceSchedAction(bundleName, BConstants::ServiceSchedAction::INSTALLING); } } - HILOGE("Sched bundleName %{public}s", bundleName.data()); + HILOGD("Sched bundleName %{public}s", bundleName.data()); auto callStart = [schedPtr {wptr(this)}, bundleName]() { try { auto ptr = schedPtr.promote(); diff --git a/utils/include/b_json/b_json_cached_entity.h b/utils/include/b_json/b_json_cached_entity.h index 8413c56152d4b8181561e8e034112dba7551a36f..0eddef43b730e14e26252e78e7af4f91cc24a396 100644 --- a/utils/include/b_json/b_json_cached_entity.h +++ b/utils/include/b_json/b_json_cached_entity.h @@ -58,7 +58,7 @@ public: { Json::StreamWriterBuilder builder; const std::string jsonFileContent = Json::writeString(builder, obj_); - HILOGI("Try to persist a Json object, whose content reads: %{public}s", jsonFileContent.c_str()); + HILOGD("Try to persist a Json object, whose content reads: %{public}s", jsonFileContent.c_str()); BFile::Write(srcFile_, jsonFileContent); } diff --git a/utils/include/b_json/b_json_entity_caps.h b/utils/include/b_json/b_json_entity_caps.h index db51d4270fed89cbd12bf797ba0f7770f43b08de..e52dd173b16f5fbcadde0e1c41cede18d445582b 100644 --- a/utils/include/b_json/b_json_entity_caps.h +++ b/utils/include/b_json/b_json_entity_caps.h @@ -110,7 +110,6 @@ public: string restoreDeps(""); if (item.isMember("restoreDeps") && item["restoreDeps"].isString()) { restoreDeps = item["restoreDeps"].asString(); - HILOGI("restoreDeps is %{public}s", restoreDeps.data()); } bundleInfos.emplace_back(BundleInfo {item["name"].asString(), item["versionCode"].asUInt(), item["versionName"].asString(), item["spaceOccupied"].asInt64(), diff --git a/utils/src/b_filesystem/b_dir.cpp b/utils/src/b_filesystem/b_dir.cpp index 045a96ce51515abcc7fee1c133e695205c2e2a06..404e9938241c2fce17b72d8771b8a69554c11693 100644 --- a/utils/src/b_filesystem/b_dir.cpp +++ b/utils/src/b_filesystem/b_dir.cpp @@ -76,7 +76,7 @@ static pair> GetDirFilesDetail(const string &p } } - return {BError(BError::Codes::OK).GetCode(), files}; + return {ERR_OK, files}; } tuple> BDir::GetDirFiles(const string &path) @@ -100,7 +100,7 @@ tuple> BDir::GetDirFiles(const string &path) } } - return {BError(BError::Codes::OK).GetCode(), files}; + return {ERR_OK, files}; } static set ExpandPathWildcard(const vector &vec) diff --git a/utils/src/b_json/b_json_entity_ext_manage.cpp b/utils/src/b_json/b_json_entity_ext_manage.cpp index bff04e1d71d86cc0fe532ac6e516646d2c5b4b24..69c66d1ef9aa1810117e94a6adcb77ad3cf1f1df 100644 --- a/utils/src/b_json/b_json_entity_ext_manage.cpp +++ b/utils/src/b_json/b_json_entity_ext_manage.cpp @@ -46,7 +46,7 @@ static bool CheckBigFile(const string &tarFile) static bool CheckUserTar(const string &fileName) { if (access(fileName.c_str(), F_OK) != 0) { - HILOGI("file does not exists"); + HILOGE("file does not exists"); return false; } @@ -201,8 +201,6 @@ std::vector BJsonEntityExtManage::GetExtManageInfo() const string fileName = item.isMember("fileName") && item["fileName"].isString() ? item["fileName"].asString() : ""; bool isUserTar = item.isMember("isUserTar") && item["isUserTar"].isBool() ? item["isUserTar"].asBool() : false; bool isBigFile = item.isMember("isBigFile") && item["isBigFile"].isBool() ? item["isBigFile"].asBool() : false; - HILOGI("GetExtManageInfo, fileName:%{public}s, isUserTar:%{public}d, isBigFile:%{public}d", fileName.data(), - isUserTar, isBigFile); if (!fileName.empty() && !path.empty()) { ExtManageInfo info = { .hashName = fileName, .fileName = path, .sta = sta, .isUserTar = isUserTar, .isBigFile = isBigFile};