From 8203d89890230821d974317477cb5e9bdd06f1da Mon Sep 17 00:00:00 2001 From: shuaiyutao Date: Thu, 7 Apr 2022 14:59:25 +0800 Subject: [PATCH] fix codedex Change-Id: I8f1fcaf3469a58f5ba2185f74d62c8f89111e9c9 Signed-off-by: shuaiyutao --- kits/appkit/napi/bundlemgr/bundle_mgr.cpp | 2 +- kits/appkit/napi/bundlemgr/bundle_mgr.h | 12 ++++++------ services/bundlemgr/src/bundle_permission_mgr.cpp | 6 +++--- services/dbms/src/distributed_bms.cpp | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/kits/appkit/napi/bundlemgr/bundle_mgr.cpp b/kits/appkit/napi/bundlemgr/bundle_mgr.cpp index 884e83224..9f0a7759c 100644 --- a/kits/appkit/napi/bundlemgr/bundle_mgr.cpp +++ b/kits/appkit/napi/bundlemgr/bundle_mgr.cpp @@ -1481,7 +1481,7 @@ static bool ParseWant(napi_env env, Want &want, napi_value args) if (elementUri.empty()) { elementUri = wantUri; } - APP_LOGD("deviceId:%{public}s, bundleName:%{public}s, abilityName:%{public}s", + APP_LOGD("deviceId:%{private}s, bundleName:%{public}s, abilityName:%{public}s", elementDeviceId.c_str(), elementBundleName.c_str(), elementAbilityName.c_str()); APP_LOGD("action:%{public}s, uri:%{private}s, type:%{public}s, flags:%{public}d", wantAction.c_str(), elementUri.c_str(), wantType.c_str(), wantFlags); diff --git a/kits/appkit/napi/bundlemgr/bundle_mgr.h b/kits/appkit/napi/bundlemgr/bundle_mgr.h index 931598359..2a51d12a4 100644 --- a/kits/appkit/napi/bundlemgr/bundle_mgr.h +++ b/kits/appkit/napi/bundlemgr/bundle_mgr.h @@ -85,7 +85,7 @@ struct AsyncApplicationInfoCallbackInfo : public AsyncWorkData { explicit AsyncApplicationInfoCallbackInfo(napi_env env) : AsyncWorkData(env) {} std::string bundleName; int32_t flags = 0; - int32_t userId; + int32_t userId = Constants::UNSPECIFIED_USERID; OHOS::AppExecFwk::ApplicationInfo appInfo; bool ret = false; int32_t err = 0; @@ -114,7 +114,7 @@ struct AsyncBundleInfosCallbackInfo : public AsyncWorkData { struct AsyncApplicationInfosCallbackInfo : public AsyncWorkData { explicit AsyncApplicationInfosCallbackInfo(napi_env env) : AsyncWorkData(env) {} int32_t flags = 0; - int32_t userId = 0; + int32_t userId = Constants::UNSPECIFIED_USERID; std::vector appInfos; bool ret = false; int32_t err = 0; @@ -132,7 +132,7 @@ struct AsyncAbilityLabelCallbackInfo : public AsyncWorkData { struct InstallResult { std::string resultMsg; - int32_t resultCode; + int32_t resultCode = 0; }; struct AsyncInstallCallbackInfo : public AsyncWorkData { @@ -201,7 +201,7 @@ struct AsyncExtensionInfoCallbackInfo : public AsyncWorkData { struct AsyncGetNameByUidInfo : public AsyncWorkData { explicit AsyncGetNameByUidInfo(napi_env env) : AsyncWorkData(env) {} - int32_t uid; + int32_t uid = 0; std::string bundleName; int32_t err = 0; bool ret = false; @@ -227,8 +227,8 @@ struct AsyncHandleBundleContext : public AsyncWorkData { OHOS::sptr cleanCacheCallback; std::string bundleName; std::string className; - int32_t labelId; - int32_t iconId; + int32_t labelId = 0; + int32_t iconId = 0; bool ret = false; int32_t err = 0; }; diff --git a/services/bundlemgr/src/bundle_permission_mgr.cpp b/services/bundlemgr/src/bundle_permission_mgr.cpp index cd061184a..15223c0c7 100644 --- a/services/bundlemgr/src/bundle_permission_mgr.cpp +++ b/services/bundlemgr/src/bundle_permission_mgr.cpp @@ -278,7 +278,7 @@ bool BundlePermissionMgr::AddDefineAndRequestPermissions(const Security::AccessT int32_t BundlePermissionMgr::DeleteAccessTokenId(const AccessToken::AccessTokenID tokenId) { - APP_LOGD("BundlePermissionMgr::DeleteAccessTokenId tokenId : %{public}u", tokenId); + APP_LOGD("BundlePermissionMgr::DeleteAccessTokenId tokenId : %{private}u", tokenId); return AccessToken::AccessTokenKit::DeleteToken(tokenId); } @@ -432,7 +432,7 @@ bool BundlePermissionMgr::GetRequestPermissionStates(BundleInfo &bundleInfo) return perm.permissionName == req; }); if (iter != allPermissionState.end()) { - APP_LOGD("GetRequestPermissionStates request permission name : %{public}s, deviceId : %{public}s", + APP_LOGD("GetRequestPermissionStates request permission name: %{public}s, deviceId: %{private}s", req.c_str(), deviceId.c_str()); for (std::vector::size_type i = 0; i < iter->resDeviceID.size(); i++) { if (iter->resDeviceID[i] == deviceId) { @@ -494,7 +494,7 @@ bool BundlePermissionMgr::VerifyCallingPermission(const std::string &permissionN { APP_LOGD("VerifyCallingPermission permission %{public}s", permissionName.c_str()); AccessToken::AccessTokenID callerToken = IPCSkeleton::GetCallingTokenID(); - APP_LOGD("callerToken : %{public}u", callerToken); + APP_LOGD("callerToken : %{private}u", callerToken); AccessToken::ATokenTypeEnum tokenType = AccessToken::AccessTokenKit::GetTokenTypeFlag(callerToken); if (tokenType == AccessToken::ATokenTypeEnum::TOKEN_NATIVE) { APP_LOGD("caller tokenType is native, verify success"); diff --git a/services/dbms/src/distributed_bms.cpp b/services/dbms/src/distributed_bms.cpp index 2a39fb177..cd8cf3154 100644 --- a/services/dbms/src/distributed_bms.cpp +++ b/services/dbms/src/distributed_bms.cpp @@ -110,7 +110,7 @@ static OHOS::sptr GetDistributedBundleMgr(con APP_LOGI("GetDistributedBundleMgr"); auto samgr = OHOS::SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); OHOS::sptr remoteObject; - APP_LOGD("GetDistributedBundleMgr deviceId:%{public}s", deviceId.c_str()); + APP_LOGD("GetDistributedBundleMgr deviceId:%{private}s", deviceId.c_str()); if (deviceId.empty()) { return nullptr; } else {