diff --git a/frameworks/src/bundle_command.cpp b/frameworks/src/bundle_command.cpp index a0649d261cc6befad9a7470214ae517764f87aa8..9e639031e4b6ddd8cbb841ed401796b60648cc64 100644 --- a/frameworks/src/bundle_command.cpp +++ b/frameworks/src/bundle_command.cpp @@ -292,7 +292,7 @@ ErrCode BundleManagerShellCommand::RunAsCopyApCommand() APP_LOGI("in user mode but not in developer mode"); return ERR_OK; } - APP_LOGI("begin to RunAsCopyApCommand"); + APP_LOGI("begin"); int result = OHOS::ERR_OK; int counter = 0; std::string bundleName = ""; @@ -333,7 +333,7 @@ ErrCode BundleManagerShellCommand::RunAsCopyApCommand() } resultReceiver_.append(copyApResult); } - APP_LOGI("end to RunAsCopyApCommand"); + APP_LOGI("end"); return result; } @@ -355,7 +355,7 @@ ErrCode BundleManagerShellCommand::ParseCopyApCommand(int32_t option, std::strin // 'bm copy-ap' with an unknown option: bm copy-ap -xxx std::string unknownOption = ""; std::string unknownOptionMsg = GetUnknownOptionMsg(unknownOption); - APP_LOGE("'bm copy-ap' with an unknown option."); + APP_LOGE("'bm copy-ap' with an unknown option"); resultReceiver_.append(unknownOptionMsg); result = OHOS::ERR_INVALID_VALUE; break; @@ -396,7 +396,7 @@ ErrCode BundleManagerShellCommand::ParseCopyApCommand(int32_t option, std::strin ErrCode BundleManagerShellCommand::RunAsCompileCommand() { - APP_LOGI("begin to RunAsCompileCommand"); + APP_LOGI("begin"); int result = OHOS::ERR_OK; int counter = 0; std::string compileMode = ""; @@ -438,7 +438,7 @@ ErrCode BundleManagerShellCommand::RunAsCompileCommand() // 'bm compile' with an unknown option: bm compile -xxx std::string unknownOption = ""; std::string unknownOptionMsg = GetUnknownOptionMsg(unknownOption); - APP_LOGE("'bm compile' with an unknown option."); + APP_LOGE("'bm compile' with an unknown option"); resultReceiver_.append(unknownOptionMsg); result = OHOS::ERR_INVALID_VALUE; break; @@ -503,7 +503,7 @@ ErrCode BundleManagerShellCommand::RunAsCompileCommand() ErrCode BundleManagerShellCommand::RunAsInstallCommand() { - APP_LOGI("begin to RunAsInstallCommand"); + APP_LOGI("begin"); int result = OHOS::ERR_OK; InstallFlag installFlag = InstallFlag::REPLACE_EXISTING; int counter = 0; @@ -725,7 +725,7 @@ ErrCode BundleManagerShellCommand::GetBundlePath(const std::string& param, ErrCode BundleManagerShellCommand::RunAsUninstallCommand() { - APP_LOGI("begin to RunAsUninstallCommand"); + APP_LOGI("begin"); int result = OHOS::ERR_OK; int counter = 0; std::string bundleName = ""; @@ -920,7 +920,7 @@ ErrCode BundleManagerShellCommand::RunAsUninstallCommand() ErrCode BundleManagerShellCommand::RunAsDumpCommand() { - APP_LOGI("begin to RunAsDumpCommand"); + APP_LOGI("begin"); int result = OHOS::ERR_OK; int counter = 0; std::string bundleName = ""; @@ -1085,7 +1085,7 @@ ErrCode BundleManagerShellCommand::RunAsCleanCommand() return ERR_OK; } - APP_LOGI("begin to RunAsCleanCommand"); + APP_LOGI("begin"); int32_t result = OHOS::ERR_OK; int32_t counter = 0; int32_t userId = BundleCommandCommon::GetCurrentUserId(Constants::UNSPECIFIED_USERID); @@ -1250,7 +1250,7 @@ ErrCode BundleManagerShellCommand::RunAsEnableCommand() APP_LOGI("in user mode"); return ERR_OK; } - APP_LOGI("begin to RunAsEnableCommand"); + APP_LOGI("begin"); int result = OHOS::ERR_OK; int counter = 0; std::string bundleName = ""; @@ -1385,7 +1385,7 @@ ErrCode BundleManagerShellCommand::RunAsDisableCommand() APP_LOGI("in user mode"); return ERR_OK; } - APP_LOGI("begin to RunAsDisableCommand"); + APP_LOGI("begin"); int result = OHOS::ERR_OK; int counter = 0; std::string bundleName = ""; @@ -1509,7 +1509,7 @@ ErrCode BundleManagerShellCommand::RunAsDisableCommand() ErrCode BundleManagerShellCommand::RunAsGetCommand() { - APP_LOGI("begin to RunAsGetCommand"); + APP_LOGI("begin"); int result = OHOS::ERR_OK; int counter = 0; while (true) { @@ -1562,7 +1562,7 @@ ErrCode BundleManagerShellCommand::RunAsGetCommand() ErrCode BundleManagerShellCommand::RunAsQuickFixCommand() { - APP_LOGI("begin to RunAsQuickFixCommand"); + APP_LOGI("begin"); for (auto index = INDEX_OFFSET; index < argc_; ++index) { APP_LOGD("argv_[%{public}d]: %{public}s", index, argv_[index]); std::string opt = argv_[index]; @@ -1668,7 +1668,7 @@ ErrCode BundleManagerShellCommand::RunAsQuickFixCommand() ErrCode BundleManagerShellCommand::RunAsDumpOverlay() { - APP_LOGI("begin to RunAsDumpOverlay"); + APP_LOGI("begin"); int result = OHOS::ERR_OK; int counter = 0; int32_t userId = BundleCommandCommon::GetCurrentUserId(Constants::UNSPECIFIED_USERID); @@ -1804,7 +1804,7 @@ ErrCode BundleManagerShellCommand::RunAsDumpOverlay() ErrCode BundleManagerShellCommand::RunAsDumpTargetOverlay() { - APP_LOGI("begin to RunAsDumpTargetOverlay"); + APP_LOGI("begin"); int result = OHOS::ERR_OK; int counter = 0; int32_t userId = BundleCommandCommon::GetCurrentUserId(Constants::UNSPECIFIED_USERID); @@ -1929,7 +1929,7 @@ std::string BundleManagerShellCommand::GetUdid() const char innerUdid[DEVICE_UDID_LENGTH] = { 0 }; int ret = GetDevUdid(innerUdid, DEVICE_UDID_LENGTH); if (ret != 0) { - APP_LOGE("GetUdid failed! ret = %{public}d.", ret); + APP_LOGE("failed, ret = %{public}d", ret); return STRING_GET_UDID_NG; } std::string udid = innerUdid; @@ -1942,7 +1942,7 @@ std::string BundleManagerShellCommand::CopyAp(const std::string &bundleName, boo std::vector copyApResults; ErrCode ret = bundleMgrProxy_->CopyAp(bundleName, isAllBundle, copyApResults); if (ret != ERR_OK) { - APP_LOGE("failed to copy ap! ret = = %{public}d.", ret); + APP_LOGE("failed, ret = %{public}d", ret); return ""; } for (const auto ©ApResult : copyApResults) { @@ -1975,7 +1975,7 @@ std::string BundleManagerShellCommand::CompileReset(const std::string &bundleNam std::string ResetResults; ErrCode ResetRet = bundleMgrProxy_->CompileReset(bundleName, isAllBundle); if (ResetRet == ERR_APPEXECFWK_PARCEL_ERROR) { - APP_LOGE("failed to reset AOT."); + APP_LOGE("reset AOT failed"); return ResetResults; } ResetResults = COMPILE_RESET; @@ -1988,7 +1988,7 @@ std::string BundleManagerShellCommand::DumpBundleList(int32_t userId) const bool dumpRet = bundleMgrProxy_->DumpInfos( DumpFlag::DUMP_BUNDLE_LIST, BUNDLE_NAME_EMPTY, userId, dumpResults); if (!dumpRet) { - APP_LOGE("failed to dump bundle list."); + APP_LOGE("dump bundle list failed"); } return dumpResults; } @@ -1999,7 +1999,7 @@ std::string BundleManagerShellCommand::DumpBundleInfo(const std::string &bundleN bool dumpRet = bundleMgrProxy_->DumpInfos( DumpFlag::DUMP_BUNDLE_INFO, bundleName, userId, dumpResults); if (!dumpRet) { - APP_LOGE("failed to dump bundle info."); + APP_LOGE("dump bundle info failed"); } return dumpResults; } @@ -2010,7 +2010,7 @@ std::string BundleManagerShellCommand::DumpShortcutInfos(const std::string &bund bool dumpRet = bundleMgrProxy_->DumpInfos( DumpFlag::DUMP_SHORTCUT_INFO, bundleName, userId, dumpResults); if (!dumpRet) { - APP_LOGE("failed to dump shortcut infos."); + APP_LOGE("dump shortcut infos failed"); } return dumpResults; } @@ -2022,7 +2022,7 @@ std::string BundleManagerShellCommand::DumpDistributedBundleInfo( DistributedBundleInfo distributedBundleInfo; bool dumpRet = bundleMgrProxy_->GetDistributedBundleInfo(deviceId, bundleName, distributedBundleInfo); if (!dumpRet) { - APP_LOGE("failed to dump distributed bundleInfo."); + APP_LOGE("dump distributed bundleInfo failed"); } else { dumpResults.append("distributed bundleInfo"); dumpResults.append(":\n"); @@ -2042,7 +2042,7 @@ std::string BundleManagerShellCommand::DumpDependentModuleNames( std::vector dependentModuleNames; bool dumpRet = bundleMgrProxy_->GetAllDependentModuleNames(bundleName, moduleName, dependentModuleNames); if (!dumpRet) { - APP_LOGE("failed to dump dependent module name."); + APP_LOGE("dump dependent module name failed"); } else { dumpResults.append("dependent moduleNames:"); for (const auto &name : dependentModuleNames) { @@ -2100,12 +2100,12 @@ int32_t BundleManagerShellCommand::InstallOperation(const std::vector statusReceiver(new (std::nothrow) StatusReceiverImpl(waittingTime)); if (statusReceiver == nullptr) { - APP_LOGE("statusReceiver is null"); + APP_LOGE("null statusReceiver"); return IStatusReceiver::ERR_UNKNOWN; } sptr recipient(new (std::nothrow) BundleDeathRecipient(statusReceiver)); if (recipient == nullptr) { - APP_LOGE("recipient is null"); + APP_LOGE("null recipient"); return IStatusReceiver::ERR_UNKNOWN; } bundleInstallerProxy_->AsObject()->AddDeathRecipient(recipient); @@ -2128,7 +2128,7 @@ int32_t BundleManagerShellCommand::InstallOperation(const std::vector statusReceiver(new (std::nothrow) StatusReceiverImpl()); if (statusReceiver == nullptr) { - APP_LOGE("statusReceiver is null"); + APP_LOGE("null statusReceiver"); return IStatusReceiver::ERR_UNKNOWN; } @@ -2149,7 +2149,7 @@ int32_t BundleManagerShellCommand::UninstallOperation( sptr recipient(new (std::nothrow) BundleDeathRecipient(statusReceiver)); if (recipient == nullptr) { - APP_LOGE("recipient is null"); + APP_LOGE("null recipient"); return IStatusReceiver::ERR_UNKNOWN; } bundleInstallerProxy_->AsObject()->AddDeathRecipient(recipient); @@ -2166,13 +2166,13 @@ int32_t BundleManagerShellCommand::UninstallSharedOperation(const UninstallParam { sptr statusReceiver(new (std::nothrow) StatusReceiverImpl()); if (statusReceiver == nullptr) { - APP_LOGE("statusReceiver is null"); + APP_LOGE("null statusReceiver"); return IStatusReceiver::ERR_UNKNOWN; } sptr recipient(new (std::nothrow) BundleDeathRecipient(statusReceiver)); if (recipient == nullptr) { - APP_LOGE("recipient is null"); + APP_LOGE("null recipient"); return IStatusReceiver::ERR_UNKNOWN; } bundleInstallerProxy_->AsObject()->AddDeathRecipient(recipient); @@ -2188,14 +2188,14 @@ bool BundleManagerShellCommand::CleanBundleCacheFilesOperation(const std::string APP_LOGD("bundleName: %{public}s, userId:%{public}d, appIndex:%{public}d", bundleName.c_str(), userId, appIndex); sptr cleanCacheCallBack(new (std::nothrow) CleanCacheCallbackImpl()); if (cleanCacheCallBack == nullptr) { - APP_LOGE("cleanCacheCallBack is null"); + APP_LOGE("null cleanCacheCallBack"); return false; } ErrCode cleanRet = bundleMgrProxy_->CleanBundleCacheFiles(bundleName, cleanCacheCallBack, userId, appIndex); if (cleanRet == ERR_OK) { return cleanCacheCallBack->GetResultCode(); } - APP_LOGE("clean bundle cache files operation failed, cleanRet = %{public}d", cleanRet); + APP_LOGE("failed, cleanRet = %{public}d", cleanRet); return false; } @@ -2213,7 +2213,7 @@ bool BundleManagerShellCommand::CleanBundleDataFilesOperation(const std::string if ((cleanRetAms == ERR_OK) && cleanRetBms) { return true; } - APP_LOGE("clean bundle data files operation failed"); + APP_LOGE("failed"); return false; } @@ -2250,7 +2250,7 @@ std::string BundleManagerShellCommand::DumpOverlayInfo(const std::string &bundle auto overlayManagerProxy = bundleMgrProxy_->GetOverlayManagerProxy(); if (overlayManagerProxy == nullptr) { - APP_LOGE("overlayManagerProxy is null"); + APP_LOGE("null overlayManagerProxy"); return res; } std::vector overlayModuleInfos; @@ -2272,7 +2272,7 @@ std::string BundleManagerShellCommand::DumpOverlayInfo(const std::string &bundle } } if (ret != ERR_OK) { - APP_LOGE("dump-overlay failed due to errcode %{public}d", ret); + APP_LOGE("failed, errcode %{public}d", ret); return res; } @@ -2295,7 +2295,7 @@ std::string BundleManagerShellCommand::DumpTargetOverlayInfo(const std::string & } auto overlayManagerProxy = bundleMgrProxy_->GetOverlayManagerProxy(); if (overlayManagerProxy == nullptr) { - APP_LOGE("overlayManagerProxy is null"); + APP_LOGE("null overlayManagerProxy"); return res; } @@ -2306,7 +2306,7 @@ std::string BundleManagerShellCommand::DumpTargetOverlayInfo(const std::string & std::vector overlayBundleInfos; ret = overlayManagerProxy->GetOverlayBundleInfoForTarget(bundleName, overlayBundleInfos, userId); if (ret != ERR_OK || overlayBundleInfos.empty()) { - APP_LOGE("dump-target-overlay failed due to errcode %{public}d", ret); + APP_LOGE("failed, errcode %{public}d", ret); return res; } overlayInfoJson = nlohmann::json {{OVERLAY_BUNDLE_INFOS, overlayBundleInfos}}; @@ -2314,7 +2314,7 @@ std::string BundleManagerShellCommand::DumpTargetOverlayInfo(const std::string & std::vector overlayModuleInfos; ret = overlayManagerProxy->GetOverlayModuleInfoForTarget(bundleName, moduleName, overlayModuleInfos, userId); if (ret != ERR_OK || overlayModuleInfos.empty()) { - APP_LOGE("dump-target-overlay failed due to errcode %{public}d", ret); + APP_LOGE("failed, errcode %{public}d", ret); return res; } overlayInfoJson = nlohmann::json {{OVERLAY_MODULE_INFOS, overlayModuleInfos}}; @@ -2324,7 +2324,7 @@ std::string BundleManagerShellCommand::DumpTargetOverlayInfo(const std::string & ErrCode BundleManagerShellCommand::RunAsDumpSharedDependenciesCommand() { - APP_LOGI("begin to RunAsDumpSharedDependenciesCommand"); + APP_LOGI("begin"); int32_t result = OHOS::ERR_OK; int32_t counter = 0; std::string bundleName; @@ -2441,7 +2441,7 @@ std::string BundleManagerShellCommand::DumpSharedDependencies(const std::string ErrCode ret = bundleMgrProxy_->GetSharedDependencies(bundleName, moduleName, dependencies); nlohmann::json dependenciesJson; if (ret != ERR_OK) { - APP_LOGE("dump shared dependencies failed due to errcode %{public}d", ret); + APP_LOGE("failed, errcode %{public}d", ret); return std::string(); } else { dependenciesJson = nlohmann::json {{DEPENDENCIES, dependencies}}; @@ -2451,7 +2451,7 @@ std::string BundleManagerShellCommand::DumpSharedDependencies(const std::string ErrCode BundleManagerShellCommand::RunAsDumpSharedCommand() { - APP_LOGI("begin to RunAsDumpSharedCommand"); + APP_LOGI("begin"); int32_t result = OHOS::ERR_OK; int32_t counter = 0; std::string bundleName; @@ -2560,7 +2560,7 @@ std::string BundleManagerShellCommand::DumpShared(const std::string &bundleName) ErrCode ret = bundleMgrProxy_->GetSharedBundleInfoBySelf(bundleName, sharedBundleInfo); nlohmann::json sharedBundleInfoJson; if (ret != ERR_OK) { - APP_LOGE("dump-shared failed due to errcode %{public}d", ret); + APP_LOGE("failed, errcode %{public}d", ret); return std::string(); } else { sharedBundleInfoJson = nlohmann::json {{SHARED_BUNDLE_INFO, sharedBundleInfo}}; @@ -2575,7 +2575,7 @@ std::string BundleManagerShellCommand::DumpSharedAll() const std::vector sharedBundleInfos; ErrCode ret = bundleMgrProxy_->GetAllSharedBundleInfo(sharedBundleInfos); if (ret != ERR_OK) { - APP_LOGE("dump-shared all failed due to errcode %{public}d", ret); + APP_LOGE("failed, errcode %{public}d", ret); return dumpResults; } for (const auto& item : sharedBundleInfos) { @@ -2608,19 +2608,19 @@ ErrCode BundleManagerShellCommand::DeployQuickFixDisable(const std::vector recipient(new (std::nothrow) BundleDeathRecipient(nullptr, callback)); if (recipient == nullptr) { - APP_LOGE("recipient is null"); + APP_LOGE("null recipient"); return ERR_BUNDLEMANAGER_QUICK_FIX_INTERNAL_ERROR; } bundleMgrProxy_->AsObject()->AddDeathRecipient(recipient); auto quickFixProxy = bundleMgrProxy_->GetQuickFixManagerProxy(); if (quickFixProxy == nullptr) { - APP_LOGE("quickFixProxy is null"); + APP_LOGE("null quickFixProxy"); return ERR_BUNDLEMANAGER_QUICK_FIX_INTERNAL_ERROR; } std::vector destFiles; auto res = quickFixProxy->CopyFiles(pathVec, destFiles); if (res != ERR_OK) { - APP_LOGE("Copy files failed with %{public}d.", res); + APP_LOGE("copy files failed with %{public}d", res); return res; } res = quickFixProxy->DeployQuickFix(destFiles, callback, isDebug, targetPath); @@ -2642,13 +2642,13 @@ ErrCode BundleManagerShellCommand::DeleteQuickFix(const std::string &bundleName, } sptr recipient(new (std::nothrow) BundleDeathRecipient(nullptr, callback)); if (recipient == nullptr) { - APP_LOGE("recipient is null"); + APP_LOGE("null recipient"); return ERR_BUNDLEMANAGER_QUICK_FIX_INTERNAL_ERROR; } bundleMgrProxy_->AsObject()->AddDeathRecipient(recipient); auto quickFixProxy = bundleMgrProxy_->GetQuickFixManagerProxy(); if (quickFixProxy == nullptr) { - APP_LOGE("quickFixProxy is null"); + APP_LOGE("null quickFixProxy"); return ERR_BUNDLEMANAGER_QUICK_FIX_INTERNAL_ERROR; } auto res = quickFixProxy->DeleteQuickFix(bundleName, callback); diff --git a/frameworks/src/bundle_command_common.cpp b/frameworks/src/bundle_command_common.cpp index 1aa20a7528df4f7f9ac6c9875681c1511c217446..889edbfeeeb9d6557d55c452072509d5e8dcb42d 100644 --- a/frameworks/src/bundle_command_common.cpp +++ b/frameworks/src/bundle_command_common.cpp @@ -36,13 +36,13 @@ sptr BundleCommandCommon::GetBundleMgrProxy() sptr systemAbilityManager = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); if (systemAbilityManager == nullptr) { - APP_LOGE("failed to get system ability mgr."); + APP_LOGE("null systemAbilityManager"); return nullptr; } sptr remoteObject = systemAbilityManager->GetSystemAbility(BUNDLE_MGR_SERVICE_SYS_ABILITY_ID); if (remoteObject == nullptr) { - APP_LOGE("failed to get bundle manager proxy."); + APP_LOGE("null remoteObject"); return nullptr; } @@ -55,13 +55,13 @@ sptr BundleCommandCommon::GetDistributedBundleMgrService() { auto saMgr = OHOS::SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); if (saMgr == nullptr) { - APP_LOGE("saMgr is nullptr"); + APP_LOGE("null saMgr"); return nullptr; } OHOS::sptr remoteObject = saMgr->CheckSystemAbility(OHOS::DISTRIBUTED_BUNDLE_MGR_SERVICE_SYS_ABILITY_ID); if (remoteObject == nullptr) { - APP_LOGE("failed to get distributed bms proxy."); + APP_LOGE("null remoteObject"); return nullptr; } return OHOS::iface_cast(remoteObject); @@ -75,7 +75,7 @@ int32_t BundleCommandCommon::GetCurrentUserId(int32_t userId) std::int32_t localId; int32_t ret = AccountSA::OsAccountManager::GetForegroundOsAccountLocalId(localId); if (ret != 0) { - APP_LOGW("GetForegroundOsAccountLocalId failed! ret = %{public}d.", ret); + APP_LOGW("failed, ret = %{public}d", ret); return userId; } return localId; diff --git a/frameworks/src/bundle_test_tool.cpp b/frameworks/src/bundle_test_tool.cpp index 2be2f3e025d2afd2b022283c8e320fa2447bc503..8cd48484a5102509c0bf5e369b4924ddb7c58c8a 100644 --- a/frameworks/src/bundle_test_tool.cpp +++ b/frameworks/src/bundle_test_tool.cpp @@ -898,7 +898,7 @@ void BundleEventCallbackImpl::OnReceiveEvent(const EventFwk::CommonEventData eve const Want &want = eventData.GetWant(); std::string bundleName = want.GetElement().GetBundleName(); std::string moduleName = want.GetElement().GetModuleName(); - APP_LOGI("OnReceiveEvent, bundleName:%{public}s, moduleName:%{public}s", bundleName.c_str(), moduleName.c_str()); + APP_LOGI("bundleName:%{public}s, moduleName:%{public}s", bundleName.c_str(), moduleName.c_str()); } BundleTestTool::BundleTestTool(int argc, char *argv[]) : ShellCommand(argc, argv, TOOL_NAME) @@ -1079,7 +1079,7 @@ ErrCode BundleTestTool::CheckOperation(int userId, std::string deviceId, std::st sptr bundleToolCallbackStub = new(std::nothrow) BundleToolCallbackStub(cv_, mutex_, dataReady_); if (bundleToolCallbackStub == nullptr) { - APP_LOGE("bundleToolCallbackStub is null"); + APP_LOGE("null bundleToolCallbackStub"); return OHOS::ERR_INVALID_VALUE; } APP_LOGI("CheckAbilityEnableInstall param: userId:%{public}d, bundleName:%{public}s, moduleName:%{public}s," \ @@ -1163,7 +1163,7 @@ bool BundleTestTool::SetIsRemovableOperation( auto ret = bundleMgrProxy_->SetModuleRemovable(bundleName, moduleName, enable); APP_LOGD("SetModuleRemovable end bundleName: %{public}d", ret); if (!ret) { - APP_LOGE("SetIsRemovableOperation failed"); + APP_LOGE("failed"); return false; } return ret; @@ -1666,7 +1666,7 @@ ErrCode BundleTestTool::StringToUnsignedLongLong( std::string optarg, const std::string &commandName, uint64_t &temp, bool &result) { try { - APP_LOGI("StringToUnsignedLongLong start, optarg : %{public}s", optarg.c_str()); + APP_LOGI("start, optarg : %{public}s", optarg.c_str()); if ((optarg == "") || (optarg[0] == '0') || (!isdigit(optarg[0]))) { resultReceiver_.append("error: parameter error, cache size must be greater than 0\n"); return OHOS::ERR_INVALID_VALUE; @@ -2975,7 +2975,7 @@ ErrCode BundleTestTool::RunAsCleanBundleCacheFilesAutomaticCommand() int counter = 0; std::string commandName = "cleanBundleCacheFilesAutomatic"; uint64_t cacheSize; - APP_LOGI("RunAsCleanBundleCacheFilesAutomaticCommand is start"); + APP_LOGI("begin"); while (true) { counter++; int option = getopt_long(argc_, argv_, SHORT_OPTIONS_AUTO_CLEAN_CACHE.c_str(), @@ -3035,7 +3035,7 @@ ErrCode BundleTestTool::RunAsGetContinueBundleName() resultReceiver_.append(msg); return ERR_OK; } else { - APP_LOGE("Get continue bundle name error: %{public}d", result); + APP_LOGE("get continue bundle name error: %{public}d", result); std::string err("Get continue bundle name error!"); resultReceiver_.append(err); } @@ -3046,7 +3046,7 @@ ErrCode BundleTestTool::RunAsGetContinueBundleName() ErrCode BundleTestTool::GetContinueBundleName(const std::string &bundleName, int32_t userId, std::string& msg) { if (bundleMgrProxy_ == nullptr) { - APP_LOGE("Bundle mgr proxy is nullptr"); + APP_LOGE("null bundleMgrProxy_"); return OHOS::ERR_INVALID_VALUE; } std::vector continueBundleName; @@ -3126,7 +3126,7 @@ ErrCode BundleTestTool::RunAsDeployQuickFix() ErrCode BundleTestTool::GetQuickFixPath(int32_t index, std::vector& quickFixPaths) const { - APP_LOGI("GetQuickFixPath start"); + APP_LOGI("begin"); for (; index < argc_ && index >= INDEX_OFFSET; ++index) { if (argList_[index - INDEX_OFFSET] == "-p" || argList_[index - INDEX_OFFSET] == "--patch-path") { break; @@ -3269,19 +3269,19 @@ ErrCode BundleTestTool::DeployQuickFix(const std::vector &quickFixP } sptr recipient(new (std::nothrow) BundleDeathRecipient(nullptr, callback)); if (recipient == nullptr) { - APP_LOGE("recipient is null"); + APP_LOGE("null recipient"); return ERR_BUNDLEMANAGER_QUICK_FIX_INTERNAL_ERROR; } bundleMgrProxy_->AsObject()->AddDeathRecipient(recipient); auto quickFixProxy = bundleMgrProxy_->GetQuickFixManagerProxy(); if (quickFixProxy == nullptr) { - APP_LOGE("quickFixProxy is null"); + APP_LOGE("null quickFixProxy"); return ERR_BUNDLEMANAGER_QUICK_FIX_INTERNAL_ERROR; } std::vector destFiles; auto res = quickFixProxy->CopyFiles(pathVec, destFiles); if (res != ERR_OK) { - APP_LOGE("Copy files failed with %{public}d.", res); + APP_LOGE("copy files failed with %{public}d", res); return res; } res = quickFixProxy->DeployQuickFix(destFiles, callback, isDebug); @@ -3308,13 +3308,13 @@ ErrCode BundleTestTool::SwitchQuickFix(const std::string &bundleName, int32_t en } sptr recipient(new (std::nothrow) BundleDeathRecipient(nullptr, callback)); if (recipient == nullptr) { - APP_LOGE("recipient is null"); + APP_LOGE("null recipient"); return ERR_BUNDLEMANAGER_QUICK_FIX_INTERNAL_ERROR; } bundleMgrProxy_->AsObject()->AddDeathRecipient(recipient); auto quickFixProxy = bundleMgrProxy_->GetQuickFixManagerProxy(); if (quickFixProxy == nullptr) { - APP_LOGE("quickFixProxy is null"); + APP_LOGE("null quickFixProxy"); return ERR_BUNDLEMANAGER_QUICK_FIX_INTERNAL_ERROR; } bool enableFlag = (enable == 0) ? false : true; @@ -3341,13 +3341,13 @@ ErrCode BundleTestTool::DeleteQuickFix(const std::string &bundleName, } sptr recipient(new (std::nothrow) BundleDeathRecipient(nullptr, callback)); if (recipient == nullptr) { - APP_LOGE("recipient is null"); + APP_LOGE("null recipient"); return ERR_BUNDLEMANAGER_QUICK_FIX_INTERNAL_ERROR; } bundleMgrProxy_->AsObject()->AddDeathRecipient(recipient); auto quickFixProxy = bundleMgrProxy_->GetQuickFixManagerProxy(); if (quickFixProxy == nullptr) { - APP_LOGE("quickFixProxy is null"); + APP_LOGE("null quickFixProxy"); return ERR_BUNDLEMANAGER_QUICK_FIX_INTERNAL_ERROR; } auto res = quickFixProxy->DeleteQuickFix(bundleName, callback); @@ -3439,12 +3439,12 @@ ErrCode BundleTestTool::RunAsSetDebugMode() ErrCode BundleTestTool::SetDebugMode(int32_t debugMode) { if (debugMode != 0 && debugMode != 1) { - APP_LOGE("SetDebugMode param is invalid"); + APP_LOGE("param is invalid"); return ERR_BUNDLEMANAGER_SET_DEBUG_MODE_INVALID_PARAM; } bool enable = debugMode == 0 ? false : true; if (bundleMgrProxy_ == nullptr) { - APP_LOGE("bundleMgrProxy_ is nullptr"); + APP_LOGE("null bundleMgrProxy_"); return ERR_BUNDLEMANAGER_SET_DEBUG_MODE_INTERNAL_ERROR; } return bundleMgrProxy_->SetDebugMode(enable); @@ -3566,7 +3566,7 @@ bool BundleTestTool::GetBundleStats(const std::string &bundleName, int32_t userI std::string& msg, int32_t appIndex) { if (bundleMgrProxy_ == nullptr) { - APP_LOGE("bundleMgrProxy_ is nullptr"); + APP_LOGE("null bundleMgrProxy_"); return false; } userId = BundleCommandCommon::GetCurrentUserId(userId); @@ -3605,7 +3605,7 @@ ErrCode BundleTestTool::GetAppProvisionInfo(const std::string &bundleName, int32_t userId, std::string& msg) { if (bundleMgrProxy_ == nullptr) { - APP_LOGE("bundleMgrProxy_ is nullptr"); + APP_LOGE("null bundleMgrProxy_"); return OHOS::ERR_INVALID_VALUE; } userId = BundleCommandCommon::GetCurrentUserId(userId); @@ -3670,7 +3670,7 @@ ErrCode BundleTestTool::RunAsGetDistributedBundleName() resultReceiver_ = STRING_GET_DISTRIBUTED_BUNDLE_NAME_OK + msg; } else { resultReceiver_ = STRING_GET_DISTRIBUTED_BUNDLE_NAME_NG + "\n"; - APP_LOGE("RunAsGetDistributedBundleName fail result %{public}d.", result); + APP_LOGE("fail, result %{public}d", result); } return result; } @@ -3710,7 +3710,7 @@ ErrCode BundleTestTool::GetDistributedBundleName(const std::string &networkId, { #ifdef DISTRIBUTED_BUNDLE_FRAMEWORK if (distributedBmsProxy_ == nullptr) { - APP_LOGE("distributedBmsProxy_ is nullptr"); + APP_LOGE("null distributedBmsProxy_"); return OHOS::ERR_INVALID_VALUE; } std::string bundleName; @@ -3764,7 +3764,7 @@ bool BundleTestTool::ParseEventCallbackOptions(bool &onlyUnregister, int32_t &ui } } } - APP_LOGI("ParseEventCallbackOptions success"); + APP_LOGI("success"); return true; } @@ -3813,7 +3813,7 @@ bool BundleTestTool::ParseResetAOTCompileStatusOptions(std::string &bundleName, } } } - APP_LOGI("ParseResetAOTCompileStatusOptions success"); + APP_LOGI("success"); return true; } @@ -3826,7 +3826,7 @@ void BundleTestTool::Sleep(int32_t seconds) ErrCode BundleTestTool::CallRegisterBundleEventCallback(sptr bundleEventCallback) { - APP_LOGI("begin to call RegisterBundleEventCallback"); + APP_LOGI("begin"); std::string msg; bool ret = bundleMgrProxy_->RegisterBundleEventCallback(bundleEventCallback); if (!ret) { @@ -3843,7 +3843,7 @@ ErrCode BundleTestTool::CallRegisterBundleEventCallback(sptr bundleEventCallback) { - APP_LOGI("begin to call UnregisterBundleEventCallback"); + APP_LOGI("begin"); std::string msg; bool ret = bundleMgrProxy_->UnregisterBundleEventCallback(bundleEventCallback); if (!ret) { @@ -3860,7 +3860,7 @@ ErrCode BundleTestTool::CallUnRegisterBundleEventCallback(sptr infos; @@ -3982,7 +3982,7 @@ bool BundleTestTool::QueryDataGroupInfos(const std::string &bundleName, ErrCode BundleTestTool::RunAsGetGroupDir() { - APP_LOGI("RunAsGetGroupDir start"); + APP_LOGI("begin"); ErrCode result; std::string dataGroupId; int32_t counter = 0; @@ -4013,7 +4013,7 @@ ErrCode BundleTestTool::RunAsGetGroupDir() resultReceiver_ = STRING_GET_GROUP_DIR_OK + msg; } else { resultReceiver_ = STRING_GET_GROUP_DIR_NG + "\n"; - APP_LOGE("RunAsGetGroupDir fail"); + APP_LOGE("fail"); return OHOS::ERR_INVALID_VALUE; } return result; @@ -4045,7 +4045,7 @@ ErrCode BundleTestTool::CheckGetGroupIdCorrectOption(int32_t option, std::string bool BundleTestTool::GetGroupDir(const std::string &dataGroupId, std::string& msg) { if (bundleMgrProxy_ == nullptr) { - APP_LOGE("bundleMgrProxy_ is nullptr"); + APP_LOGE("null bundleMgrProxy_"); return OHOS::ERR_INVALID_VALUE; } std::string dir; @@ -4085,7 +4085,7 @@ ErrCode BundleTestTool::CheckGetBundleNameOption(int32_t option, std::string &bu ErrCode BundleTestTool::RunAsGetJsonProfile() { - APP_LOGI("RunAsGetJsonProfile start"); + APP_LOGI("begin"); int result = OHOS::ERR_OK; int counter = 0; std::string commandName = "getJsonProfile"; @@ -4141,7 +4141,7 @@ ErrCode BundleTestTool::RunAsGetJsonProfile() ErrCode BundleTestTool::RunGetUidByBundleName() { - APP_LOGI("RunGetUidByBundleName start"); + APP_LOGI("begin"); int result = OHOS::ERR_OK; int counter = 0; std::string name = ""; @@ -4192,7 +4192,7 @@ ErrCode BundleTestTool::RunGetUidByBundleName() ErrCode BundleTestTool::RunAsGetUninstalledBundleInfo() { - APP_LOGI("RunAsGetUninstalledBundleInfo start"); + APP_LOGI("begin"); int result = OHOS::ERR_OK; int counter = 0; std::string bundleName = ""; @@ -4349,7 +4349,7 @@ ErrCode BundleTestTool::ImplicitQuerySkillUriInfo(const std::string &bundleName, const std::string &type, std::string &msg) { if (bundleMgrProxy_ == nullptr) { - APP_LOGE("bundleMgrProxy_ is nullptr"); + APP_LOGE("null bundleMgrProxy_"); return OHOS::ERR_INVALID_VALUE; } AAFwk::Want want; @@ -4391,7 +4391,7 @@ ErrCode BundleTestTool::ImplicitQuerySkillUriInfo(const std::string &bundleName, ErrCode BundleTestTool::RunAsImplicitQuerySkillUriInfo() { - APP_LOGI("RunAsGetAbilityInfoWithSkillUriFlag start"); + APP_LOGI("begin"); int result = OHOS::ERR_OK; int counter = 0; std::string bundleName = ""; @@ -4441,7 +4441,7 @@ ErrCode BundleTestTool::RunAsImplicitQuerySkillUriInfo() ErrCode BundleTestTool::RunAsQueryAbilityInfoByContinueType() { - APP_LOGI("RunAsQueryAbilityInfoByContinueType start"); + APP_LOGI("begin"); int result = OHOS::ERR_OK; int counter = 0; std::string commandName = "queryAbilityInfoByContinueType"; @@ -4492,7 +4492,7 @@ ErrCode BundleTestTool::RunAsQueryAbilityInfoByContinueType() ErrCode BundleTestTool::RunAsGetDirByBundleNameAndAppIndex() { - APP_LOGI("RunAsGetDirByBundleNameAndAppIndex start"); + APP_LOGI("begin"); std::string commandName = "getDirByBundleNameAndAppIndex"; int32_t result = OHOS::ERR_OK; int32_t counter = 0; @@ -4543,7 +4543,7 @@ ErrCode BundleTestTool::RunAsGetDirByBundleNameAndAppIndex() ErrCode BundleTestTool::RunAsIsBundleInstalled() { - APP_LOGI("RunAsIsBundleInstalled start"); + APP_LOGI("begin"); std::string commandName = "isBundleInstalled"; int32_t result = OHOS::ERR_OK; int32_t counter = 0; diff --git a/frameworks/src/bundle_tool_callback/bundle_tool_callback_stub.cpp b/frameworks/src/bundle_tool_callback/bundle_tool_callback_stub.cpp index 425a3a9b2446a845fca60ad40e8c578f7a916d79..8d9835d94198577804f46fefbf1f3dfe406a7c0a 100644 --- a/frameworks/src/bundle_tool_callback/bundle_tool_callback_stub.cpp +++ b/frameworks/src/bundle_tool_callback/bundle_tool_callback_stub.cpp @@ -24,7 +24,7 @@ namespace AppExecFwk { int32_t BundleToolCallbackStub::OnRemoteRequest( uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) { - APP_LOGI("bundle mgr callback onReceived message, the message code is %{public}u", code); + APP_LOGI("message code is %{public}u", code); std::unique_lock lock(mutex_); std::u16string descriptor = BundleToolCallbackStub::GetDescriptor(); std::u16string token = data.ReadInterfaceToken(); @@ -35,7 +35,7 @@ int32_t BundleToolCallbackStub::OnRemoteRequest( int32_t resultCode = data.ReadInt32(); uint32_t versionCode = data.ReadUint32(); int32_t missionId = data.ReadInt32(); - APP_LOGI("BundleToolCallbackStub: resultCode:%{public}d, versionCode:%{public}d, missionId:%{public}d", + APP_LOGI("resultCode:%{public}d, versionCode:%{public}d, missionId:%{public}d", resultCode, versionCode, missionId); dataReady_ = true; cv_.notify_all(); diff --git a/frameworks/src/shell_command.cpp b/frameworks/src/shell_command.cpp index b3010745cb24ed95e0f34f9ba77235fb29be0f1d..f4e72b56efe88716abb4866f29eeb45e06e9c9a1 100644 --- a/frameworks/src/shell_command.cpp +++ b/frameworks/src/shell_command.cpp @@ -106,8 +106,7 @@ std::string ShellCommand::GetUnknownOptionMsg(std::string &unknownOption) const std::string ShellCommand::GetMessageFromCode(const int32_t code) const { - APP_LOGI("[%{public}s(%{public}s)] enter", __FILE__, __FUNCTION__); - APP_LOGI("code = %{public}d", code); + APP_LOGI("enter, code = %{public}d", code); std::string result = ""; if (messageMap_.find(code) != messageMap_.end()) {