From f82af760915d01331f386b7ca013e1f06250a2c7 Mon Sep 17 00:00:00 2001 From: liuzhongming Date: Fri, 16 May 2025 11:44:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A5=E5=BF=97=E4=BC=98=E5=8C=96=20Signed-o?= =?UTF-8?q?ff-by:=20liuzhongming=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../native_cpp/src/device_manager_impl.cpp | 26 +++--- .../src/ipc/standard/dm_service_load.cpp | 2 +- .../src/ipc/standard/ipc_client_manager.cpp | 15 ++-- .../src/ipc/standard/ipc_cmd_parser.cpp | 5 ++ .../src/notify/device_manager_notify.cpp | 76 ++++++++-------- .../authentication/auth_message_processor.cpp | 19 ++-- .../src/authentication/dm_auth_manager.cpp | 4 +- .../src/config/dm_config_manager.cpp | 13 --- .../src/credential/dm_credential_manager.cpp | 16 ++-- .../MSDP/spatial_location_callback_impl.cpp | 2 +- .../hichain/hichain_auth_connector.cpp | 57 +++++------- .../dependency/softbus/softbus_connector.cpp | 30 +++---- .../src/device_manager_service_impl.cpp | 89 +++++++++---------- .../devicestate/dm_device_state_manager.cpp | 38 ++++---- .../src/advertise/advertise_manager.cpp | 11 ++- .../service/src/device_manager_service.cpp | 59 +++--------- .../src/device_manager_service_listener.cpp | 18 ++-- .../src/devicenamemgr/device_name_manager.cpp | 2 +- .../src/discovery/discovery_manager.cpp | 43 +++++---- .../service/src/hichain/hichain_listener.cpp | 16 ++-- .../src/ipc/standard/ipc_server_listener.cpp | 2 +- .../src/ipc/standard/ipc_server_stub.cpp | 11 +-- .../standard/permission_manager.cpp | 21 +---- .../src/pinholder/pin_holder_session.cpp | 6 +- .../src/relationshipsyncmgr/dm_comm_tool.cpp | 18 ++-- .../service/src/softbus/softbus_listener.cpp | 38 ++++---- .../service/src/softbus/softbus_publish.cpp | 10 +-- .../softbuscache/src/dm_softbus_cache.cpp | 52 +++++------ utils/src/appInfo/standard/app_manager.cpp | 3 +- .../standard/dm_distributed_hardware_load.cpp | 6 +- utils/src/timer/dm_timer.cpp | 6 +- 31 files changed, 304 insertions(+), 410 deletions(-) diff --git a/interfaces/inner_kits/native_cpp/src/device_manager_impl.cpp b/interfaces/inner_kits/native_cpp/src/device_manager_impl.cpp index a2af88d1a..059d6a21b 100644 --- a/interfaces/inner_kits/native_cpp/src/device_manager_impl.cpp +++ b/interfaces/inner_kits/native_cpp/src/device_manager_impl.cpp @@ -1010,7 +1010,7 @@ int32_t DeviceManagerImpl::RequestCredential(const std::string &pkgName, const s "%{public}s", pkgName.c_str(), GetAnonyString(reqJsonStr).c_str()); return ERR_DM_INPUT_PARA_INVALID; } - LOGI("start to RequestCredential."); + LOGI("start."); std::map requestParam; requestParam.emplace(DM_CREDENTIAL_TYPE, DM_TYPE_OH); requestParam.emplace(DM_CREDENTIAL_REQJSONSTR, reqJsonStr); @@ -1032,7 +1032,7 @@ int32_t DeviceManagerImpl::RequestCredential(const std::string &pkgName, const s return ret; } returnJsonStr = rsp->GetCredentialResult(); - LOGI("request device credential completed."); + LOGI("completed."); return DM_OK; } @@ -1043,7 +1043,7 @@ int32_t DeviceManagerImpl::ImportCredential(const std::string &pkgName, const st pkgName.c_str(), GetAnonyString(credentialInfo).c_str()); return ERR_DM_INPUT_PARA_INVALID; } - LOGI("start to ImportCredential."); + LOGI("start."); std::map requestParam; requestParam.emplace(DM_CREDENTIAL_TYPE, DM_TYPE_OH); requestParam.emplace(DM_CREDENTIAL_REQJSONSTR, credentialInfo); @@ -1064,7 +1064,7 @@ int32_t DeviceManagerImpl::ImportCredential(const std::string &pkgName, const st LOGE("failed to get return errcode while import credential."); return ret; } - LOGI("import credential to device completed."); + LOGI("completed."); return DM_OK; } @@ -1075,7 +1075,7 @@ int32_t DeviceManagerImpl::DeleteCredential(const std::string &pkgName, const st pkgName.c_str(), GetAnonyString(deleteInfo).c_str()); return ERR_DM_INPUT_PARA_INVALID; } - LOGI("start to DeleteCredential."); + LOGI("start."); std::map requestParam; requestParam.emplace(DM_CREDENTIAL_TYPE, DM_TYPE_OH); requestParam.emplace(DM_CREDENTIAL_REQJSONSTR, deleteInfo); @@ -1096,7 +1096,7 @@ int32_t DeviceManagerImpl::DeleteCredential(const std::string &pkgName, const st LOGE("failed to get return errcode while import credential."); return ret; } - LOGI("delete credential from device completed."); + LOGI("completed."); return DM_OK; } @@ -1125,7 +1125,7 @@ int32_t DeviceManagerImpl::RegisterCredentialCallback(const std::string &pkgName LOGE("RegisterCredentialCallback error: Failed with ret %{public}d", ret); return ret; } - LOGI("Completed, pkgName: %{public}s", pkgName.c_str()); + LOGI("Completed"); return DM_OK; } @@ -1511,7 +1511,7 @@ int32_t DeviceManagerImpl::BindDevice(const std::string &pkgName, int32_t bindTy LOGE("BindDevice error: Invalid para. pkgName : %{public}s", pkgName.c_str()); return ERR_DM_INPUT_PARA_INVALID; } - LOGI("BindDevice start, pkgName: %{public}s", pkgName.c_str()); + LOGI("start, pkgName: %{public}s", pkgName.c_str()); JsonObject paramJson(bindParam); if (paramJson.IsDiscarded()) { LOGE("BindDevice bindParam %{public}s.", bindParam.c_str()); @@ -1584,7 +1584,6 @@ int32_t DeviceManagerImpl::UnBindDevice(const std::string &pkgName, const std::s req->SetPkgName(pkgName); req->SetDeviceId(deviceId); req->SetExtraInfo(extra); - LOGI("DeviceManagerImpl::UnBindDevice extra: %{public}s.", extra.c_str()); int32_t ret = ipcClientProxy_->SendRequest(UNBIND_DEVICE, req, rsp); if (ret != DM_OK) { LOGE("UnBindDevice error: Send Request failed ret: %{public}d", ret); @@ -1857,7 +1856,7 @@ int32_t DeviceManagerImpl::BindTarget(const std::string &pkgName, const PeerTarg LOGE("DeviceManagerImpl::BindTarget failed: input pkgName or targetId is empty."); return ERR_DM_INPUT_PARA_INVALID; } - LOGI("DeviceManagerImpl::BindTarget start, pkgName: %{public}s", pkgName.c_str()); + LOGI("start, pkgName: %{public}s", pkgName.c_str()); #if !(defined(__LITEOS_M__) || defined(LITE_DEVICE)) bindParam[TOKENID] = std::to_string(OHOS::IPCSkeleton::GetSelfTokenID()); #endif @@ -1947,7 +1946,7 @@ int32_t DeviceManagerImpl::CheckAccessToTarget(uint64_t tokenId, const std::stri { (void)tokenId; (void)targetId; - LOGI("Start"); + LOGI("unsupport"); return ERR_DM_UNSUPPORTED_METHOD; } @@ -2122,11 +2121,11 @@ int32_t DeviceManagerImpl::DestroyPinHolder(const std::string &pkgName, const Pe int32_t DeviceManagerImpl::DpAclAdd(const int64_t accessControlId, const std::string &udid, const int32_t bindType) { - LOGI("Start."); if (bindType != IDENTICAL_ACCOUNT) { - LOGI("DeviceManagerImpl::DpAclAdd is not identical account"); + LOGI("not identical account"); return DM_OK; } + LOGI("Start."); std::shared_ptr req = std::make_shared(); std::shared_ptr rsp = std::make_shared(); req->SetStr(udid); @@ -2296,7 +2295,6 @@ int32_t DeviceManagerImpl::ShiftLNNGear(const std::string &pkgName) LOGE("ShiftLNNGear error: Failed with ret %{public}d", ret); return ret; } - LOGI("Completed"); DmRadarHelper::GetInstance().ReportDmBehavior(pkgName, "ShiftLNNGear", DM_OK, anonyLocalUdid_); return DM_OK; } diff --git a/interfaces/inner_kits/native_cpp/src/ipc/standard/dm_service_load.cpp b/interfaces/inner_kits/native_cpp/src/ipc/standard/dm_service_load.cpp index 9bf38b388..baf59b9a6 100644 --- a/interfaces/inner_kits/native_cpp/src/ipc/standard/dm_service_load.cpp +++ b/interfaces/inner_kits/native_cpp/src/ipc/standard/dm_service_load.cpp @@ -27,11 +27,11 @@ DM_IMPLEMENT_SINGLE_INSTANCE(DmServiceLoad); int32_t DmServiceLoad::LoadDMService(void) { - LOGI("LoadDMService start"); if (isDMServiceLoading_) { LOGI("DM service is loading."); return DM_OK; } + LOGI("start"); isDMServiceLoading_ = true; sptr samgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); if (samgr == nullptr) { diff --git a/interfaces/inner_kits/native_cpp/src/ipc/standard/ipc_client_manager.cpp b/interfaces/inner_kits/native_cpp/src/ipc/standard/ipc_client_manager.cpp index 342ab0161..f912db8d9 100644 --- a/interfaces/inner_kits/native_cpp/src/ipc/standard/ipc_client_manager.cpp +++ b/interfaces/inner_kits/native_cpp/src/ipc/standard/ipc_client_manager.cpp @@ -42,12 +42,11 @@ void DmDeathRecipient::OnRemoteDied(const wptr &remote) int32_t IpcClientManager::ClientInit() { - LOGI("Start"); if (dmInterface_ != nullptr) { - LOGI("DeviceManagerService Already Init"); + LOGD("Already Init"); return DM_OK; } - + LOGI("Start"); auto samgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); if (samgr == nullptr) { LOGE("Get SystemAbilityManager Failed"); @@ -68,7 +67,7 @@ int32_t IpcClientManager::ClientInit() LOGE("InitDeviceManagerService: AddDeathRecipient Failed"); } dmInterface_ = iface_cast(object); - LOGI("Completed"); + LOGD("Completed"); return DM_OK; } @@ -111,7 +110,7 @@ int32_t IpcClientManager::UnInit(const std::string &pkgName) LOGE("Invalid parameter, pkgName is empty."); return ERR_DM_INPUT_PARA_INVALID; } - LOGI("UnInit in, pkgName %{public}s", pkgName.c_str()); + LOGI("pkgName %{public}s", pkgName.c_str()); std::lock_guard autoLock(lock_); if (dmInterface_ == nullptr) { LOGE("DeviceManager not Init"); @@ -136,7 +135,7 @@ int32_t IpcClientManager::UnInit(const std::string &pkgName) } dmInterface_ = nullptr; } - LOGI("completed, pkgName: %{public}s", pkgName.c_str()); + LOGD("completed, pkgName: %{public}s", pkgName.c_str()); return DM_OK; } @@ -161,7 +160,7 @@ int32_t IpcClientManager::SendRequest(int32_t cmdCode, std::shared_ptr r int32_t IpcClientManager::OnDmServiceDied() { - LOGI("IpcClientManager::OnDmServiceDied begin"); + LOGI("begin"); { std::lock_guard autoLock(lock_); if (dmInterface_ == nullptr) { @@ -174,7 +173,7 @@ int32_t IpcClientManager::OnDmServiceDied() } dmInterface_ = nullptr; } - LOGI("IpcClientManager::OnDmServiceDied complete"); + LOGD("complete"); return DM_OK; } diff --git a/interfaces/inner_kits/native_cpp/src/ipc/standard/ipc_cmd_parser.cpp b/interfaces/inner_kits/native_cpp/src/ipc/standard/ipc_cmd_parser.cpp index e9dafe949..e5e481d42 100644 --- a/interfaces/inner_kits/native_cpp/src/ipc/standard/ipc_cmd_parser.cpp +++ b/interfaces/inner_kits/native_cpp/src/ipc/standard/ipc_cmd_parser.cpp @@ -437,10 +437,12 @@ ON_IPC_CMD(SERVER_DEVICE_STATE_NOTIFY, MessageParcel &data, MessageParcel &reply IpcModelCodec::DecodeDmDeviceBasicInfo(data, dmDeviceBasicInfo); switch (deviceState) { case DEVICE_STATE_ONLINE: + LOGI("Online pkgName:%{public}s", pkgName.c_str()); DeviceManagerNotify::GetInstance().OnDeviceOnline(pkgName, dmDeviceInfo); DeviceManagerNotify::GetInstance().OnDeviceOnline(pkgName, dmDeviceBasicInfo); break; case DEVICE_STATE_OFFLINE: + LOGI("Offline pkgName:%{public}s", pkgName.c_str()); DeviceManagerNotify::GetInstance().OnDeviceOffline(pkgName, dmDeviceInfo); DeviceManagerNotify::GetInstance().OnDeviceOffline(pkgName, dmDeviceBasicInfo); break; @@ -449,6 +451,8 @@ ON_IPC_CMD(SERVER_DEVICE_STATE_NOTIFY, MessageParcel &data, MessageParcel &reply DeviceManagerNotify::GetInstance().OnDeviceChanged(pkgName, dmDeviceBasicInfo); break; case DEVICE_INFO_READY: + LOGI("OnDeviceReady in, pkgName:%{public}s, networkId: %{public}s.", + pkgName.c_str(), GetAnonyString(dmDeviceInfo.networkId).c_str()); DeviceManagerNotify::GetInstance().OnDeviceReady(pkgName, dmDeviceInfo); DeviceManagerNotify::GetInstance().OnDeviceReady(pkgName, dmDeviceBasicInfo); break; @@ -468,6 +472,7 @@ ON_IPC_CMD(SERVER_DEVICE_FOUND, MessageParcel &data, MessageParcel &reply) IpcModelCodec::DecodeDmDeviceInfo(data, dmDeviceInfo); DmDeviceBasicInfo devBasicInfo; IpcModelCodec::DecodeDmDeviceBasicInfo(data, devBasicInfo); + LOGD("pkgName:%{public}s, subscribeId:%{public}d.", GetAnonyString(pkgName).c_str(), (int32_t)subscribeId); DeviceManagerNotify::GetInstance().OnDeviceFound(pkgName, subscribeId, dmDeviceInfo); DeviceManagerNotify::GetInstance().OnDeviceFound(pkgName, subscribeId, devBasicInfo); reply.WriteInt32(DM_OK); diff --git a/interfaces/inner_kits/native_cpp/src/notify/device_manager_notify.cpp b/interfaces/inner_kits/native_cpp/src/notify/device_manager_notify.cpp index a7b8b5867..b12abce24 100644 --- a/interfaces/inner_kits/native_cpp/src/notify/device_manager_notify.cpp +++ b/interfaces/inner_kits/native_cpp/src/notify/device_manager_notify.cpp @@ -263,10 +263,10 @@ void DeviceManagerNotify::RegisterPinHolderCallback(const std::string &pkgName, void DeviceManagerNotify::OnRemoteDied() { - LOGW("DeviceManagerNotify::OnRemoteDied"); + LOGW("OnRemoteDied"); std::map> dmInitCallback = GetDmInitCallback(); for (auto iter : dmInitCallback) { - LOGI("DeviceManagerNotify::OnRemoteDied, pkgName:%{public}s", iter.first.c_str()); + LOGI("OnRemoteDied, pkgName:%{public}s", iter.first.c_str()); if (iter.second != nullptr) { iter.second->OnRemoteDied(); } @@ -279,13 +279,14 @@ void DeviceManagerNotify::OnDeviceOnline(const std::string &pkgName, const DmDev LOGE("Invalid parameter, pkgName is empty."); return; } - LOGI("Online with DmDeviceInfo, pkgName:%{public}s", pkgName.c_str()); std::shared_ptr tempCbk; { std::lock_guard autoLock(lock_); auto iter = deviceStateCallback_.find(pkgName); if (iter == deviceStateCallback_.end()) { - LOGE("OnDeviceOnline error, device state callback not register."); + if (deviceStatusCallback_.find(pkgName) == deviceStatusCallback_.end()) { + LOGE("OnDeviceOnline error, device state callback not register."); + } return; } tempCbk = iter->second; @@ -311,13 +312,14 @@ void DeviceManagerNotify::OnDeviceOnline(const std::string &pkgName, const DmDev LOGE("Invalid parameter, pkgName is empty."); return; } - LOGI("Online with DmDeviceBasicInfo, pkgName:%{public}s", pkgName.c_str()); std::shared_ptr tempCbk; { std::lock_guard autoLock(lock_); auto iter = deviceStatusCallback_.find(pkgName); if (iter == deviceStatusCallback_.end()) { - LOGE("Error, device status callback not register."); + if (deviceStateCallback_.find(pkgName) == deviceStateCallback_.end()) { + LOGE("Error, device status callback not register."); + } return; } tempCbk = iter->second; @@ -343,13 +345,14 @@ void DeviceManagerNotify::OnDeviceOffline(const std::string &pkgName, const DmDe LOGE("Invalid parameter, pkgName is empty."); return; } - LOGI("Offline with DmDeviceInfo, pkgName:%{public}s", pkgName.c_str()); std::shared_ptr tempCbk; { std::lock_guard autoLock(lock_); auto iter = deviceStateCallback_.find(pkgName); if (iter == deviceStateCallback_.end()) { - LOGE("Error, device state callback not register."); + if (deviceStatusCallback_.find(pkgName) == deviceStatusCallback_.end()) { + LOGE("Error, device state callback not register."); + } return; } tempCbk = iter->second; @@ -376,13 +379,14 @@ void DeviceManagerNotify::OnDeviceOffline(const std::string &pkgName, const DmDe LOGE("Invalid parameter, pkgName is empty."); return; } - LOGI("Offline with DmDeviceBasicInfo, pkgName:%{public}s", pkgName.c_str()); std::shared_ptr tempCbk; { std::lock_guard autoLock(lock_); auto iter = deviceStatusCallback_.find(pkgName); if (iter == deviceStatusCallback_.end()) { - LOGE("Error, device status callback not register."); + if (deviceStateCallback_.find(pkgName) == deviceStateCallback_.end()) { + LOGE("Error, device status callback not register."); + } return; } tempCbk = iter->second; @@ -414,7 +418,9 @@ void DeviceManagerNotify::OnDeviceChanged(const std::string &pkgName, const DmDe std::lock_guard autoLock(lock_); auto iter = deviceStateCallback_.find(pkgName); if (iter == deviceStateCallback_.end()) { - LOGE("OnDeviceChanged error, device state callback not register, pkgName:%{public}s", pkgName.c_str()); + if (deviceStatusCallback_.find(pkgName) == deviceStatusCallback_.end()) { + LOGE("error, device state callback not register, pkgName:%{public}s",pkgName.c_str()); + } return; } tempCbk = iter->second; @@ -446,7 +452,9 @@ void DeviceManagerNotify::OnDeviceChanged(const std::string &pkgName, const DmDe std::lock_guard autoLock(lock_); auto iter = deviceStatusCallback_.find(pkgName); if (iter == deviceStatusCallback_.end()) { - LOGE("OnDeviceChanged error, device state callback not register, pkgName:%{public}s", pkgName.c_str()); + if (deviceStateCallback_.find(pkgName) == deviceStateCallback_.end()) { + LOGE("error, device state callback not register, pkgName:%{public}s", pkgName.c_str()); + } return; } tempCbk = iter->second; @@ -478,7 +486,9 @@ void DeviceManagerNotify::OnDeviceReady(const std::string &pkgName, const DmDevi std::lock_guard autoLock(lock_); auto iter = deviceStateCallback_.find(pkgName); if (iter == deviceStateCallback_.end()) { - LOGE("OnDeviceReady error, device state callback not register, pkgName:%{public}s", pkgName.c_str()); + if (deviceStatusCallback_.find(pkgName) == deviceStatusCallback_.end()) { + LOGE("error, device state callback not register, pkgName:%{public}s", pkgName.c_str()); + } return; } tempCbk = iter->second; @@ -487,8 +497,6 @@ void DeviceManagerNotify::OnDeviceReady(const std::string &pkgName, const DmDevi LOGE("OnDeviceReady error, registered device state callback is nullptr, pkgName:%{public}s", pkgName.c_str()); return; } - LOGE("OnDeviceReady in, pkgName:%{public}s, networkId: %{public}s.", - pkgName.c_str(), GetAnonyString(deviceInfo.networkId).c_str()); #if !(defined(__LITEOS_M__) || defined(LITE_DEVICE)) ffrt::submit([=]() { DeviceInfoReady(deviceInfo, tempCbk); }); #else @@ -506,13 +514,14 @@ void DeviceManagerNotify::OnDeviceReady(const std::string &pkgName, const DmDevi LOGE("Invalid parameter, pkgName is empty."); return; } - LOGI("DeviceManagerNotify::OnDeviceReady with DmDeviceBasicInfo, pkgName:%{public}s", pkgName.c_str()); std::shared_ptr tempCbk; { std::lock_guard autoLock(lock_); auto iter = deviceStatusCallback_.find(pkgName); if (iter == deviceStatusCallback_.end()) { - LOGE("OnDeviceReady error, device status callback not register, pkgName:%{public}s", pkgName.c_str()); + if (deviceStateCallback_.find(pkgName) != deviceStateCallback_.end()) { + LOGE("error, device status callback not register, pkgName:%{public}s", pkgName.c_str()); + } return; } tempCbk = iter->second; @@ -535,8 +544,6 @@ void DeviceManagerNotify::OnDeviceReady(const std::string &pkgName, const DmDevi void DeviceManagerNotify::OnDeviceFound(const std::string &pkgName, uint16_t subscribeId, const DmDeviceInfo &deviceInfo) { - LOGD("pkgName:%{public}s, subscribeId:%{public}d.", - GetAnonyString(pkgName).c_str(), (int32_t)subscribeId); if (pkgName.empty()) { LOGE("Invalid parameter, pkgName is empty."); return; @@ -552,8 +559,6 @@ void DeviceManagerNotify::OnDeviceFound(const std::string &pkgName, uint16_t sub void DeviceManagerNotify::OnDeviceFound(const std::string &pkgName, uint16_t subscribeId, const DmDeviceBasicInfo &deviceBasicInfo) { - LOGD("pkgName:%{public}s, subscribeId:%{public}d.", - GetAnonyString(pkgName).c_str(), (int32_t)subscribeId); if (pkgName.empty()) { LOGE("Invalid parameter, pkgName is empty."); return; @@ -572,7 +577,7 @@ void DeviceManagerNotify::OnDiscoveryFailed(const std::string &pkgName, uint16_t LOGE("Invalid parameter, pkgName is empty."); return; } - LOGI("DeviceManagerNotify::OnDiscoveryFailed in, pkgName:%{public}s, subscribeId %{public}d, failed" + LOGE("in, pkgName:%{public}s, subscribeId %{public}d, failed" "reason %{public}d", pkgName.c_str(), (int32_t)subscribeId, failedReason); std::shared_ptr tempCbk = GetDiscoveryCallback(pkgName, subscribeId); if (tempCbk == nullptr) { @@ -603,7 +608,7 @@ void DeviceManagerNotify::OnPublishResult(const std::string &pkgName, int32_t pu LOGE("Invalid parameter, pkgName is empty."); return; } - LOGI("DeviceManagerNotify::OnPublishResult in, pkgName:%{public}s, publishId %{public}d, publishResult %{public}d", + LOGI("in, pkgName:%{public}s, publishId %{public}d, publishResult %{public}d", pkgName.c_str(), publishId, publishResult); std::shared_ptr tempCbk; { @@ -635,8 +640,7 @@ void DeviceManagerNotify::OnAuthResult(const std::string &pkgName, const std::st LOGE("Invalid para, pkgName: %{public}s, token: %{public}s", pkgName.c_str(), GetAnonyString(token).c_str()); return; } - LOGI("DeviceManagerNotify::OnAuthResult in, pkgName:%{public}s, status:%{public}d, reason:%{public}d", - pkgName.c_str(), status, reason); + LOGI("in, pkgName:%{public}s, status:%{public}d, reason:%{public}d", pkgName.c_str(), status, reason); std::shared_ptr tempCbk; { std::lock_guard autoLock(lock_); @@ -677,7 +681,7 @@ void DeviceManagerNotify::OnUiCall(std::string &pkgName, std::string ¶mJson) LOGE("DeviceManagerNotify::OnUiCall error: Invalid parameter, pkgName: %{public}s", pkgName.c_str()); return; } - LOGI("DeviceManagerNotify::OnUiCall in, pkgName:%{public}s", pkgName.c_str()); + LOGI("in, pkgName:%{public}s", pkgName.c_str()); std::shared_ptr tempCbk; { std::lock_guard autoLock(lock_); @@ -701,7 +705,7 @@ void DeviceManagerNotify::OnCredentialResult(const std::string &pkgName, int32_t LOGE("DeviceManagerNotify::OnCredentialResult error: Invalid parameter, pkgName: %{public}s", pkgName.c_str()); return; } - LOGI("DeviceManagerNotify::OnCredentialResult in, pkgName:%{public}s, action:%{public}d", pkgName.c_str(), action); + LOGI("in, pkgName:%{public}s, action:%{public}d", pkgName.c_str(), action); std::shared_ptr tempCbk; { std::lock_guard autoLock(lock_); @@ -756,7 +760,7 @@ void DeviceManagerNotify::OnBindResult(const std::string &pkgName, const PeerTar LOGE("Invalid para, pkgName: %{public}s.", pkgName.c_str()); return; } - LOGI("DeviceManagerNotify::OnBindResult in, pkgName:%{public}s, result:%{public}d", pkgName.c_str(), result); + LOGI("in, pkgName:%{public}s, result:%{public}d", pkgName.c_str(), result); std::shared_ptr tempCbk; { std::lock_guard autoLock(bindLock_); @@ -794,7 +798,7 @@ void DeviceManagerNotify::OnUnbindResult(const std::string &pkgName, const PeerT LOGE("Invalid para, pkgName: %{public}s.", pkgName.c_str()); return; } - LOGI("DeviceManagerNotify::OnUnbindResult in, pkgName:%{public}s, result:%{public}d", pkgName.c_str(), result); + LOGI("in, pkgName:%{public}s, result:%{public}d", pkgName.c_str(), result); std::shared_ptr tempCbk; { std::lock_guard autoLock(lock_); @@ -832,7 +836,7 @@ void DeviceManagerNotify::OnPinHolderCreate(const std::string &pkgName, const st LOGE("Invalid parameter, pkgName is empty."); return; } - LOGI("DeviceManagerNotify::OnPinHolderCreate in, pkgName:%{public}s", pkgName.c_str()); + LOGI("in, pkgName:%{public}s", pkgName.c_str()); std::shared_ptr tempCbk; { std::lock_guard autoLock(lock_); @@ -856,7 +860,7 @@ void DeviceManagerNotify::OnPinHolderDestroy(const std::string &pkgName, DmPinTy LOGE("Invalid parameter, pkgName is empty."); return; } - LOGI("DeviceManagerNotify::OnPinHolderDestroy in, pkgName:%{public}s", pkgName.c_str()); + LOGI("in, pkgName:%{public}s", pkgName.c_str()); std::shared_ptr tempCbk; { std::lock_guard autoLock(lock_); @@ -879,7 +883,7 @@ void DeviceManagerNotify::OnCreateResult(const std::string &pkgName, int32_t res LOGE("Invalid parameter, pkgName is empty."); return; } - LOGI("DeviceManagerNotify::OnCreateResult in, pkgName:%{public}s", pkgName.c_str()); + LOGI("in, pkgName:%{public}s", pkgName.c_str()); std::shared_ptr tempCbk; { std::lock_guard autoLock(lock_); @@ -902,7 +906,7 @@ void DeviceManagerNotify::OnDestroyResult(const std::string &pkgName, int32_t re LOGE("Invalid parameter, pkgName is empty."); return; } - LOGI("DeviceManagerNotify::OnDestroyResult in, pkgName:%{public}s", pkgName.c_str()); + LOGI("in, pkgName:%{public}s", pkgName.c_str()); std::shared_ptr tempCbk; { std::lock_guard autoLock(lock_); @@ -926,7 +930,7 @@ void DeviceManagerNotify::OnPinHolderEvent(const std::string &pkgName, DmPinHold LOGE("Invalid parameter, pkgName is empty."); return; } - LOGI("DeviceManagerNotify::OnPinHolderEvent in, pkgName:%{public}s", pkgName.c_str()); + LOGI("in, pkgName:%{public}s", pkgName.c_str()); std::shared_ptr tempCbk; { std::lock_guard autoLock(lock_); @@ -1028,7 +1032,7 @@ void DeviceManagerNotify::OnDeviceTrustChange(const std::string &pkgName, const tempCbk = iter->second; } if (tempCbk == nullptr) { - LOGE("OnDeviceReady error, registered device status callback is nullptr."); + LOGE("error, registered device status callback is nullptr."); return; } DmAuthForm dmAuthForm = static_cast(authForm); @@ -1170,7 +1174,7 @@ void DeviceManagerNotify::OnSinkBindResult(const std::string &pkgName, const Pee LOGE("Invalid para, pkgName: %{public}s.", pkgName.c_str()); return; } - LOGI("DeviceManagerNotify::OnSinkBindResult in, pkgName:%{public}s, result:%{public}d", pkgName.c_str(), result); + LOGI("in, pkgName:%{public}s, result:%{public}d", pkgName.c_str(), result); std::shared_ptr tempCbk; { std::lock_guard autoLock(lock_); diff --git a/services/implementation/src/authentication/auth_message_processor.cpp b/services/implementation/src/authentication/auth_message_processor.cpp index 44294f3b0..ad8495853 100644 --- a/services/implementation/src/authentication/auth_message_processor.cpp +++ b/services/implementation/src/authentication/auth_message_processor.cpp @@ -124,7 +124,7 @@ bool AuthMessageProcessor::IsPincodeImported() std::vector AuthMessageProcessor::CreateAuthRequestMessage() { - LOGI("AuthMessageProcessor::CreateAuthRequestMessage start."); + LOGI("start."); std::vector jsonStrVec; if (authRequestContext_ == nullptr) { LOGE("AuthMessageProcessor::CreateAuthRequestMessage authRequestContext_ is nullptr."); @@ -147,8 +147,6 @@ std::vector AuthMessageProcessor::CreateAuthRequestMessage() jsonThumbnailObj[TAG_THUMBNAIL_SIZE] = thumbnailSize; int32_t leftLen = thumbnailSize - idx * MSG_MAX_SIZE; int32_t sliceLen = (leftLen > MSG_MAX_SIZE) ? MSG_MAX_SIZE : leftLen; - LOGI("TAG_APP_THUMBNAIL encode, idx %{public}d, sliceLen %{public}d, thumbnailSize %{public}d", idx, - (uint32_t)sliceLen, thumbnailSize); jsonObj[TAG_APP_THUMBNAIL] = authRequestContext_->appThumbnail.substr(idx * MSG_MAX_SIZE, sliceLen); jsonStrVec.push_back(SafetyDump(jsonThumbnailObj)); } @@ -157,7 +155,7 @@ std::vector AuthMessageProcessor::CreateAuthRequestMessage() std::string AuthMessageProcessor::CreateSimpleMessage(int32_t msgType) { - LOGI("AuthMessageProcessor::CreateSimpleMessage start. msgType is %{public}d", msgType); + LOGI("start. msgType is %{public}d", msgType); JsonObject jsonObj; jsonObj[TAG_VER] = DM_ITF_VER; jsonObj[TAG_MSG_TYPE] = msgType; @@ -312,7 +310,7 @@ void AuthMessageProcessor::CreateResponseAuthMessage(JsonObject &json) json[TAG_TOKEN] = authResponseContext_->token; if (authResponseContext_->reply == 0) { std::string groupId = authResponseContext_->groupId; - LOGI("AuthMessageProcessor::CreateResponseAuthMessage groupId %{public}s", GetAnonyString(groupId).c_str()); + LOGI("groupId %{public}s", GetAnonyString(groupId).c_str()); JsonObject jsonObject(groupId); if (jsonObject.IsDiscarded()) { LOGE("DecodeRequestAuth jsonStr error"); @@ -352,7 +350,7 @@ int32_t AuthMessageProcessor::ParseMessage(const std::string &message) } int32_t msgType = jsonObject[TAG_MSG_TYPE].Get(); authResponseContext_->msgType = msgType; - LOGI("AuthMessageProcessor::ParseMessage message type %{public}d", authResponseContext_->msgType); + LOGI("message type %{public}d", authResponseContext_->msgType); switch (msgType) { case MSG_TYPE_NEGOTIATE: ParseNegotiateMessage(jsonObject); @@ -416,7 +414,6 @@ void AuthMessageProcessor::ParsePublicKeyMessageExt(JsonObject &json) } if (IsInt32(jsonObject, TAG_SESSIONKEY_ID)) { authResponseContext_->remoteSessionKeyId = jsonObject[TAG_SESSIONKEY_ID].Get(); - LOGI("get remoteSessionKeyId"); } return; } @@ -424,7 +421,7 @@ void AuthMessageProcessor::ParsePublicKeyMessageExt(JsonObject &json) void AuthMessageProcessor::ParseAuthResponseMessageExt(JsonObject &json) { - LOGI("start ParseAuthResponseMessageExt"); + LOGI("start"); if (IsInt32(json, TAG_REPLY)) { authResponseContext_->reply = json[TAG_REPLY].Get(); } @@ -486,7 +483,7 @@ void AuthMessageProcessor::GetAuthReqMessage(JsonObject &json) int32_t AuthMessageProcessor::ParseAuthRequestMessage(JsonObject &json) { - LOGI("start ParseAuthRequestMessage"); + LOGI("start"); int32_t sliceNum = 0; int32_t idx = 0; if (!IsInt32(json, TAG_INDEX) || !IsInt32(json, TAG_SLICE_NUM)) { @@ -528,7 +525,7 @@ int32_t AuthMessageProcessor::ParseAuthRequestMessage(JsonObject &json) void AuthMessageProcessor::ParseAuthResponseMessage(JsonObject &json) { - LOGI("start ParseAuthResponseMessage"); + LOGI("start"); if (!IsInt32(json, TAG_REPLY)) { LOGE("AuthMessageProcessor::ParseAuthResponseMessage err json string, first time."); return; @@ -711,7 +708,7 @@ std::shared_ptr AuthMessageProcessor::GetRequestContext() std::string AuthMessageProcessor::CreateDeviceAuthMessage(int32_t msgType, const uint8_t *data, uint32_t dataLen) { - LOGI("CreateDeviceAuthMessage start, msgType %{public}d.", msgType); + LOGI("start, msgType %{public}d.", msgType); JsonObject jsonObj; jsonObj[TAG_MSG_TYPE] = msgType; std::string authDataStr = std::string(reinterpret_cast(data), dataLen); diff --git a/services/implementation/src/authentication/dm_auth_manager.cpp b/services/implementation/src/authentication/dm_auth_manager.cpp index ee8a86412..8073d714b 100644 --- a/services/implementation/src/authentication/dm_auth_manager.cpp +++ b/services/implementation/src/authentication/dm_auth_manager.cpp @@ -114,7 +114,7 @@ bool DmAuthManager::IsHmlSessionType() int32_t DmAuthManager::CheckAuthParamVaild(const std::string &pkgName, int32_t authType, const std::string &deviceId, const std::string &extra) { - LOGI("DmAuthManager::CheckAuthParamVaild start."); + LOGI("start."); if (authType < DM_AUTH_TYPE_MIN || authType > DM_AUTH_TYPE_MAX) { LOGE("CheckAuthParamVaild failed, authType is illegal."); return ERR_DM_AUTH_FAILED; @@ -342,7 +342,7 @@ void DmAuthManager::InitAuthState(const std::string &pkgName, int32_t authType, int32_t DmAuthManager::AuthenticateDevice(const std::string &pkgName, int32_t authType, const std::string &deviceId, const std::string &extra) { - LOGI("DmAuthManager::AuthenticateDevice start auth type %{public}d.", authType); + LOGI("start auth type %{public}d.", authType); processInfo_.pkgName = pkgName; { std::lock_guard lock(bindParamMutex_); diff --git a/services/implementation/src/config/dm_config_manager.cpp b/services/implementation/src/config/dm_config_manager.cpp index 33705a784..3934c2e87 100644 --- a/services/implementation/src/config/dm_config_manager.cpp +++ b/services/implementation/src/config/dm_config_manager.cpp @@ -97,12 +97,6 @@ void DmConfigManager::ParseAdapterConfig() } soLoadInfo[i].soPath = std::string(DM_LIB_LOAD_PATH); soAdapterLoadInfo_[soLoadInfo[i].soName] = soLoadInfo[i]; - LOGI("soAdapterLoadInfo name is: %{public}s", soLoadInfo[i].name.c_str()); - LOGI("soAdapterLoadInfo type is: %{public}s", soLoadInfo[i].type.c_str()); - LOGI("soAdapterLoadInfo version is: %{public}s", soLoadInfo[i].version.c_str()); - LOGI("soAdapterLoadInfo funcName is: %{public}s", soLoadInfo[i].funcName.c_str()); - LOGI("soAdapterLoadInfo soName is: %{public}s", soLoadInfo[i].soName.c_str()); - LOGI("soAdapterLoadInfo soPath is: %{public}s", soLoadInfo[i].soPath.c_str()); } } @@ -128,13 +122,6 @@ void DmConfigManager::ParseAuthConfig() } soLoadInfo[i].soPath = std::string(DM_LIB_LOAD_PATH); soAuthLoadInfo_[soLoadInfo[i].authType] = soLoadInfo[i]; - LOGI("soAuthLoadInfo name is: %{public}s", soLoadInfo[i].name.c_str()); - LOGI("soAuthLoadInfo type is: %{public}s", soLoadInfo[i].type.c_str()); - LOGI("soAuthLoadInfo version is: %{public}s", soLoadInfo[i].version.c_str()); - LOGI("soAuthLoadInfo funcName is: %{public}s", soLoadInfo[i].funcName.c_str()); - LOGI("soAuthLoadInfo soName is: %{public}s", soLoadInfo[i].soName.c_str()); - LOGI("soAuthLoadInfo soPath is: %{public}s", soLoadInfo[i].soPath.c_str()); - LOGI("soAuthLoadInfo authType is: %{public}d", soLoadInfo[i].authType); } } diff --git a/services/implementation/src/credential/dm_credential_manager.cpp b/services/implementation/src/credential/dm_credential_manager.cpp index ac77c2562..6df6c33ea 100644 --- a/services/implementation/src/credential/dm_credential_manager.cpp +++ b/services/implementation/src/credential/dm_credential_manager.cpp @@ -97,7 +97,7 @@ DmCredentialManager::~DmCredentialManager() int32_t DmCredentialManager::RequestCredential(const std::string &reqJsonStr, std::string &returnJsonStr) { - LOGI("start to request credential."); + LOGI("start."); char localDeviceId[DEVICE_UUID_LENGTH] = {0}; GetDevUdid(localDeviceId, DEVICE_UUID_LENGTH); JsonObject jsonObject(reqJsonStr); @@ -158,7 +158,7 @@ int32_t DmCredentialManager::ImportCredential(const std::string &pkgName, const int32_t DmCredentialManager::ImportRemoteCredentialExt(const std::string &credentialInfo) { - LOGI("ImportRemoteCredentialExt start."); + LOGI("start."); if (hiChainConnector_->addMultiMembersExt(credentialInfo) != DM_OK) { LOGE("Failed to add member to group."); return ERR_DM_FAILED; @@ -168,7 +168,7 @@ int32_t DmCredentialManager::ImportRemoteCredentialExt(const std::string &creden int32_t DmCredentialManager::ImportLocalCredential(const std::string &credentialInfo) { - LOGI("ImportLocalCredential start"); + LOGI(" start"); JsonObject jsonObject(credentialInfo); if (jsonObject.IsDiscarded()) { LOGE("credentialInfo string not a json type."); @@ -195,7 +195,7 @@ int32_t DmCredentialManager::ImportLocalCredential(const std::string &credential LOGI("ImportLocalCredential credentialData err"); return ERR_DM_FAILED; } - LOGI("ImportLocalCredential get credentialData success!"); + LOGI("get credentialData success!"); JsonObject jsonOutObj; if (GetCredentialData(credentialInfo, vecCredentialData[0], jsonOutObj) != DM_OK) { LOGE("failed to get credentialData field from input credential."); @@ -254,7 +254,7 @@ int32_t DmCredentialManager::DeleteCredential(const std::string &pkgName, const void DmCredentialManager::OnGroupResultExt(int32_t action, const std::string &resultInfo) { - LOGI("DmCredentialManager::OnGroupResultExt action %{public}d, resultInfo %{public}s.", action, resultInfo.c_str()); + LOGI("action %{public}d, resultInfo %{public}s.", action, resultInfo.c_str()); CHECK_NULL_VOID(listener_); listener_->OnCredentialResult(processInfo_, action, resultInfo); } @@ -262,7 +262,7 @@ void DmCredentialManager::OnGroupResultExt(int32_t action, const std::string &re void DmCredentialManager::OnGroupResult(int64_t requestId, int32_t action, const std::string &resultInfo) { - LOGI("DmCredentialManager::OnImportResult"); + LOGI("OnGroupResult"); if (requestId_ != requestId) { return; } @@ -280,7 +280,7 @@ int32_t DmCredentialManager::RegisterCredentialCallback(const std::string &pkgNa #if !(defined(__LITEOS_M__) || defined(LITE_DEVICE)) MultipleUserConnector::GetCallerUserId(userId); #endif - LOGI("DmCredentialManager::RegisterCredentialCallback pkgName = %{public}s", GetAnonyString(pkgName).c_str()); + LOGI("pkgName = %{public}s", GetAnonyString(pkgName).c_str()); { std::lock_guard autoLock(locks_); processInfo_.pkgName = pkgName; @@ -296,7 +296,7 @@ int32_t DmCredentialManager::UnRegisterCredentialCallback(const std::string &pkg LOGE("DmCredentialManager::UnRegisterCredentialStateCallback input param is empty"); return ERR_DM_FAILED; } - LOGI("DmCredentialManager::UnRegisterCredentialStateCallback pkgName = %{public}s", + LOGI("pkgName = %{public}s", GetAnonyString(pkgName).c_str()); { std::lock_guard autoLock(locks_); diff --git a/services/implementation/src/dependency/MSDP/spatial_location_callback_impl.cpp b/services/implementation/src/dependency/MSDP/spatial_location_callback_impl.cpp index 6de474673..43a8682b7 100644 --- a/services/implementation/src/dependency/MSDP/spatial_location_callback_impl.cpp +++ b/services/implementation/src/dependency/MSDP/spatial_location_callback_impl.cpp @@ -35,7 +35,7 @@ SpatialLocationCallbackImpl::~SpatialLocationCallbackImpl() void SpatialLocationCallbackImpl::OnPinCodeChanged(const Msdp::PinCodeResponse &pinCodeResponse) { - LOGI("SpatialLocationCallbackImpl::OnPinCodeChanged Start."); + LOGI("Start."); if (pinCodeResponse.pincode.length() != pinCodeLength) { LOGE("OnPinCodeChanged pincode length error."); return; diff --git a/services/implementation/src/dependency/hichain/hichain_auth_connector.cpp b/services/implementation/src/dependency/hichain/hichain_auth_connector.cpp index f3147e155..cb813a027 100644 --- a/services/implementation/src/dependency/hichain/hichain_auth_connector.cpp +++ b/services/implementation/src/dependency/hichain/hichain_auth_connector.cpp @@ -93,10 +93,10 @@ int32_t HiChainAuthConnector::UnRegisterHiChainAuthCallbackById(int64_t id) std::shared_ptr HiChainAuthConnector::GetDeviceAuthCallback(int64_t id) { if (dmDeviceAuthCallbackMap_.find(id) != dmDeviceAuthCallbackMap_.end()) { - LOGD("HiChainAuthConnector::GetDeviceAuthCallback dmDeviceAuthCallbackMap_ id: %{public}" PRId64 ".", id); + LOGD("dmDeviceAuthCallbackMap_ id: %{public}" PRId64 ".", id); return dmDeviceAuthCallbackMap_[id]; } - LOGD("HiChainAuthConnector::GetDeviceAuthCallback dmDeviceAuthCallbackMap_ not found, id: %{public}" + LOGD("dmDeviceAuthCallbackMap_ not found, id: %{public}" PRId64 ".", id); // If the callback registered by the new protocol ID cannot be found, the callback registered // by the old protocol is used. However, the old protocol callback may be empty. @@ -106,7 +106,7 @@ std::shared_ptr HiChainAuthConnector::GetDeviceAuthCallba int32_t HiChainAuthConnector::AuthDevice(const std::string &pinCode, int32_t osAccountId, std::string udid, int64_t requestId) { - LOGI("HiChainAuthConnector::AuthDevice start, pinCode: %{public}s", GetAnonyString(pinCode).c_str()); + LOGI("start, pinCode: %{public}s", GetAnonyString(pinCode).c_str()); JsonObject authParamJson; authParamJson["osAccountId"] = osAccountId; authParamJson["pinCode"] = pinCode; @@ -124,7 +124,7 @@ int32_t HiChainAuthConnector::AuthDevice(const std::string &pinCode, int32_t osA int32_t HiChainAuthConnector::ProcessAuthData(int64_t requestId, std::string authData, int32_t osAccountId) { - LOGI("HiChainAuthConnector::ProcessAuthData start."); + LOGI("start."); JsonObject jsonAuthParam; jsonAuthParam["osAccountId"] = osAccountId; jsonAuthParam["data"] = authData; @@ -138,7 +138,7 @@ int32_t HiChainAuthConnector::ProcessAuthData(int64_t requestId, std::string aut int32_t HiChainAuthConnector::ProcessCredData(int64_t authReqId, const std::string &data) { - LOGI("HiChainAuthConnector::ProcessCredData start."); + LOGI("start."); const CredAuthManager *credAuthManager = GetCredAuthInstance(); int32_t ret = credAuthManager->processCredData(authReqId, reinterpret_cast(data.c_str()), data.length(), &deviceAuthCallback_); @@ -146,15 +146,12 @@ int32_t HiChainAuthConnector::ProcessCredData(int64_t authReqId, const std::stri LOGE("Hichain processData failed ret %{public}d.", ret); return ERR_DM_FAILED; } - LOGI("HiChainAuthConnector::ProcessCredData leave."); return DM_OK; } int32_t HiChainAuthConnector::AddCredential(int32_t osAccountId, const std::string &authParams, std::string &credId) { - LOGI("HiChainAuthConnector::AddCredential start."); - LOGI("HiChainAuthConnector::AddCredential osAccount=%{public}d, authParams=%{public}s\n", - osAccountId, authParams.c_str()); + LOGI("osAccount=%{public}d, authParams=%{public}s", osAccountId, authParams.c_str()); char *returnData = NULL; const CredManager *credManager = GetCredMgrInstance(); int32_t ret = credManager->addCredential(osAccountId, authParams.c_str(), &returnData); @@ -162,19 +159,15 @@ int32_t HiChainAuthConnector::AddCredential(int32_t osAccountId, const std::stri LOGE("Hichain addCredential failed ret %{public}d.", ret); return ERR_DM_FAILED; } - LOGI("HiChainAuthConnector::AddCredential addCredential success ret=%{public}d, returnData=%{public}s.", - ret, returnData); + LOGI("success ret=%{public}d, returnData=%{public}s.", ret, returnData); credId = std::string(returnData); - LOGI("HiChainAuthConnector::AddCredential addCredId=%{public}s.", credId.c_str()); credManager->destroyInfo(&returnData); - LOGI("HiChainAuthConnector::AddCredential leave."); return DM_OK; } int32_t HiChainAuthConnector::ExportCredential(int32_t osAccountId, const std::string &credId, std::string &publicKey) { - LOGI("HiChainAuthConnector::ExportCredential start. osAccountId=%{public}d, credId=%{public}s", - osAccountId, credId.c_str()); + LOGI("start. osAccountId=%{public}d, credId=%{public}s", osAccountId, credId.c_str()); char *returnData = NULL; const CredManager *credManager = GetCredMgrInstance(); int32_t ret = credManager->exportCredential(osAccountId, credId.c_str(), &returnData); @@ -191,14 +184,14 @@ int32_t HiChainAuthConnector::ExportCredential(int32_t osAccountId, const std::s } publicKey = jsonAuthParam["keyValue"].Get(); - LOGI("HiChainAuthConnector::ExportCredential leave. publicKey=%{public}s", publicKey.c_str()); + LOGI("leave. publicKey=%{public}s", publicKey.c_str()); return DM_OK; } int32_t HiChainAuthConnector::AgreeCredential(int32_t osAccountId, const std::string selfCredId, const std::string &authParams, std::string &credId) { - LOGI("HiChainAuthConnector::AgreeCredential start."); + LOGI("start."); char *returnData = NULL; const CredManager *credManager = GetCredMgrInstance(); int32_t ret = credManager->agreeCredential(osAccountId, selfCredId.c_str(), authParams.c_str(), &returnData); @@ -208,29 +201,26 @@ int32_t HiChainAuthConnector::AgreeCredential(int32_t osAccountId, const std::st } credId = returnData; credManager->destroyInfo(&returnData); - LOGI("HiChainAuthConnector::AgreeCredential leave agreeCredId=%{public}s.", credId.c_str()); + LOGI("leave agreeCredId=%{public}s.", credId.c_str()); return DM_OK; } int32_t HiChainAuthConnector::DeleteCredential(int32_t osAccountId, const std::string &credId) { - LOGI("HiChainAuthConnector::DeleteCredential start. osAccountId=%{public}d, credId=%{public}s", osAccountId, - credId.c_str()); + LOGI("start. osAccountId=%{public}d, credId=%{public}s", osAccountId, credId.c_str()); const CredManager *credManager = GetCredMgrInstance(); int32_t ret = credManager->deleteCredential(osAccountId, credId.c_str()); if (ret != HC_SUCCESS) { LOGE("Hichain deleteCredential failed ret %{public}d.", ret); return ERR_DM_FAILED; } - LOGI("HiChainAuthConnector::DeleteCredential leave."); return DM_OK; } int32_t HiChainAuthConnector::AuthCredential(int32_t osAccountId, int64_t authReqId, const std::string &credId, const std::string &pinCode) { - LOGI("HiChainAuthConnector::AuthCredential start. osAccountId=%{public}d, credId=%{public}s", osAccountId, - credId.c_str()); + LOGI("start. osAccountId=%{public}d, credId=%{public}s", osAccountId, credId.c_str()); if (credId.empty() && pinCode.empty()) { LOGE("HiChainAuthConnector::AuthCredential failed, credId and pinCode is empty."); return ERR_DM_FAILED; @@ -251,13 +241,12 @@ int32_t HiChainAuthConnector::AuthCredential(int32_t osAccountId, int64_t authRe LOGE("HiChainAuthConnector::AuthCredential failed ret %{public}d.", ret); return ERR_DM_FAILED; } - LOGI("HiChainAuthConnector::AuthCredential leave."); return DM_OK; } int32_t HiChainAuthConnector::AuthCredentialPinCode(int32_t osAccountId, int64_t authReqId, const std::string &pinCode) { - LOGI("HiChainAuthConnector::AuthCredential start, pinCode: %{public}s", GetAnonyString(pinCode).c_str()); + LOGI("start, pinCode: %{public}s", GetAnonyString(pinCode).c_str()); if (pinCode.size() < MIN_PINCODE_SIZE) { LOGE("HiChainAuthConnector::AuthCredentialPinCode failed, pinCode size is %{public}zu.", pinCode.size()); return ERR_DM_FAILED; @@ -293,7 +282,7 @@ bool HiChainAuthConnector::onTransmit(int64_t requestId, const uint8_t *data, ui char *HiChainAuthConnector::onRequest(int64_t requestId, int operationCode, const char *reqParams) { - LOGI("HiChainAuthConnector::onRequest start."); + LOGI("start."); auto dmDeviceAuthCallback = GetDeviceAuthCallback(requestId); if (dmDeviceAuthCallback == nullptr) { LOGE("HiChainAuthConnector::onRequest dmDeviceAuthCallback_ is nullptr."); @@ -304,7 +293,7 @@ char *HiChainAuthConnector::onRequest(int64_t requestId, int operationCode, cons void HiChainAuthConnector::onFinish(int64_t requestId, int operationCode, const char *returnData) { - LOGI("HiChainAuthConnector::onFinish reqId:%{public}" PRId64 ", operation:%{public}d.", + LOGI("reqId:%{public}" PRId64 ", operation:%{public}d.", requestId, operationCode); (void)returnData; auto dmDeviceAuthCallback = GetDeviceAuthCallback(requestId); @@ -317,7 +306,7 @@ void HiChainAuthConnector::onFinish(int64_t requestId, int operationCode, const void HiChainAuthConnector::onError(int64_t requestId, int operationCode, int errorCode, const char *errorReturn) { - LOGI("HichainAuthenCallBack::onError reqId:%{public}" PRId64 ", operation:%{public}d, errorCode:%{public}d.", + LOGI("reqId:%{public}" PRId64 ", operation:%{public}d, errorCode:%{public}d.", requestId, operationCode, errorCode); (void)operationCode; (void)errorReturn; @@ -335,7 +324,7 @@ void HiChainAuthConnector::onError(int64_t requestId, int operationCode, int err void HiChainAuthConnector::onSessionKeyReturned(int64_t requestId, const uint8_t *sessionKey, uint32_t sessionKeyLen) { - LOGI("HiChainAuthConnector::onSessionKeyReturned start."); + LOGI("start."); auto dmDeviceAuthCallback = GetDeviceAuthCallback(requestId); if (dmDeviceAuthCallback == nullptr) { LOGE("HiChainAuthConnector::onSessionKeyReturned dmDeviceAuthCallback_ is nullptr."); @@ -346,7 +335,7 @@ void HiChainAuthConnector::onSessionKeyReturned(int64_t requestId, const uint8_t int32_t HiChainAuthConnector::GenerateCredential(std::string &localUdid, int32_t osAccountId, std::string &publicKey) { - LOGI("HiChainAuthConnector::GenerateCredential start."); + LOGI("start."); JsonObject jsonObj; jsonObj["osAccountId"] = osAccountId; jsonObj["deviceId"] = localUdid; @@ -440,7 +429,7 @@ int32_t HiChainAuthConnector::QueryCredInfoByCredId(int32_t userId, std::string bool HiChainAuthConnector::QueryCredential(std::string &localUdid, int32_t osAccountId, int32_t peerOsAccountId) { - LOGI("QueryCredential start, deviceId: %{public}s, peerOsAccountId: %{public}d", + LOGI("start, deviceId: %{public}s, peerOsAccountId: %{public}d", GetAnonyString(localUdid).c_str(), peerOsAccountId); JsonObject jsonObj; jsonObj["osAccountId"] = osAccountId; @@ -471,7 +460,7 @@ bool HiChainAuthConnector::QueryCredential(std::string &localUdid, int32_t osAcc int32_t HiChainAuthConnector::GetCredential(std::string &localUdid, int32_t osAccountId, std::string &publicKey) { - LOGI("HiChainAuthConnector::GetCredential"); + LOGI("start"); JsonObject jsonObj; jsonObj["osAccountId"] = osAccountId; jsonObj["deviceId"] = localUdid; @@ -502,7 +491,7 @@ int32_t HiChainAuthConnector::GetCredential(std::string &localUdid, int32_t osAc int32_t HiChainAuthConnector::ImportCredential(int32_t osAccountId, int32_t peerOsAccountId, std::string deviceId, std::string publicKey) { - LOGI("ImportCredential start, deviceId: %{public}s, peerOsAccountId: %{public}d", + LOGI("start, deviceId: %{public}s, peerOsAccountId: %{public}d", GetAnonyString(deviceId).c_str(), peerOsAccountId); JsonObject jsonObj; jsonObj["osAccountId"] = osAccountId; @@ -523,7 +512,7 @@ int32_t HiChainAuthConnector::ImportCredential(int32_t osAccountId, int32_t peer int32_t HiChainAuthConnector::DeleteCredential(const std::string &deviceId, int32_t userId, int32_t peerUserId) { - LOGI("DeleteCredential start, deviceId: %{public}s, peerUserId: %{public}d", + LOGI("start, deviceId: %{public}s, peerUserId: %{public}d", GetAnonyString(deviceId).c_str(), peerUserId); JsonObject jsonObj; jsonObj["deviceId"] = deviceId; diff --git a/services/implementation/src/dependency/softbus/softbus_connector.cpp b/services/implementation/src/dependency/softbus/softbus_connector.cpp index df2d1e411..dabbd9c37 100644 --- a/services/implementation/src/dependency/softbus/softbus_connector.cpp +++ b/services/implementation/src/dependency/softbus/softbus_connector.cpp @@ -78,7 +78,7 @@ SoftbusConnector::~SoftbusConnector() void SoftbusConnector::SyncAclList(int32_t userId, std::string credId, int32_t sessionKeyId, int32_t aclId) { - LOGI("SyncAclList userId:%{public}d, credId:%{public}s, sessionKeyId:%{public}d, aclId:%{public}d", + LOGI("userId:%{public}d, credId:%{public}s, sessionKeyId:%{public}d, aclId:%{public}d", userId, credId.c_str(), sessionKeyId, aclId); #if !(defined(__LITEOS_M__) || defined(LITE_DEVICE)) // 根据skid删除sk,删除skid @@ -560,7 +560,7 @@ std::string SoftbusConnector::GetDeviceUdidByUdidHash(const std::string &udidHas return iter.first; } } - LOGE("fail to GetUdidByUdidHash, udidHash: %{public}s", GetAnonyString(udidHash).c_str()); + LOGE("failed, udidHash: %{public}s", GetAnonyString(udidHash).c_str()); return udidHash; } @@ -646,7 +646,7 @@ int32_t SoftbusConnector::AddMemberToDiscoverMap(const std::string &deviceId, st std::string SoftbusConnector::GetNetworkIdByDeviceId(const std::string &deviceId) { - LOGI("SoftbusConnector::GetNetworkIdByDeviceId"); + LOGI("start"); int32_t deviceCount = 0; NodeBasicInfo *nodeInfo = nullptr; if (GetAllNodeDeviceInfo(DM_PKG_NAME, &nodeInfo, &deviceCount) != DM_OK) { @@ -671,70 +671,70 @@ std::string SoftbusConnector::GetNetworkIdByDeviceId(const std::string &deviceId void SoftbusConnector::SetProcessInfo(ProcessInfo processInfo) { - LOGI("SoftbusConnector::SetProcessInfo"); + LOGI("start"); std::lock_guard lock(processInfoVecMutex_); processInfoVec_.push_back(processInfo); } void SoftbusConnector::SetProcessInfoVec(std::vector processInfoVec) { - LOGI("SoftbusConnector::SetProcessInfoVec"); + LOGI("start"); std::lock_guard lock(processInfoVecMutex_); processInfoVec_ = processInfoVec; } std::vector SoftbusConnector::GetProcessInfo() { - LOGI("SoftbusConnector::GetProcessInfo"); + LOGI("start"); std::lock_guard lock(processInfoVecMutex_); return processInfoVec_; } void SoftbusConnector::ClearProcessInfo() { - LOGI("SoftbusConnector::ClearProcessInfo"); + LOGI("start"); std::lock_guard lock(processInfoVecMutex_); processInfoVec_.clear(); } void SoftbusConnector::SetChangeProcessInfo(ProcessInfo processInfo) { - LOGI("SoftbusConnector::SetChangeProcessInfo"); + LOGI("start"); std::lock_guard lock(processChangeInfoVecMutex_); processChangeInfoVec_.push_back(processInfo); } std::vector SoftbusConnector::GetChangeProcessInfo() { - LOGI("SoftbusConnector::GetChangeProcessInfo"); + LOGI("start"); std::lock_guard lock(processChangeInfoVecMutex_); return processChangeInfoVec_; } void SoftbusConnector::ClearChangeProcessInfo() { - LOGI("SoftbusConnector::ClearChangeProcessInfo"); + LOGI("start"); std::lock_guard lock(processChangeInfoVecMutex_); processChangeInfoVec_.clear(); } void SoftbusConnector::HandleDeviceOnline(std::string deviceId, int32_t authForm) { - LOGI("SoftbusConnector::HandleDeviceOnline"); + LOGI("start"); deviceStateManagerCallback_->OnDeviceOnline(deviceId, authForm); return; } void SoftbusConnector::HandleDeviceOffline(std::string deviceId) { - LOGI("SoftbusConnector::HandleDeviceOffline"); + LOGI("start"); deviceStateManagerCallback_->OnDeviceOffline(deviceId); return; } void SoftbusConnector::DeleteOffLineTimer(std::string &udidHash) { - LOGI("SoftbusConnector::DeleteOffLineTimer"); + LOGI("start"); remoteUdidHash_ = udidHash; if (deviceStateManagerCallback_ != nullptr) { deviceStateManagerCallback_->DeleteOffLineTimer(udidHash); @@ -793,7 +793,7 @@ bool SoftbusConnector::CheckIsNeedJoinLnn(const std::string &udid, const std::st // isHash:传入的deviceId是否为哈希值 bool SoftbusConnector::CheckIsOnline(const std::string &targetDeviceIdHash, bool isHash) { - LOGI("Check the device is online."); + LOGI("start."); int32_t deviceCount = 0; NodeBasicInfo *nodeInfo = nullptr; if (GetAllNodeDeviceInfo(DM_PKG_NAME, &nodeInfo, &deviceCount) != DM_OK) { @@ -827,7 +827,7 @@ bool SoftbusConnector::CheckIsOnline(const std::string &targetDeviceId) DmDeviceInfo SoftbusConnector::GetDeviceInfoByDeviceId(const std::string &deviceId) { - LOGI("SoftbusConnector::GetDeviceInfoBydeviceId"); + LOGI("start"); DmDeviceInfo info; int32_t deviceCount = 0; NodeBasicInfo *nodeInfo = nullptr; diff --git a/services/implementation/src/device_manager_service_impl.cpp b/services/implementation/src/device_manager_service_impl.cpp index 7f64a2897..8f8aa86e0 100644 --- a/services/implementation/src/device_manager_service_impl.cpp +++ b/services/implementation/src/device_manager_service_impl.cpp @@ -202,7 +202,7 @@ void DeviceManagerServiceImpl::CleanWorker() { while (running_.load()) { auto logicalSessionId = FetchCleanEvent(); - LOGI("DeviceManagerServiceImpl::CleanWorker clean auth_mgr, its logicalSessionId: %{public}" PRIu64 "", + LOGI("clean auth_mgr, its logicalSessionId: %{public}" PRIu64 "", logicalSessionId); CleanAuthMgrByLogicalSessionId(logicalSessionId); } @@ -211,7 +211,7 @@ void DeviceManagerServiceImpl::CleanWorker() cleanEventQueue_.pop(); CleanAuthMgrByLogicalSessionId(logicalSessionId); } - LOGI("DeviceManagerServiceImpl::CleanWorker end"); + LOGI("end"); } void DeviceManagerServiceImpl::Stop() @@ -223,7 +223,7 @@ void DeviceManagerServiceImpl::Stop() void DeviceManagerServiceImpl::NotifyCleanEvent(uint64_t logicalSessionId) { - LOGI("DeviceManagerServiceImpl::NotifyCleanEvent logicalSessionId: %{public}" PRIu64 ".", logicalSessionId); + LOGI("logicalSessionId: %{public}" PRIu64 ".", logicalSessionId); std::lock_guard lock(cleanEventMutex_); // Store into the queue cleanEventQueue_.push(logicalSessionId); @@ -239,14 +239,14 @@ void DeviceManagerServiceImpl::ImportConfig(std::shared_ptr aut authMgr->RegisterAuthenticationType(configsMap_[tokenId]->authenticationType); configsMap_[tokenId] = nullptr; configsMap_.erase(tokenId); - LOGI("DeviceManagerServiceImpl::ImportConfig import authCode Successful."); + LOGI("import authCode Successful."); return; } for (auto it = configsMap_.begin(); it != configsMap_.end();) { if (it->second != nullptr && pkgName == it->second->pkgName) { authMgr->ImportAuthCode(it->second->pkgName, it->second->authCode); authMgr->RegisterAuthenticationType(it->second->authenticationType); - LOGI("DeviceManagerServiceImpl::ImportConfig import authCode by pkgName Successful."); + LOGI("import authCode by pkgName Successful."); it->second = nullptr; it = configsMap_.erase(it); return; @@ -312,11 +312,11 @@ int32_t DeviceManagerServiceImpl::InitAndRegisterAuthMgr(bool isSrcSide, uint64_ // Register resource destruction notification function authMgrMap_[tokenId]->RegisterCleanNotifyCallback(&DeviceManagerServiceImpl::NotifyCleanEvent); hiChainAuthConnector_->RegisterHiChainAuthCallbackById(logicalSessionId, authMgrMap_[tokenId]); - LOGI("DeviceManagerServiceImpl::Initialize authMgrMap_ token: %{public}" PRId64 ".", tokenId); + LOGI("Initialize authMgrMap_ token: %{public}" PRId64 ".", tokenId); ImportConfig(authMgrMap_[tokenId], tokenId, pkgName); return DM_OK; } else { - LOGI("DeviceManagerServiceImpl::InitAndRegisterAuthMgr old authMgr."); + LOGI("InitAndRegisterAuthMgr old authMgr."); if (authMgr_ == nullptr) { CreateGlobalClassicalAuthMgr(); } @@ -393,10 +393,10 @@ std::shared_ptr DeviceManagerServiceImpl::GetAuthMgr() { uint64_t tokenId = IPCSkeleton::GetCallingTokenID(); if (authMgrMap_.find(tokenId) != authMgrMap_.end()) { - LOGI("DeviceManagerServiceImpl::GetAuthMgr authMgrMap_ token: %{public}" PRId64 ".", tokenId); + LOGI("authMgrMap_ token: %{public}" PRId64 ".", tokenId); return authMgrMap_[tokenId]; } - LOGE("DeviceManagerServiceImpl::GetAuthMgr authMgrMap_ not found, token: %{public}" PRId64 ".", tokenId); + LOGE("authMgrMap_ not found, token: %{public}" PRId64 ".", tokenId); return nullptr; } @@ -404,10 +404,10 @@ std::shared_ptr DeviceManagerServiceImpl::GetAuthMgr() std::shared_ptr DeviceManagerServiceImpl::GetAuthMgrByTokenId(uint64_t tokenId) { if (authMgrMap_.find(tokenId) != authMgrMap_.end()) { - LOGI("DeviceManagerServiceImpl::GetAuthMgrByTokenId authMgrMap_ token: %{public}" PRId64 ".", tokenId); + LOGI("authMgrMap_ token: %{public}" PRId64 ".", tokenId); return authMgrMap_[tokenId]; } - LOGE("DeviceManagerServiceImpl::GetAuthMgrByTokenId authMgrMap_ not found, token: %{public}" PRId64 ".", tokenId); + LOGE("authMgrMap_ not found, token: %{public}" PRId64 ".", tokenId); return nullptr; } @@ -447,7 +447,7 @@ static uint64_t GenerateRandNum(int sessionId) int32_t DeviceManagerServiceImpl::Initialize(const std::shared_ptr &listener) { - LOGI("DeviceManagerServiceImpl Initialize"); + LOGI("Initialize"); if (softbusConnector_ == nullptr) { softbusConnector_ = std::make_shared(); } @@ -483,7 +483,7 @@ int32_t DeviceManagerServiceImpl::Initialize(const std::shared_ptrGetUdidByNetWorkId(std::string(devInfo.networkId)); LOGI("deviceStateMgr Udid: %{public}s", GetAnonyString(trustDeviceId).c_str()); if (trustDeviceId == "") { @@ -662,8 +661,7 @@ void DeviceManagerServiceImpl::HandleOffline(DmDeviceState devState, DmDeviceInf void DeviceManagerServiceImpl::HandleOnline(DmDeviceState devState, DmDeviceInfo &devInfo) { - LOGI("DeviceManagerServiceImpl::HandleOnline networkId: %{public}s.", - GetAnonyString(devInfo.networkId).c_str()); + LOGI("networkId: %{public}s.", GetAnonyString(devInfo.networkId).c_str()); std::string trustDeviceId = ""; if (softbusConnector_->GetUdidByNetworkId(devInfo.networkId, trustDeviceId) != DM_OK) { LOGE("HandleOnline get udid failed."); @@ -717,7 +715,7 @@ void DeviceManagerServiceImpl::SetOnlineProcessInfo(const uint32_t &bindType, Pr devInfo.authForm = DmAuthForm::ACROSS_ACCOUNT; softbusConnector_->SetProcessInfo(processInfo); } - LOGI("DeviceManagerServiceImpl::HandleOnline success devInfo authForm is %{public}d.", devInfo.authForm); + LOGI("HandleOnline success devInfo authForm is %{public}d.", devInfo.authForm); deviceStateMgr_->HandleDeviceStatusChange(devState, devInfo); return; } @@ -743,7 +741,7 @@ bool DeviceManagerServiceImpl::CheckSharePeerSrc(const std::string &peerUdid, co void DeviceManagerServiceImpl::HandleDeviceStatusChange(DmDeviceState devState, DmDeviceInfo &devInfo) { - LOGI("DeviceManagerServiceImpl::HandleDeviceStatusChange start, devState = %{public}d, networkId: %{public}s.", + LOGI("start, devState = %{public}d, networkId: %{public}s.", devState, GetAnonyString(devInfo.networkId).c_str()); if (deviceStateMgr_ == nullptr) { LOGE("deviceStateMgr_ is nullpter!"); @@ -942,7 +940,7 @@ int32_t DeviceManagerServiceImpl::TransferSrcOldAuthMgr(std::shared_ptr authMgr_->OnSessionOpened(curSession->sessionId_, sessionSide, 0); } - LOGI("DeviceManagerServiceImpl::TransferSrcOldAuthMgr src transfer to old version success"); + LOGI("src transfer to old version success"); authMgr_->SetTransferReady(false); return DM_OK; } @@ -987,7 +985,7 @@ int32_t DeviceManagerServiceImpl::ChangeUltrasonicTypeToPin(std::mapsecond = CHANGE_PINTYPE; - LOGI("DeviceManagerServiceImpl::ChangeUltrasonicTypeToPin bindParam:%{public}s PINTYPE.", PARAM_KEY_AUTH_TYPE); + LOGI("bindParam:%{public}s PINTYPE.", PARAM_KEY_AUTH_TYPE); return DM_OK; } @@ -1024,7 +1022,7 @@ int32_t DeviceManagerServiceImpl::TransferSinkOldAuthMgr(const JsonObject &jsonO // Parameter 2 sessionSide is 0, authMgr_ is empty, it must be the sink end. // The src end will create the protocol object when BindTarget. authMgr_->OnSessionOpened(curSession->sessionId_, 0, 0); - LOGI("DeviceManagerServiceImpl::TransferSinkOldAuthMgr sink transfer to old version success"); + LOGI("sink transfer to old version success"); authMgr_->SetTransferReady(false); return DM_OK; } @@ -1098,7 +1096,7 @@ void DeviceManagerServiceImpl::OnBytesReceived(int sessionId, const void *data, return; } } else { - LOGI("DeviceManagerServiceImpl::OnBytesReceived Reuse Old AuthMgr, sessionId: %{public}d.", sessionId); + LOGI("Reuse Old AuthMgr, sessionId: %{public}d.", sessionId); } authMgr = authMgr_; } @@ -1314,7 +1312,7 @@ int32_t DeviceManagerServiceImpl::NotifyEvent(const std::string &pkgName, const int32_t DeviceManagerServiceImpl::GetGroupType(std::vector &deviceList) { - LOGI("GetGroupType begin"); + LOGI("begin"); if (softbusConnector_ == nullptr || hiChainConnector_ == nullptr) { LOGE("softbusConnector_ or hiChainConnector_ is nullptr"); return ERR_DM_POINT_NULL; @@ -1369,7 +1367,7 @@ int32_t DeviceManagerServiceImpl::ImportAuthCode(const std::string &pkgName, con return ERR_DM_INPUT_PARA_INVALID; } - LOGI("DeviceManagerServiceImpl::ImportAuthCode pkgName is %{public}s, authCode is %{public}s", + LOGI("pkgName is %{public}s, authCode is %{public}s", pkgName.c_str(), GetAnonyString(authCode).c_str()); auto authMgr = GetAuthMgr(); if (authMgr != nullptr) { @@ -1661,7 +1659,7 @@ void DeviceManagerServiceImpl::BindTargetImpl(uint64_t tokenId, const std::strin LOGE("authMgr BindTarget failed, ret %{public}d.", ret); CleanAuthMgrByLogicalSessionId(logicalSessionId); } - LOGI("DeviceManagerServiceImpl BindTargetImpl thread end, tokenId %{public}" PRId64".", tokenId); + LOGI("end, tokenId %{public}" PRId64".", tokenId); return; } @@ -1690,7 +1688,7 @@ int32_t DeviceManagerServiceImpl::BindTarget(const std::string &pkgName, const P int32_t DeviceManagerServiceImpl::DpAclAdd(const std::string &udid) { - LOGI("DeviceManagerServiceImpl DpAclAdd start."); + LOGI("start."); MultipleUserConnector::SetSwitchOldUserId(MultipleUserConnector::GetCurrentAccountUserID()); MultipleUserConnector::SetSwitchOldAccountId(MultipleUserConnector::GetOhosAccountId()); if (deviceStateMgr_->CheckIsOnline(udid)) { @@ -1701,7 +1699,6 @@ int32_t DeviceManagerServiceImpl::DpAclAdd(const std::string &udid) softbusConnector_->SetProcessInfo(processInfo); deviceStateMgr_->OnDeviceOnline(udid, DmAuthForm::IDENTICAL_ACCOUNT); } - LOGI("DeviceManagerServiceImpl::DpAclAdd completed"); return DM_OK; } @@ -1766,7 +1763,6 @@ void DeviceManagerServiceImpl::HandleIdentAccountLogout(const std::string &local hiChainConnector_->DeleteAllGroup(localUserId); CHECK_NULL_VOID(hiChainAuthConnector_); hiChainAuthConnector_->DeleteCredential(peerUdid, localUserId, peerUserId); - LOGE("DeleteSkCredAndAcl start"); DeleteSkCredAndAcl(offlineParam.needDelAclInfos); } @@ -1791,7 +1787,6 @@ void DeviceManagerServiceImpl::HandleUserRemoved(std::vector peerUd for (const auto &item : peerUserIdMap) { hiChainAuthConnector_->DeleteCredential(item.first, preUserId, item.second); } - LOGE("DeleteSkCredAndAcl start"); DeleteSkCredAndAcl(offlineParam.needDelAclInfos); } @@ -1812,7 +1807,6 @@ void DeviceManagerServiceImpl::HandleRemoteUserRemoved(int32_t userId, const std } CHECK_NULL_VOID(hiChainConnector_); hiChainConnector_->DeleteGroupByACL(delInfoVec, localUserIds); - LOGE("DeleteSkCredAndAcl start"); DeleteSkCredAndAcl(offlineParam.needDelAclInfos); } @@ -1830,16 +1824,16 @@ void DeviceManagerServiceImpl::HandleUserSwitched(const std::vector void DeviceManagerServiceImpl::ScreenCommonEventCallback(std::string commonEventType) { if (commonEventType == EventFwk::CommonEventSupport::COMMON_EVENT_SCREEN_LOCKED) { - LOGI("DeviceManagerServiceImpl::ScreenCommonEventCallback on screen locked."); + LOGI("on screen locked."); for (auto& pair : authMgrMap_) { if (pair.second != nullptr) { - LOGI("DeviceManagerServiceImpl::ScreenCommonEventCallback tokenId: %{public}" PRId64 ".", pair.first); + LOGI("tokenId: %{public}" PRId64 ".", pair.first); pair.second->OnScreenLocked(); } } return; } - LOGI("DeviceManagerServiceImpl::ScreenCommonEventCallback error."); + LOGI("error."); } int32_t DeviceManagerServiceImpl::CheckIsSameAccount(const DmAccessCaller &caller, const std::string &srcUdid, @@ -1864,7 +1858,7 @@ int32_t DeviceManagerServiceImpl::CheckAccessControl(const DmAccessCaller &calle void DeviceManagerServiceImpl::HandleDeviceNotTrust(const std::string &udid) { - LOGI("DeviceManagerServiceImpl::HandleDeviceNotTrust udid: %{public}s.", GetAnonyString(udid).c_str()); + LOGI("udid: %{public}s.", GetAnonyString(udid).c_str()); if (udid.empty()) { LOGE("HandleDeviceNotTrust udid is empty."); return; @@ -1930,7 +1924,6 @@ void DeviceManagerServiceImpl::HandleAccountLogoutEvent(int32_t remoteUserId, co hiChainConnector_->DeleteAllGroup(item.second); CHECK_NULL_VOID(hiChainAuthConnector_); hiChainAuthConnector_->DeleteCredential(remoteUdid, item.second, remoteUserId); - LOGE("DeleteSkCredAndAcl start"); DeleteSkCredAndAcl(offlineParam.needDelAclInfos); } } @@ -1953,7 +1946,7 @@ DmAuthForm DeviceManagerServiceImpl::ConvertBindTypeToAuthForm(int32_t bindType) int32_t DeviceManagerServiceImpl::DeleteGroup(const std::string &pkgName, const std::string &deviceId) { - LOGI("DeviceManagerServiceImpl::DeleteGroup"); + LOGI("start"); if (pkgName.empty()) { LOGE("Invalid parameter, pkgName is empty."); return ERR_DM_FAILED; @@ -1988,7 +1981,7 @@ void DeviceManagerServiceImpl::HandleDevUnBindEvent(int32_t remoteUserId, const void DeviceManagerServiceImpl::HandleAppUnBindEvent(int32_t remoteUserId, const std::string &remoteUdid, int32_t tokenId) { - LOGI("HandleAppUnBindEvent tokenId = %{public}d.", tokenId); + LOGI("tokenId = %{public}d.", tokenId); char localUdidTemp[DEVICE_UUID_LENGTH] = {0}; GetDevUdid(localUdidTemp, DEVICE_UUID_LENGTH); std::string localUdid = std::string(localUdidTemp); @@ -1996,7 +1989,7 @@ void DeviceManagerServiceImpl::HandleAppUnBindEvent(int32_t remoteUserId, const DmOfflineParam offlineParam = DeviceProfileConnector::GetInstance().HandleAppUnBindEvent(remoteUserId, remoteUdid, tokenId, localUdid); if (offlineParam.leftAclNumber != 0) { - LOGI("HandleAppUnBindEvent app-level type leftAclNumber not zero."); + LOGI("app-level type leftAclNumber not zero."); CHECK_NULL_VOID(softbusConnector_); softbusConnector_->SetProcessInfoVec(offlineParam.processVec); softbusConnector_->HandleDeviceOffline(remoteUdid); @@ -2004,7 +1997,7 @@ void DeviceManagerServiceImpl::HandleAppUnBindEvent(int32_t remoteUserId, const return; } if (offlineParam.leftAclNumber == 0) { - LOGI("HandleAppUnBindEvent app-level type leftAclNumber is zero."); + LOGI("app-level type leftAclNumber is zero."); CHECK_NULL_VOID(softbusConnector_); softbusConnector_->SetProcessInfoVec(offlineParam.processVec); if (!offlineParam.hasLnnAcl) { @@ -2021,7 +2014,7 @@ void DeviceManagerServiceImpl::HandleAppUnBindEvent(int32_t remoteUserId, const void DeviceManagerServiceImpl::HandleAppUnBindEvent(int32_t remoteUserId, const std::string &remoteUdid, int32_t tokenId, int32_t peerTokenId) { - LOGI("HandleAppUnBindEvent peerTokenId = %{public}d.", peerTokenId); + LOGI("peerTokenId = %{public}d.", peerTokenId); char localUdidTemp[DEVICE_UUID_LENGTH] = {0}; GetDevUdid(localUdidTemp, DEVICE_UUID_LENGTH); std::string localUdid = std::string(localUdidTemp); @@ -2030,7 +2023,7 @@ void DeviceManagerServiceImpl::HandleAppUnBindEvent(int32_t remoteUserId, const DeviceProfileConnector::GetInstance().HandleAppUnBindEvent(remoteUserId, remoteUdid, tokenId, localUdid, peerTokenId); if (offlineParam.leftAclNumber != 0) { - LOGI("HandleAppUnBindEvent app-level type leftAclNumber not zero."); + LOGI("app-level type leftAclNumber not zero."); CHECK_NULL_VOID(softbusConnector_); softbusConnector_->SetProcessInfoVec(offlineParam.processVec); softbusConnector_->HandleDeviceOffline(remoteUdid); @@ -2038,7 +2031,7 @@ void DeviceManagerServiceImpl::HandleAppUnBindEvent(int32_t remoteUserId, const return; } if (offlineParam.leftAclNumber == 0) { - LOGI("HandleAppUnBindEvent app-level type leftAclNumber is zero."); + LOGI("app-level type leftAclNumber is zero."); CHECK_NULL_VOID(softbusConnector_); softbusConnector_->SetProcessInfoVec(offlineParam.processVec); if (!offlineParam.hasLnnAcl) { @@ -2055,7 +2048,7 @@ void DeviceManagerServiceImpl::HandleAppUnBindEvent(int32_t remoteUserId, const void DeviceManagerServiceImpl::HandleServiceUnBindEvent(int32_t userId, const std::string &remoteUdid, int32_t remoteTokenId) { - LOGI("HandleServiceUnBindEvent remoteTokenId = %{public}d, userId: %{public}d, remoteUdid: %{public}s.", + LOGI("remoteTokenId = %{public}d, userId: %{public}d, remoteUdid: %{public}s.", remoteTokenId, userId, GetAnonyString(remoteUdid).c_str()); char localUdidTemp[DEVICE_UUID_LENGTH] = {0}; GetDevUdid(localUdidTemp, DEVICE_UUID_LENGTH); @@ -2324,7 +2317,7 @@ int32_t DeviceManagerServiceImpl::RegisterAuthenticationType(int32_t authenticat void DeviceManagerServiceImpl::DeleteAlwaysAllowTimeOut() { - LOGI("Start DeleteAlwaysAllowTimeOut"); + LOGI("Start"); std::vector profiles = DeviceProfileConnector::GetInstance().GetAllAccessControlProfile(); std::string remoteUdid = ""; @@ -2456,7 +2449,7 @@ int32_t DeviceManagerServiceImpl::CheckDeviceInfoPermission(const std::string &l int32_t DeviceManagerServiceImpl::DeleteAcl(const std::string &pkgName, const std::string &localUdid, const std::string &remoteUdid, int32_t bindLevel, const std::string &extra) { - LOGI("DeleteAcl pkgName %{public}s, localUdid %{public}s, remoteUdid %{public}s, bindLevel %{public}d.", + LOGI("pkgName %{public}s, localUdid %{public}s, remoteUdid %{public}s, bindLevel %{public}d.", pkgName.c_str(), GetAnonyString(localUdid).c_str(), GetAnonyString(remoteUdid).c_str(), bindLevel); if (static_cast(bindLevel) == USER) { DeleteGroup(pkgName, remoteUdid); @@ -2502,7 +2495,7 @@ int32_t DeviceManagerServiceImpl::DeleteAcl(const std::string &pkgName, const st int32_t DeviceManagerServiceImpl::DeleteSkCredAndAcl(const std::vector &acls) { - LOGI("DeleteSkCredAndAcl start."); + LOGI("start."); int32_t ret = DM_OK; if (acls.empty()) { return ret; @@ -2552,7 +2545,7 @@ int32_t DeviceManagerServiceImpl::DeleteAclForProcV2(const std::string &localUdi int32_t DeviceManagerServiceImpl::DeleteAclV2(const std::string &pkgName, const std::string &localUdid, const std::string &remoteUdid, int32_t bindLevel, const std::string &extra) { - LOGI("DeleteAclV2 pkgName %{public}s, localUdid %{public}s, remoteUdid %{public}s, bindLevel %{public}d.", + LOGI("pkgName %{public}s, localUdid %{public}s, remoteUdid %{public}s, bindLevel %{public}d.", pkgName.c_str(), GetAnonyString(localUdid).c_str(), GetAnonyString(remoteUdid).c_str(), bindLevel); uint32_t tokenId = 0; MultipleUserConnector::GetTokenId(tokenId); @@ -2594,7 +2587,6 @@ void DeviceManagerServiceImpl::HandleCommonEventBroadCast(const std::vector &bindParam, std::map &bindParamTmp, const DmBindCallerInfo &bindCallerInfo) { - LOGI("start."); bindParamTmp = const_cast &>(bindParam); bindParamTmp["bindCallerUserId"] = std::to_string(bindCallerInfo.userId); bindParamTmp["bindCallerTokenId"] = std::to_string(bindCallerInfo.tokenId); diff --git a/services/implementation/src/devicestate/dm_device_state_manager.cpp b/services/implementation/src/devicestate/dm_device_state_manager.cpp index 3b107ae51..573c67757 100644 --- a/services/implementation/src/devicestate/dm_device_state_manager.cpp +++ b/services/implementation/src/devicestate/dm_device_state_manager.cpp @@ -62,7 +62,7 @@ int32_t DmDeviceStateManager::RegisterSoftbusStateCallback() void DmDeviceStateManager::SaveOnlineDeviceInfo(const DmDeviceInfo &info) { - LOGI("SaveOnlineDeviceInfo begin, deviceId = %{public}s", GetAnonyString(std::string(info.deviceId)).c_str()); + LOGI("begin, deviceId = %{public}s", GetAnonyString(std::string(info.deviceId)).c_str()); std::string udid; if (SoftbusConnector::GetUdidByNetworkId(info.networkId, udid) == DM_OK) { std::string uuid; @@ -73,7 +73,7 @@ void DmDeviceStateManager::SaveOnlineDeviceInfo(const DmDeviceInfo &info) remoteDeviceInfos_[uuid] = saveInfo; stateDeviceInfos_[udid] = saveInfo; } - LOGI("SaveOnlineDeviceInfo complete, networkId = %{public}s, udid = %{public}s, uuid = %{public}s", + LOGI("complete, networkId = %{public}s, udid = %{public}s, uuid = %{public}s", GetAnonyString(std::string(info.networkId)).c_str(), GetAnonyString(udid).c_str(), GetAnonyString(uuid).c_str()); } @@ -81,7 +81,7 @@ void DmDeviceStateManager::SaveOnlineDeviceInfo(const DmDeviceInfo &info) void DmDeviceStateManager::DeleteOfflineDeviceInfo(const DmDeviceInfo &info) { - LOGI("DeleteOfflineDeviceInfo begin, deviceId = %{public}s", GetAnonyString(std::string(info.deviceId)).c_str()); + LOGI("begin, deviceId = %{public}s", GetAnonyString(std::string(info.deviceId)).c_str()); std::lock_guard mutexLock(remoteDeviceInfosMutex_); std::string deviceId = std::string(info.deviceId); for (auto iter: remoteDeviceInfos_) { @@ -102,7 +102,7 @@ void DmDeviceStateManager::DeleteOfflineDeviceInfo(const DmDeviceInfo &info) void DmDeviceStateManager::OnDeviceOnline(std::string deviceId, int32_t authForm) { - LOGI("DmDeviceStateManager::OnDeviceOnline, deviceId = %{public}s", GetAnonyString(deviceId).c_str()); + LOGI("OnDeviceOnline, deviceId = %{public}s", GetAnonyString(deviceId).c_str()); DmDeviceInfo devInfo = softbusConnector_->GetDeviceInfoByDeviceId(deviceId); if (devInfo.deviceId[0] == '\0') { LOGE("deviceId is empty."); @@ -121,7 +121,7 @@ void DmDeviceStateManager::OnDeviceOnline(std::string deviceId, int32_t authForm void DmDeviceStateManager::OnDeviceOffline(std::string deviceId) { - LOGI("DmDeviceStateManager::OnDeviceOffline, deviceId = %{public}s", GetAnonyString(deviceId).c_str()); + LOGI("OnDeviceOffline, deviceId = %{public}s", GetAnonyString(deviceId).c_str()); DmDeviceInfo devInfo; { std::lock_guard mutexLock(remoteDeviceInfosMutex_); @@ -171,7 +171,7 @@ void DmDeviceStateManager::HandleDeviceStatusChange(DmDeviceState devState, DmDe void DmDeviceStateManager::ProcessDeviceStateChange(const DmDeviceState devState, const DmDeviceInfo &devInfo) { - LOGI("ProcessDeviceStateChange begin, devState = %{public}d networkId: %{public}s.", devState, + LOGI("begin, devState = %{public}d networkId: %{public}s.", devState, GetAnonyString(devInfo.networkId).c_str()); CHECK_NULL_VOID(softbusConnector_); CHECK_NULL_VOID(listener_); @@ -362,27 +362,27 @@ int32_t DmDeviceStateManager::DeleteSkCredAndAcl(const std::vector void DmDeviceStateManager::StartEventThread() { - LOGI("StartEventThread begin"); + LOGD("StartEventThread begin"); eventTask_.threadRunning_ = true; eventTask_.queueThread_ = std::thread([this]() { this->ThreadLoop(); }); - LOGI("StartEventThread complete"); + LOGD("StartEventThread complete"); } void DmDeviceStateManager::StopEventThread() { - LOGI("StopEventThread begin"); + LOGD("StopEventThread begin"); eventTask_.threadRunning_ = false; eventTask_.queueCond_.notify_all(); eventTask_.queueFullCond_.notify_all(); if (eventTask_.queueThread_.joinable()) { eventTask_.queueThread_.join(); } - LOGI("StopEventThread complete"); + LOGD("StopEventThread complete"); } int32_t DmDeviceStateManager::AddTask(const std::shared_ptr &task) { - LOGI("AddTask begin, eventId: %{public}d", task->GetEventId()); + LOGD("AddTask begin, eventId: %{public}d", task->GetEventId()); { std::unique_lock lock(eventTask_.queueMtx_); while (eventTask_.queue_.size() >= DM_EVENT_QUEUE_CAPACITY) { @@ -391,13 +391,13 @@ int32_t DmDeviceStateManager::AddTask(const std::shared_ptr &task) eventTask_.queue_.push(task); } eventTask_.queueCond_.notify_one(); - LOGI("AddTask complete"); + LOGD("AddTask complete"); return DM_OK; } void DmDeviceStateManager::ThreadLoop() { - LOGI("ThreadLoop begin"); + LOGD("ThreadLoop begin"); int32_t ret = pthread_setname_np(pthread_self(), THREAD_LOOP); if (ret != DM_OK) { LOGE("ThreadLoop setname failed."); @@ -419,16 +419,16 @@ void DmDeviceStateManager::ThreadLoop() RunTask(task); } } - LOGI("ThreadLoop end"); + LOGD("ThreadLoop end"); } void DmDeviceStateManager::RunTask(const std::shared_ptr &task) { - LOGI("RunTask begin, eventId: %{public}d", task->GetEventId()); + LOGD("RunTask begin, eventId: %{public}d", task->GetEventId()); if (task->GetEventId() == DM_NOTIFY_EVENT_ONDEVICEREADY) { OnDbReady(std::string(DM_PKG_NAME), task->GetDeviceId()); } - LOGI("RunTask complete"); + LOGD("RunTask complete"); } DmAuthForm DmDeviceStateManager::GetAuthForm(const std::string &networkId) @@ -454,7 +454,7 @@ DmAuthForm DmDeviceStateManager::GetAuthForm(const std::string &networkId) int32_t DmDeviceStateManager::ProcNotifyEvent(const int32_t eventId, const std::string &deviceId) { - LOGI("ProcNotifyEvent in, eventId: %{public}d", eventId); + LOGD("ProcNotifyEvent in, eventId: %{public}d", eventId); return AddTask(std::make_shared(eventId, deviceId)); } @@ -499,7 +499,7 @@ void DmDeviceStateManager::ChangeDeviceInfo(const DmDeviceInfo &info) std::string DmDeviceStateManager::GetUdidByNetWorkId(std::string networkId) { - LOGI("DmDeviceStateManager::GetUdidByNetWorkId networkId %{public}s", GetAnonyString(networkId).c_str()); + LOGI("networkId %{public}s", GetAnonyString(networkId).c_str()); { std::lock_guard mutexLock(remoteDeviceInfosMutex_); for (auto &iter : stateDeviceInfos_) { @@ -517,7 +517,7 @@ int32_t DmDeviceStateManager::DeleteGroupByDP(const std::string &deviceId) { std::vector profiles = DeviceProfileConnector::GetInstance().GetAccessControlProfile(); - LOGI("DeleteGroupByDP, AccessControlProfile size is %{public}zu", profiles.size()); + LOGI("AccessControlProfile size is %{public}zu", profiles.size()); std::vector delPkgNameVec; for (auto &item : profiles) { std::string trustDeviceId = item.GetTrustDeviceId(); diff --git a/services/service/src/advertise/advertise_manager.cpp b/services/service/src/advertise/advertise_manager.cpp index 5a852f18a..769ba0ba5 100644 --- a/services/service/src/advertise/advertise_manager.cpp +++ b/services/service/src/advertise/advertise_manager.cpp @@ -42,11 +42,11 @@ AdvertiseManager::~AdvertiseManager() int32_t AdvertiseManager::StartAdvertising(const std::string &pkgName, const std::map &advertiseParam) { - LOGI("AdvertiseManager::StartAdvertising begin for pkgName = %{public}s.", pkgName.c_str()); if (pkgName.empty()) { LOGE("Invalid parameter, pkgName is empty."); return ERR_DM_INPUT_PARA_INVALID; } + LOGI("begin for pkgName = %{public}s.", pkgName.c_str()); DmPublishInfo dmPubInfo; ConfigAdvParam(advertiseParam, &dmPubInfo, pkgName); std::string capability = DM_CAPABILITY_OSD; @@ -66,7 +66,7 @@ int32_t AdvertiseManager::StartAdvertising(const std::string &pkgName, int32_t ret = softbusListener_->PublishSoftbusLNN(dmPubInfo, capability, customData); if (ret != DM_OK) { - LOGE("StartAdvertising failed, softbus publish lnn ret: %{public}d", ret); + LOGE("failed, softbus publish lnn ret: %{public}d", ret); return ret; } @@ -128,12 +128,11 @@ void AdvertiseManager::ConfigAdvParam(const std::map & int32_t AdvertiseManager::StopAdvertising(const std::string &pkgName, int32_t publishId) { - LOGI("AdvertiseManager::StopDiscovering begin for pkgName = %{public}s, publishId = %{public}d.", pkgName.c_str(), - publishId); if (pkgName.empty()) { LOGE("Invalid parameter, pkgName is empty."); return ERR_DM_INPUT_PARA_INVALID; } + LOGI("begin for pkgName = %{public}s, publishId = %{public}d.", pkgName.c_str(), publishId); int32_t innerPublishId = GetAndRemoveInnerPublishId(pkgName, publishId); if (innerPublishId == DM_INVALID_FLAG_ID) { LOGE("Failed: cannot find pkgName in cache map."); @@ -145,7 +144,7 @@ int32_t AdvertiseManager::StopAdvertising(const std::string &pkgName, int32_t pu void AdvertiseManager::HandleAutoStopAdvertise(const std::string &timerName, const std::string &pkgName, int32_t publishId) { - LOGI("HandleAutoStopAdvertise, auto stop advertise task timeout, timerName=%{public}s", timerName.c_str()); + LOGI("auto stop advertise task timeout, timerName=%{public}s", timerName.c_str()); StopAdvertising(pkgName, publishId); } @@ -197,11 +196,11 @@ int32_t AdvertiseManager::GetAndRemoveInnerPublishId(const std::string &pkgName, void AdvertiseManager::ClearPublishIdCache(const std::string &pkgName) { - LOGI("Begin for pkgName = %{public}s.", pkgName.c_str()); if (pkgName.empty()) { LOGE("Invalid parameter, pkgName is empty."); return; } + LOGI("Begin for pkgName = %{public}s.", pkgName.c_str()); std::lock_guard autoLock(pubMapLock_); for (auto iter : pkgName2PubIdMap_[pkgName]) { softbusListener_->StopPublishSoftbusLNN(iter.second); diff --git a/services/service/src/device_manager_service.cpp b/services/service/src/device_manager_service.cpp index a1785e600..f15c3e1de 100644 --- a/services/service/src/device_manager_service.cpp +++ b/services/service/src/device_manager_service.cpp @@ -201,7 +201,6 @@ DM_EXPORT void DeviceManagerService::SubscribeDataShareCommonEvent() #if defined(SUPPORT_BLUETOOTH) || defined(SUPPORT_WIFI) void DeviceManagerService::QueryDependsSwitchState() { - LOGI("DeviceManagerService::QueryDependsSwitchState start."); std::shared_ptr publishSubScriber = publshCommonEventManager_->GetSubscriber(); CHECK_NULL_VOID(publishSubScriber); auto samgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); @@ -319,7 +318,6 @@ int32_t DeviceManagerService::GetTrustedDeviceList(const std::string &pkgName, c std::vector &deviceList) { (void)extra; - LOGI("Begin for pkgName = %{public}s.", pkgName.c_str()); if (pkgName.empty()) { LOGE("Invalid parameter, pkgName is empty."); return ERR_DM_INPUT_PARA_INVALID; @@ -370,7 +368,6 @@ int32_t DeviceManagerService::GetAllTrustedDeviceList(const std::string &pkgName std::vector &deviceList) { (void)extra; - LOGI("Begin for pkgName = %{public}s.", pkgName.c_str()); if (pkgName.empty()) { LOGE("Invalid parameter, pkgName or extra is empty."); return ERR_DM_INPUT_PARA_INVALID; @@ -544,7 +541,7 @@ bool DeviceManagerService::IsCallerInWhiteList() bool DeviceManagerService::IsDMAdapterCheckApiWhiteListLoaded() { - LOGI("Start."); + LOGD("Start."); std::lock_guard lock(isAdapterCheckApiWhiteListLoadedLock_); if (isAdapterCheckApiWhiteListSoLoaded_ && (dmCheckApiWhiteList_ != nullptr)) { return true; @@ -909,7 +906,7 @@ int32_t DeviceManagerService::SetUserOperation(std::string &pkgName, int32_t act void DeviceManagerService::HandleDeviceStatusChange(DmDeviceState devState, DmDeviceInfo &devInfo) { - LOGI("DeviceManagerService::HandleDeviceStatusChange start, devState = %{public}d", devState); + LOGD("start, devState = %{public}d", devState); if (IsDMServiceImplReady()) { dmServiceImpl_->HandleDeviceStatusChange(devState, devInfo); } @@ -947,20 +944,17 @@ void DeviceManagerService::OnBytesReceived(int sessionId, const void *data, unsi int DeviceManagerService::OnPinHolderSessionOpened(int sessionId, int result) { - LOGI("In"); return PinHolderSession::OnSessionOpened(sessionId, result); } void DeviceManagerService::OnPinHolderSessionClosed(int sessionId) { - LOGI("In"); CHECK_NULL_VOID(pinHolder_); pinHolder_->OnSessionClosed(sessionId); } void DeviceManagerService::OnPinHolderBytesReceived(int sessionId, const void *data, unsigned int dataLen) { - LOGI("In"); PinHolderSession::OnBytesReceived(sessionId, data, dataLen); } @@ -1166,14 +1160,12 @@ bool DeviceManagerService::IsDMServiceImplReady() bool DeviceManagerService::IsDMImplSoLoaded() { - LOGI("In"); std::lock_guard lock(isImplLoadLock_); return isImplsoLoaded_; } bool DeviceManagerService::IsDMServiceAdapterSoLoaded() { - LOGI("In"); std::lock_guard lock(isAdapterResidentLoadLock_); if (!isAdapterResidentSoLoaded_ || (dmServiceImplExtResident_ == nullptr)) { return false; @@ -1253,7 +1245,6 @@ int32_t DeviceManagerService::GetEncryptedUuidByNetworkId(const std::string &pkg LOGE("Invalid parameter, pkgName is empty."); return ERR_DM_INPUT_PARA_INVALID; } - LOGI("PkgName = %{public}s", pkgName.c_str()); CHECK_NULL_RETURN(softbusListener_, ERR_DM_POINT_NULL); int32_t ret = softbusListener_->GetUuidByNetworkId(networkId.c_str(), uuid); if (ret != DM_OK) { @@ -1262,9 +1253,9 @@ int32_t DeviceManagerService::GetEncryptedUuidByNetworkId(const std::string &pkg } std::string appId = Crypto::Sha256(AppManager::GetInstance().GetAppId()); - LOGI("appId = %{public}s, uuid = %{public}s.", GetAnonyString(appId).c_str(), GetAnonyString(uuid).c_str()); uuid = Crypto::Sha256(appId + "_" + uuid); - LOGI("encryptedUuid = %{public}s.", GetAnonyString(uuid).c_str()); + LOGI("appId = %{public}s, uuid = %{public}s, encryptedUuid = %{public}s.", GetAnonyString(appId).c_str(), + GetAnonyString(uuid).c_str(), GetAnonyString(uuid).c_str()); return DM_OK; } @@ -1317,7 +1308,6 @@ int32_t DeviceManagerService::GetNetworkTypeByNetworkId(const std::string &pkgNa LOGE("The caller: %{public}s does not have permission to call GetNetworkTypeByNetworkId.", pkgName.c_str()); return ERR_DM_NO_PERMISSION; } - LOGI("Begin for pkgName = %{public}s", pkgName.c_str()); if (pkgName.empty() || netWorkId.empty()) { LOGE("Invalid parameter, pkgName: %{public}s, netWorkId: %{public}s", pkgName.c_str(), GetAnonyString(netWorkId).c_str()); @@ -1342,7 +1332,6 @@ int32_t DeviceManagerService::ImportAuthCode(const std::string &pkgName, const s LOGE("The caller: %{public}s is not in white list.", processName.c_str()); return ERR_DM_INPUT_PARA_INVALID; } - LOGI("DeviceManagerService::ImportAuthCode begin."); if (authCode.empty() || pkgName.empty()) { LOGE("Invalid parameter, authCode: %{public}s.", GetAnonyString(authCode).c_str()); return ERR_DM_INPUT_PARA_INVALID; @@ -1373,7 +1362,6 @@ int32_t DeviceManagerService::ExportAuthCode(std::string &authCode) LOGE("ExportAuthCode failed, instance not init or init failed."); return ERR_DM_NOT_INIT; } - LOGI("DeviceManagerService::ExportAuthCode begin."); return dmServiceImpl_->ExportAuthCode(authCode); } @@ -1393,7 +1381,6 @@ void DeviceManagerService::UnloadDMServiceImplSo() bool DeviceManagerService::IsDMServiceAdapterResidentLoad() { - LOGI("Start."); if (listener_ == nullptr) { listener_ = std::make_shared(); } @@ -1455,7 +1442,6 @@ int32_t DeviceManagerService::StartDiscovering(const std::string &pkgName, LOGE("The caller does not have permission to call"); return ERR_DM_NO_PERMISSION; } - LOGI("Start for pkgName = %{public}s", pkgName.c_str()); if (pkgName.empty()) { LOGE("Invalid parameter, pkgName is empty."); return ERR_DM_INPUT_PARA_INVALID; @@ -1475,7 +1461,6 @@ int32_t DeviceManagerService::StopDiscovering(const std::string &pkgName, LOGE("The caller does not have permission to call"); return ERR_DM_NO_PERMISSION; } - LOGI("Start for pkgName = %{public}s", pkgName.c_str()); if (pkgName.empty()) { LOGE("Invalid parameter, pkgName is empty."); return ERR_DM_INPUT_PARA_INVALID; @@ -1498,7 +1483,6 @@ int32_t DeviceManagerService::EnableDiscoveryListener(const std::string &pkgName LOGE("The caller does not have permission to call"); return ERR_DM_NO_PERMISSION; } - LOGI("Start for pkgName = %{public}s", pkgName.c_str()); if (pkgName.empty()) { LOGE("Invalid parameter, pkgName is empty."); return ERR_DM_INPUT_PARA_INVALID; @@ -1515,7 +1499,6 @@ int32_t DeviceManagerService::DisableDiscoveryListener(const std::string &pkgNam LOGE("The caller does not have permission to call"); return ERR_DM_NO_PERMISSION; } - LOGI("Start for pkgName = %{public}s", pkgName.c_str()); if (pkgName.empty()) { LOGE("Invalid parameter, pkgName is empty."); return ERR_DM_INPUT_PARA_INVALID; @@ -1531,7 +1514,6 @@ int32_t DeviceManagerService::StartAdvertising(const std::string &pkgName, LOGE("The caller does not have permission to call"); return ERR_DM_NO_PERMISSION; } - LOGI("Start for pkgName = %{public}s", pkgName.c_str()); if (pkgName.empty()) { LOGE("Invalid parameter, pkgName is empty."); return ERR_DM_INPUT_PARA_INVALID; @@ -1547,7 +1529,6 @@ int32_t DeviceManagerService::StopAdvertising(const std::string &pkgName, LOGE("The caller does not have permission to call"); return ERR_DM_NO_PERMISSION; } - LOGI("Start for pkgName = %{public}s", pkgName.c_str()); if (pkgName.empty()) { LOGE("Invalid parameter, pkgName is empty."); return ERR_DM_INPUT_PARA_INVALID; @@ -1787,7 +1768,6 @@ int32_t DeviceManagerService::CreatePinHolder(const std::string &pkgName, const LOGE("The caller: %{public}s is not in white list.", processName.c_str()); return ERR_DM_INPUT_PARA_INVALID; } - LOGI("DeviceManagerService::CreatePinHolder begin."); if (pkgName.empty()) { LOGE("Invalid parameter, pkgName: %{public}s.", pkgName.c_str()); return ERR_DM_INPUT_PARA_INVALID; @@ -1812,7 +1792,6 @@ int32_t DeviceManagerService::DestroyPinHolder(const std::string &pkgName, const LOGE("The caller: %{public}s is not in white list.", processName.c_str()); return ERR_DM_INPUT_PARA_INVALID; } - LOGI("Begin."); if (pkgName.empty()) { LOGE("Invalid parameter, pkgName: %{public}s.", pkgName.c_str()); return ERR_DM_INPUT_PARA_INVALID; @@ -1827,13 +1806,11 @@ int32_t DeviceManagerService::DpAclAdd(const std::string &udid) LOGE("The caller does not have permission to call DpAclAdd."); return ERR_DM_NO_PERMISSION; } - LOGI("Start."); if (!IsDMServiceImplReady()) { LOGE("DpAclAdd failed, instance not init or init failed."); return ERR_DM_NOT_INIT; } dmServiceImpl_->DpAclAdd(udid); - LOGI("DeviceManagerService::DpAclAdd completed"); return DM_OK; } @@ -1957,14 +1934,14 @@ void DeviceManagerService::SubscribeAccountCommonEvent() void DeviceManagerService::SendShareTypeUnBindBroadCast(const char *credId, const int32_t localUserId, const std::vector &peerUdids) { - LOGI("SendShareTypeUnBindBroadCast Start."); + LOGI("Start."); RelationShipChangeMsg msg; msg.type = RelationShipChangeType::SHARE_UNBIND; msg.userId = static_cast(localUserId); msg.credId = credId; msg.peerUdids = peerUdids; std::string broadCastMsg = ReleationShipSyncMgr::GetInstance().SyncTrustRelationShip(msg); - LOGI("SendShareTypeUnBindBroadCast broadCastMsg = %{public}s.", broadCastMsg.c_str()); + LOGI("broadCastMsg = %{public}s.", broadCastMsg.c_str()); CHECK_NULL_VOID(softbusListener_); softbusListener_->SendAclChangedBroadcast(broadCastMsg); } @@ -1987,8 +1964,6 @@ void DeviceManagerService::SubscribeScreenLockEvent() DM_EXPORT void DeviceManagerService::AccountCommonEventCallback( const std::string commonEventType, int32_t currentUserId, int32_t beforeUserId) { - LOGI("CommonEventType: %{public}s, currentUserId: %{public}d, beforeUserId: %{public}d", commonEventType.c_str(), - currentUserId, beforeUserId); if (commonEventType == CommonEventSupport::COMMON_EVENT_USER_SWITCHED) { DeviceNameManager::GetInstance().InitDeviceNameWhenUserSwitch(currentUserId, beforeUserId); MultipleUserConnector::SetAccountInfo(currentUserId, MultipleUserConnector::GetCurrentDMAccountInfo()); @@ -2047,8 +2022,7 @@ bool DeviceManagerService::IsUserStatusChanged(std::vector foregroundUs LOGI("User status has not changed."); return true; } - LOGI("User status has changed, foregroundUserVec_: %{public}s, backgroundUserVec_: %{public}s", - GetIntegerList(foregroundUserVec_).c_str(), GetIntegerList(backgroundUserVec_).c_str()); + LOGD("User status has changed"); foregroundUserVec_.clear(); backgroundUserVec_.clear(); foregroundUserVec_ = foregroundUserVec; @@ -2058,7 +2032,7 @@ bool DeviceManagerService::IsUserStatusChanged(std::vector foregroundUs void DeviceManagerService::HandleAccountCommonEvent(const std::string commonEventType) { - LOGI("HandleAccountCommonEvent commonEventType: %{public}s.", commonEventType.c_str()); + LOGI("commonEventType: %{public}s.", commonEventType.c_str()); std::vector foregroundUserVec; int32_t retFront = MultipleUserConnector::GetForegroundUserIds(foregroundUserVec); std::vector backgroundUserVec; @@ -2107,7 +2081,7 @@ void DeviceManagerService::HandleAccountCommonEvent(const std::string commonEven void DeviceManagerService::HandleUserSwitched() { - LOGI("onStart, HandleUserSwitched."); + LOGI("start."); std::vector foregroundUserVec; int32_t retFront = MultipleUserConnector::GetForegroundUserIds(foregroundUserVec); std::vector backgroundUserVec; @@ -2154,7 +2128,7 @@ void DeviceManagerService::NotifyRemoteAccountCommonEvent(const std::string comm const std::string &localUdid, const std::vector &peerUdids, const std::vector &foregroundUserIds, const std::vector &backgroundUserIds) { - LOGI("NotifyRemoteAccountCommonEvent, foregroundUserIds: %{public}s, backgroundUserIds: %{public}s", + LOGI("foregroundUserIds: %{public}s, backgroundUserIds: %{public}s", GetIntegerList(foregroundUserIds).c_str(), GetIntegerList(backgroundUserIds).c_str()); if (peerUdids.empty()) { return; @@ -2232,7 +2206,7 @@ void DeviceManagerService::NotifyRemoteAccountCommonEventByWifi(const std::strin int32_t DeviceManagerService::SendAccountCommonEventByWifi(const std::string &networkId, const std::vector &foregroundUserIds, const std::vector &backgroundUserIds) { - LOGI("Try open softbus session to exchange foreground/background userid"); + LOGI("start"); std::vector foregroundUserIdsUInt; for (auto const &u : foregroundUserIds) { foregroundUserIdsUInt.push_back(static_cast(u)); @@ -2537,7 +2511,6 @@ void DeviceManagerService::HandleUserIdsBroadCast(const std::vector std::vector foregroundUserIdInfos; std::vector backgroundUserIdInfos; GetFrontAndBackUserIdInfos(remoteUserIdInfos, foregroundUserIdInfos, backgroundUserIdInfos); - LOGI("process foreground and background userids"); // Notify received remote foreground userids to dsoftbus std::vector foregroundUserIds; for (const auto &u : foregroundUserIdInfos) { @@ -2623,7 +2596,6 @@ void DeviceManagerService::HandleCommonEventBroadCast(const std::vector foregroundUserIdInfos; std::vector backgroundUserIdInfos; GetFrontAndBackUserIdInfos(remoteUserIdInfos, foregroundUserIdInfos, backgroundUserIdInfos); - LOGI("process foreground and background userids"); // Notify received remote foreground userids to dsoftbus std::vector foregroundUserIds; for (const auto &u : foregroundUserIdInfos) { @@ -2708,7 +2680,6 @@ int32_t DeviceManagerService::SetDnPolicy(const std::string &pkgName, std::map foregroundUserIdsUInt; for (auto const &u : foregroundUserIds) { foregroundUserIdsUInt.push_back(static_cast(u)); @@ -3409,7 +3378,7 @@ void DeviceManagerService::HandleUserSwitchedEvent(int32_t currentUserId, int32_ void DeviceManagerService::HandleUserStopEvent(int32_t stopUserId) { - LOGI("onStart, HandleUserStopEvent %{public}s.", GetAnonyInt32(stopUserId).c_str()); + LOGI("stopUserId %{public}s.", GetAnonyInt32(stopUserId).c_str()); std::vector stopUserVec; stopUserVec.push_back(stopUserId); char localUdidTemp[DEVICE_UUID_LENGTH] = {0}; diff --git a/services/service/src/device_manager_service_listener.cpp b/services/service/src/device_manager_service_listener.cpp index f2f0932f6..2fa0fe73b 100644 --- a/services/service/src/device_manager_service_listener.cpp +++ b/services/service/src/device_manager_service_listener.cpp @@ -190,7 +190,6 @@ int32_t DeviceManagerServiceListener::FillUdidAndUuidToDeviceInfo(const std::str void DeviceManagerServiceListener::ProcessDeviceStateChange(const ProcessInfo &processInfo, const DmDeviceState &state, const DmDeviceInfo &info, const DmDeviceBasicInfo &deviceBasicInfo) { - LOGI("DeviceManagerServiceListener::ProcessDeviceStateChange, state = %{public}d", state); std::vector processInfoVec = GetNotifyProcessInfoByUserId(processInfo.userId, DmCommonNotifyEvent::REG_DEVICE_STATE); std::vector hpProcessInfoVec; @@ -249,7 +248,6 @@ void DeviceManagerServiceListener::ProcessAppStateChange(const ProcessInfo &proc void DeviceManagerServiceListener::OnDeviceStateChange(const ProcessInfo &processInfo, const DmDeviceState &state, const DmDeviceInfo &info) { - LOGI("OnDeviceStateChange, state = %{public}d", state); DmDeviceBasicInfo deviceBasicInfo; ConvertDeviceInfoToDeviceBasicInfo(processInfo.pkgName, info, deviceBasicInfo); if (processInfo.pkgName == std::string(DM_PKG_NAME)) { @@ -284,7 +282,7 @@ void DeviceManagerServiceListener::OnDeviceFound(const ProcessInfo &processInfo, void DeviceManagerServiceListener::OnDiscoveryFailed(const ProcessInfo &processInfo, uint16_t subscribeId, int32_t failedReason) { - LOGI("DeviceManagerServiceListener::OnDiscoveryFailed"); + LOGI("OnDiscoveryFailed"); std::shared_ptr pReq = std::make_shared(); std::shared_ptr pRsp = std::make_shared(); @@ -297,7 +295,7 @@ void DeviceManagerServiceListener::OnDiscoveryFailed(const ProcessInfo &processI void DeviceManagerServiceListener::OnDiscoverySuccess(const ProcessInfo &processInfo, int32_t subscribeId) { - LOGI("DeviceManagerServiceListener::OnDiscoverySuccess"); + LOGI("OnDiscoverySuccess"); std::shared_ptr pReq = std::make_shared(); std::shared_ptr pRsp = std::make_shared(); @@ -310,7 +308,7 @@ void DeviceManagerServiceListener::OnDiscoverySuccess(const ProcessInfo &process void DeviceManagerServiceListener::OnPublishResult(const std::string &pkgName, int32_t publishId, int32_t publishResult) { - LOGI("DeviceManagerServiceListener::OnPublishResult : %{public}d", publishResult); + LOGI("OnPublishResult : %{public}d", publishResult); std::shared_ptr pReq = std::make_shared(); std::shared_ptr pRsp = std::make_shared(); @@ -420,7 +418,7 @@ void DeviceManagerServiceListener::OnUnbindResult(const ProcessInfo &processInfo void DeviceManagerServiceListener::OnPinHolderCreate(const ProcessInfo &processInfo, const std::string &deviceId, DmPinType pinType, const std::string &payload) { - LOGI("DeviceManagerServiceListener::OnPinHolderCreate : %{public}s", processInfo.pkgName.c_str()); + LOGI("OnPinHolderCreate : %{public}s", processInfo.pkgName.c_str()); std::shared_ptr pReq = std::make_shared(); std::shared_ptr pRsp = std::make_shared(); @@ -435,7 +433,7 @@ void DeviceManagerServiceListener::OnPinHolderCreate(const ProcessInfo &processI void DeviceManagerServiceListener::OnPinHolderDestroy(const ProcessInfo &processInfo, DmPinType pinType, const std::string &payload) { - LOGI("DeviceManagerServiceListener::OnPinHolderDestroy : %{public}s", processInfo.pkgName.c_str()); + LOGI("OnPinHolderDestroy : %{public}s", processInfo.pkgName.c_str()); std::shared_ptr pReq = std::make_shared(); std::shared_ptr pRsp = std::make_shared(); @@ -448,7 +446,7 @@ void DeviceManagerServiceListener::OnPinHolderDestroy(const ProcessInfo &process void DeviceManagerServiceListener::OnCreateResult(const ProcessInfo &processInfo, int32_t result) { - LOGI("DeviceManagerServiceListener::OnCreateResult : %{public}d", result); + LOGI("OnCreateResult : %{public}d", result); std::shared_ptr pReq = std::make_shared(); std::shared_ptr pRsp = std::make_shared(); @@ -460,7 +458,7 @@ void DeviceManagerServiceListener::OnCreateResult(const ProcessInfo &processInfo void DeviceManagerServiceListener::OnDestroyResult(const ProcessInfo &processInfo, int32_t result) { - LOGI("DeviceManagerServiceListener::OnDestroyResult : %{public}d", result); + LOGI("OnDestroyResult : %{public}d", result); std::shared_ptr pReq = std::make_shared(); std::shared_ptr pRsp = std::make_shared(); @@ -488,7 +486,6 @@ void DeviceManagerServiceListener::OnPinHolderEvent(const ProcessInfo &processIn #if !(defined(__LITEOS_M__) || defined(LITE_DEVICE)) int32_t DeviceManagerServiceListener::ConvertUdidHashToAnoyAndSave(const std::string &pkgName, DmDeviceInfo &deviceInfo) { - LOGD("pkgName %{public}s.", pkgName.c_str()); std::string appId = ""; if (AppManager::GetInstance().GetAppIdByPkgName(pkgName, appId) != DM_OK) { LOGD("GetAppIdByPkgName failed"); @@ -514,7 +511,6 @@ int32_t DeviceManagerServiceListener::ConvertUdidHashToAnoyAndSave(const std::st int32_t DeviceManagerServiceListener::ConvertUdidHashToAnoyDeviceId(const std::string &pkgName, const std::string &udidHash, std::string &anoyDeviceId) { - LOGI("pkgName %{public}s, udidHash %{public}s.", pkgName.c_str(), GetAnonyString(udidHash).c_str()); std::string appId = ""; if (AppManager::GetInstance().GetAppIdByPkgName(pkgName, appId) != DM_OK) { LOGD("GetAppIdByPkgName failed"); diff --git a/services/service/src/devicenamemgr/device_name_manager.cpp b/services/service/src/devicenamemgr/device_name_manager.cpp index d0522f152..537f9d81c 100644 --- a/services/service/src/devicenamemgr/device_name_manager.cpp +++ b/services/service/src/devicenamemgr/device_name_manager.cpp @@ -277,7 +277,7 @@ void DeviceNameManager::InitDeviceName(int32_t userId) { LOGI("In userId:%{public}d", userId); if (userId == -1) { - LOGI("userId:%{public}d is invalid", userId); + LOGE("userId:%{public}d is invalid", userId); return; } std::string userDefinedDeviceName = ""; diff --git a/services/service/src/discovery/discovery_manager.cpp b/services/service/src/discovery/discovery_manager.cpp index 451b07b5f..fbc1b456e 100644 --- a/services/service/src/discovery/discovery_manager.cpp +++ b/services/service/src/discovery/discovery_manager.cpp @@ -59,11 +59,11 @@ DiscoveryManager::~DiscoveryManager() int32_t DiscoveryManager::EnableDiscoveryListener(const std::string &pkgName, const std::map &discoverParam, const std::map &filterOptions) { - LOGI("DiscoveryManager::EnableDiscoveryListener begin for pkgName = %{public}s.", pkgName.c_str()); if (pkgName.empty()) { LOGE("Invalid parameter, pkgName is empty."); return ERR_DM_INPUT_PARA_INVALID; } + LOGI("begin for pkgName = %{public}s.", pkgName.c_str()); std::string pkgNameTemp = AddMultiUserIdentify(pkgName); DmSubscribeInfo dmSubInfo; dmSubInfo.subscribeId = DM_INVALID_FLAG_ID; @@ -78,7 +78,7 @@ int32_t DiscoveryManager::EnableDiscoveryListener(const std::string &pkgName, UpdateInfoFreq(discoverParam, dmSubInfo); if (discoverParam.find(PARAM_KEY_META_TYPE) != discoverParam.end()) { std::string metaType = discoverParam.find(PARAM_KEY_META_TYPE)->second; - LOGI("EnableDiscoveryListener, input MetaType = %{public}s in discoverParam map.", metaType.c_str()); + LOGI("input MetaType = %{public}s.", metaType.c_str()); } if (discoverParam.find(PARAM_KEY_SUBSCRIBE_ID) != discoverParam.end() && IsNumberString((discoverParam.find(PARAM_KEY_SUBSCRIBE_ID)->second))) { @@ -89,11 +89,11 @@ int32_t DiscoveryManager::EnableDiscoveryListener(const std::string &pkgName, if (discoverParam.find(PARAM_KEY_DISC_CAPABILITY) != discoverParam.end()) { std::string capability = discoverParam.find(PARAM_KEY_DISC_CAPABILITY)->second; if (strcpy_s(dmSubInfo.capability, DM_MAX_DEVICE_CAPABILITY_LEN, capability.c_str()) != EOK) { - LOGI("EnableDiscoveryListener failed, capability copy err."); + LOGE("failed, capability copy err."); return ERR_DM_ENABLE_DISCOVERY_LISTENER_FAILED; } } - LOGI("EnableDiscoveryListener capability = %{public}s,", std::string(dmSubInfo.capability).c_str()); + LOGI("capability = %{public}s,", std::string(dmSubInfo.capability).c_str()); { std::lock_guard capLock(capabilityMapLocks_); capabilityMap_[pkgNameTemp] = std::string(dmSubInfo.capability); @@ -101,7 +101,7 @@ int32_t DiscoveryManager::EnableDiscoveryListener(const std::string &pkgName, UpdateInfoMedium(discoverParam, dmSubInfo); int32_t ret = softbusListener_->RefreshSoftbusLNN(DM_PKG_NAME, dmSubInfo, LNN_DISC_CAPABILITY); if (ret != DM_OK) { - LOGE("EnableDiscoveryListener failed, softbus refresh lnn ret: %{public}d.", ret); + LOGE("failed, softbus refresh lnn ret: %{public}d.", ret); return ret; } softbusListener_->RegisterSoftbusLnnOpsCbk(pkgNameTemp, shared_from_this()); @@ -111,11 +111,11 @@ int32_t DiscoveryManager::EnableDiscoveryListener(const std::string &pkgName, int32_t DiscoveryManager::DisableDiscoveryListener(const std::string &pkgName, const std::map &extraParam) { - LOGI("DiscoveryManager::DisableDiscoveryListener begin for pkgName = %{public}s.", pkgName.c_str()); if (pkgName.empty()) { LOGE("Invalid parameter, pkgName is empty."); return ERR_DM_INPUT_PARA_INVALID; } + LOGI("begin for pkgName = %{public}s.", pkgName.c_str()); std::string pkgNameTemp = RemoveMultiUserIdentify(pkgName); if (extraParam.find(PARAM_KEY_META_TYPE) != extraParam.end()) { LOGI("DisableDiscoveryListener, input MetaType = %{public}s", @@ -145,11 +145,11 @@ int32_t DiscoveryManager::DisableDiscoveryListener(const std::string &pkgName, int32_t DiscoveryManager::StartDiscovering(const std::string &pkgName, const std::map &discoverParam, const std::map &filterOptions) { - LOGI("DiscoveryManager::StartDiscovering begin for pkgName = %{public}s.", pkgName.c_str()); if (pkgName.empty()) { LOGE("Invalid parameter, pkgName is empty."); return ERR_DM_INPUT_PARA_INVALID; } + LOGI("begin for pkgName = %{public}s.", pkgName.c_str()); std::string pkgNameTemp = AddMultiUserIdentify(pkgName); DmSubscribeInfo dmSubInfo; ConfigDiscParam(discoverParam, &dmSubInfo); @@ -185,7 +185,6 @@ int32_t DiscoveryManager::StartDiscovering(const std::string &pkgName, void DiscoveryManager::ConfigDiscParam(const std::map &discoverParam, DmSubscribeInfo *dmSubInfo) { - LOGI("DiscoveryManager::ConfigDiscParam"); if (dmSubInfo == nullptr) { LOGE("ConfigDiscParam failed, dmSubInfo is nullptr."); return; @@ -220,7 +219,7 @@ int32_t DiscoveryManager::StartDiscovering4MineLibary(const std::string &pkgName LOGE("capability copy err."); return ERR_DM_START_DISCOVERING_FAILED; } - LOGI("StartDiscovering for mine meta node process, pkgName = %{public}s, capability = %{public}s", + LOGI("mine meta node process, pkgName = %{public}s, capability = %{public}s", pkgName.c_str(), std::string(dmSubInfo.capability).c_str()); { std::lock_guard capLock(capabilityMapLocks_); @@ -248,7 +247,7 @@ int32_t DiscoveryManager::StartDiscoveringNoMetaType(const std::string &pkgName, LOGE("capability copy err."); return ERR_DM_START_DISCOVERING_FAILED; } - LOGI("StartDiscovering for standard meta node process, pkgName = %{public}s, capability = %{public}s", + LOGI("standard meta node process, pkgName = %{public}s, capability = %{public}s", pkgName.c_str(), std::string(dmSubInfo.capability).c_str()); { @@ -269,33 +268,33 @@ int32_t DiscoveryManager::StartDiscoveringNoMetaType(const std::string &pkgName, int32_t DiscoveryManager::StartDiscovering4MetaType(const std::string &pkgName, DmSubscribeInfo &dmSubInfo, const std::map ¶m) { - LOGI("StartDiscovering for meta node process, input metaType = %{public}s, pkgName = %{public}s", + LOGI("meta node process, input metaType = %{public}s, pkgName = %{public}s", (param.find(PARAM_KEY_META_TYPE)->second).c_str(), pkgName.c_str()); MetaNodeType metaType = (MetaNodeType)(std::atoi((param.find(PARAM_KEY_META_TYPE)->second).c_str())); switch (metaType) { case MetaNodeType::PROXY_SHARE: - LOGI("StartDiscovering4MetaType for share meta node process."); + LOGI("share meta node."); if (strcpy_s(dmSubInfo.capability, DM_MAX_DEVICE_CAPABILITY_LEN, DM_CAPABILITY_SHARE) != EOK) { LOGE("capability copy error."); return ERR_DM_FAILED; } break; case MetaNodeType::PROXY_WEAR: - LOGI("StartDiscovering4MetaType for wear meta node process."); + LOGI("wear meta node."); if (strcpy_s(dmSubInfo.capability, DM_MAX_DEVICE_CAPABILITY_LEN, DM_CAPABILITY_WEAR) != EOK) { LOGE("capability copy error."); return ERR_DM_FAILED; } break; case MetaNodeType::PROXY_CASTPLUS: - LOGI("StartDiscovering4MetaType for cast_plus meta node process."); + LOGI("cast_plus meta node."); if (strcpy_s(dmSubInfo.capability, DM_MAX_DEVICE_CAPABILITY_LEN, DM_CAPABILITY_CASTPLUS) != EOK) { LOGE("capability copy error."); return ERR_DM_FAILED; } break; default: - LOGE("StartDiscovering4MetaType failed, unsupport meta type : %{public}d.", metaType); + LOGE("failed, unsupport meta type : %{public}d.", metaType); return ERR_DM_UNSUPPORTED_METHOD; } @@ -303,7 +302,7 @@ int32_t DiscoveryManager::StartDiscovering4MetaType(const std::string &pkgName, if (param.find(PARAM_KEY_CUSTOM_DATA) != param.end()) { customData = param.find(PARAM_KEY_CUSTOM_DATA)->second; } - LOGI("StartDiscovering4MetaType capability = %{public}s,", std::string(dmSubInfo.capability).c_str()); + LOGI("capability = %{public}s,", std::string(dmSubInfo.capability).c_str()); { std::lock_guard capLock(capabilityMapLocks_); capabilityMap_[pkgName] =std::string(dmSubInfo.capability); @@ -318,22 +317,22 @@ int32_t DiscoveryManager::StartDiscovering4MetaType(const std::string &pkgName, int32_t DiscoveryManager::StopDiscovering(const std::string &pkgName, uint16_t subscribeId) { - LOGI("DiscoveryManager::StopDiscovering begin for pkgName = %{public}s.", pkgName.c_str()); if (pkgName.empty()) { LOGE("Invalid parameter, pkgName is empty."); return ERR_DM_INPUT_PARA_INVALID; } + LOGI("begin for pkgName = %{public}s.", pkgName.c_str()); std::string pkgNameTemp = RemoveMultiUserIdentify(pkgName); return StopDiscoveringByInnerSubId(pkgNameTemp, subscribeId); } int32_t DiscoveryManager::StopDiscoveringByInnerSubId(const std::string &pkgName, uint16_t subscribeId) { - LOGI("DiscoveryManager::StopDiscovering begin for pkgName = %{public}s.", pkgName.c_str()); if (pkgName.empty()) { LOGE("Invalid parameter, pkgName is empty."); return ERR_DM_INPUT_PARA_INVALID; } + LOGI("begin for pkgName = %{public}s.", pkgName.c_str()); uint16_t innerSubId = static_cast(GetAndRemoveInnerSubId(pkgName, subscribeId)); if (innerSubId == DM_INVALID_FLAG_ID) { LOGE("Invalid parameter, cannot find subscribeId in cache map."); @@ -459,7 +458,7 @@ bool DiscoveryManager::CompareCapability(uint32_t capabilityType, const std::str void DiscoveryManager::OnDiscoveringResult(const std::string &pkgName, int32_t subscribeId, int32_t result) { - LOGI("DiscoveryManager::OnDiscoveringResult, subscribeId = %{public}d, result = %{public}d.", subscribeId, result); + LOGI("subscribeId = %{public}d, result = %{public}d.", subscribeId, result); int32_t userId = -1; std::string callerPkgName = ""; GetPkgNameAndUserId(pkgName, callerPkgName, userId); @@ -546,7 +545,7 @@ int32_t DiscoveryManager::HandleDiscoveryQueue(const std::string &pkgName, uint1 void DiscoveryManager::HandleDiscoveryTimeout(const std::string &pkgName) { - LOGI("DiscoveryManager::HandleDiscoveryTimeout, pkgName: %{public}s.", pkgName.c_str()); + LOGI("pkgName: %{public}s.", pkgName.c_str()); uint16_t subscribeId = 0; { std::lock_guard autoLock(locks_); @@ -643,13 +642,12 @@ bool DiscoveryManager::IsCommonDependencyReady() } dpConnector_ = func(); isSoLoaded_ = true; - LOGI("IsCommonDependencyReady success."); return true; } bool DiscoveryManager::CloseCommonDependencyObj() { - LOGI("DiscoveryManager::CloseCommonDependencyObj start."); + LOGI("start."); std::lock_guard lock(comDependencyLoadLock); if (!isSoLoaded_ && (dpConnector_ == nullptr) && (dpConnectorHandle_ == nullptr)) { return true; @@ -663,7 +661,6 @@ bool DiscoveryManager::CloseCommonDependencyObj() isSoLoaded_ = false; dpConnector_ = nullptr; dpConnectorHandle_ = nullptr; - LOGI("close libdevicemanagerdependency so success."); return true; } #endif diff --git a/services/service/src/hichain/hichain_listener.cpp b/services/service/src/hichain/hichain_listener.cpp index 4ee33e95f..d816748c3 100644 --- a/services/service/src/hichain/hichain_listener.cpp +++ b/services/service/src/hichain/hichain_listener.cpp @@ -106,7 +106,7 @@ HichainListener::~HichainListener() void HichainListener::RegisterDataChangeCb() { - LOGI("HichainListener::RegisterDataChangeCb start"); + LOGI("start"); if (deviceGroupManager_ == nullptr) { LOGE("deviceGroupManager_ is null!"); return; @@ -116,12 +116,12 @@ void HichainListener::RegisterDataChangeCb() LOGE("[HICHAIN]regDataChangeListener failed with ret: %{public}d.", ret); return; } - LOGI("RegisterDataChangeCb success!"); + LOGI("success!"); } void HichainListener::RegisterCredentialCb() { - LOGI("HichainListener::RegisterCredentialCb start"); + LOGI("start"); if (credManager_ == nullptr) { LOGE("credManager_ is null!"); return; @@ -131,12 +131,12 @@ void HichainListener::RegisterCredentialCb() LOGE("[HICHAIN]registerChangeListener failed with ret: %{public}d.", ret); return; } - LOGI("RegisterCredentialCb success!"); + LOGI("success!"); } void HichainListener::OnHichainDeviceUnBound(const char *peerUdid, const char *groupInfo) { - LOGI("HichainListener::onDeviceUnBound start"); + LOGI("start"); if (peerUdid == nullptr || groupInfo == nullptr) { LOGE("peerUdid or groupInfo is null!"); return; @@ -167,7 +167,7 @@ void HichainListener::OnHichainDeviceUnBound(const char *peerUdid, const char *g void HichainListener::OnCredentialDeleted(const char *credId, const char *credInfo) { - LOGI("HichainListener::OnCredentialDeleted start"); + LOGI("start"); if (credId == nullptr || credInfo == nullptr) { LOGE("credId or credInfo is null!"); return; @@ -182,7 +182,7 @@ void HichainListener::OnCredentialDeleted(const char *credId, const char *credIn void HichainListener::DeleteAllGroup(const std::string &localUdid, const std::vector &backgroundUserIds) { - LOGI("OnStart HichainListener::DeleteAllGroup"); + LOGI("start"); for (auto &userId : backgroundUserIds) { std::vector groupList; GetRelatedGroups(userId, localUdid, groupList); @@ -222,11 +222,11 @@ int32_t HichainListener::GetRelatedGroupsExt(int32_t userId, const std::string & int32_t HichainListener::GetRelatedGroupsCommon(int32_t userId, const std::string &deviceId, const char* pkgName, std::vector &groupList) { - LOGI("Start to get related groups."); if (userId < 0) { LOGE("user id failed"); return ERR_DM_FAILED; } + LOGI("Start."); uint32_t groupNum = 0; char *returnGroups = nullptr; int32_t ret = diff --git a/services/service/src/ipc/standard/ipc_server_listener.cpp b/services/service/src/ipc/standard/ipc_server_listener.cpp index c6852a5e5..b40ee0a40 100644 --- a/services/service/src/ipc/standard/ipc_server_listener.cpp +++ b/services/service/src/ipc/standard/ipc_server_listener.cpp @@ -38,7 +38,7 @@ int32_t IpcServerListener::SendRequest(int32_t cmdCode, std::shared_ptr } sptr listener = IpcServerStub::GetInstance().GetDmListener(processInfo); if (listener == nullptr) { - LOGI("cannot get listener for package:%{public}s.", processInfo.pkgName.c_str()); + LOGE("cannot get listener for package:%{public}s.", processInfo.pkgName.c_str()); return ERR_DM_POINT_NULL; } return listener->SendCmd(cmdCode, req, rsp); diff --git a/services/service/src/ipc/standard/ipc_server_stub.cpp b/services/service/src/ipc/standard/ipc_server_stub.cpp index 0d90c048f..c85383af7 100644 --- a/services/service/src/ipc/standard/ipc_server_stub.cpp +++ b/services/service/src/ipc/standard/ipc_server_stub.cpp @@ -284,16 +284,15 @@ ServiceRunningState IpcServerStub::QueryServiceState() const int32_t IpcServerStub::RegisterDeviceManagerListener(const ProcessInfo &processInfo, sptr listener) { - LOGI("RegisterDeviceManagerListener start"); if (processInfo.pkgName.empty() || listener == nullptr) { LOGE("RegisterDeviceManagerListener error: input parameter invalid."); return ERR_DM_POINT_NULL; } + LOGI("pkgName: %{public}s", processInfo.pkgName.c_str()); #ifdef SUPPORT_MEMMGR int pid = getpid(); Memory::MemMgrClient::GetInstance().SetCritical(pid, true, DISTRIBUTED_HARDWARE_DEVICEMANAGER_SA_ID); #endif // SUPPORT_MEMMGR - LOGI("Register device manager listener for package name: %{public}s", processInfo.pkgName.c_str()); std::lock_guard autoLock(listenerLock_); auto iter = dmListener_.find(processInfo); if (iter != dmListener_.end()) { @@ -315,16 +314,14 @@ int32_t IpcServerStub::RegisterDeviceManagerListener(const ProcessInfo &processI if (!listener->AsObject()->AddDeathRecipient(appRecipient)) { LOGE("AddDeathRecipient Failed"); } - LOGI("Checking the number of listeners."); if (dmListener_.size() > MAX_CALLBACK_NUM || appRecipient_.size() > MAX_CALLBACK_NUM) { LOGE("dmListener_ or appRecipient_ size exceed the limit!"); return ERR_DM_FAILED; } dmListener_[processInfo] = listener; appRecipient_[processInfo] = appRecipient; - LOGI("Add system sa."); AddSystemSA(processInfo.pkgName); - LOGI("Register listener complete."); + LOGI("complete."); return DM_OK; } @@ -334,7 +331,7 @@ int32_t IpcServerStub::UnRegisterDeviceManagerListener(const ProcessInfo &proces LOGE("Invalid parameter, pkgName is empty."); return ERR_DM_INPUT_PARA_INVALID; } - LOGI("IpcServerStub::UnRegisterDeviceManagerListener In, pkgName: %{public}s", processInfo.pkgName.c_str()); + LOGI("In, pkgName: %{public}s", processInfo.pkgName.c_str()); std::lock_guard autoLock(listenerLock_); auto listenerIter = dmListener_.find(processInfo); if (listenerIter == dmListener_.end()) { @@ -402,7 +399,7 @@ const ProcessInfo IpcServerStub::GetDmListenerPkgName(const wptr int32_t IpcServerStub::Dump(int32_t fd, const std::vector& args) { - LOGI("DistributedHardwareService Dump."); + LOGI("start."); std::vector argsStr {}; for (auto item : args) { argsStr.emplace_back(Str16ToStr8(item)); diff --git a/services/service/src/permission/standard/permission_manager.cpp b/services/service/src/permission/standard/permission_manager.cpp index 2a9bddddf..c88b33ba8 100644 --- a/services/service/src/permission/standard/permission_manager.cpp +++ b/services/service/src/permission/standard/permission_manager.cpp @@ -153,7 +153,7 @@ int32_t PermissionManager::GetCallerProcessName(std::string &processName) LOGE("GetCallerProcessName GetCallingTokenID error."); return ERR_DM_FAILED; } - LOGI("GetCallerProcessName::tokenCaller ID == %{public}s", GetAnonyInt32(tokenCaller).c_str()); + LOGI("tokenCaller ID == %{public}s", GetAnonyInt32(tokenCaller).c_str()); ATokenTypeEnum tokenTypeFlag = AccessTokenKit::GetTokenTypeFlag(tokenCaller); if (tokenTypeFlag == ATokenTypeEnum::TOKEN_HAP) { HapTokenInfo tokenInfo; @@ -185,12 +185,10 @@ int32_t PermissionManager::GetCallerProcessName(std::string &processName) bool PermissionManager::CheckProcessNameValidOnAuthCode(const std::string &processName) { - LOGI("Enter PermissionManager::CheckProcessNameValidOnAuthCode"); if (processName.empty()) { LOGE("ProcessName is empty"); return false; } - uint16_t index = 0; for (; index < AUTH_CODE_WHITE_LIST_NUM; ++index) { std::string tmp(g_authCodeWhiteList[index]); @@ -198,14 +196,11 @@ bool PermissionManager::CheckProcessNameValidOnAuthCode(const std::string &proce return true; } } - - LOGE("CheckProcessNameValidOnAuthCode process name: %{public}s invalid.", processName.c_str()); return false; } bool PermissionManager::CheckProcessNameValidOnPinHolder(const std::string &processName) { - LOGI("Enter PermissionManager::CheckProcessNameValidOnPinHolder"); if (processName.empty()) { LOGE("ProcessName is empty"); return false; @@ -218,8 +213,6 @@ bool PermissionManager::CheckProcessNameValidOnPinHolder(const std::string &proc return true; } } - - LOGE("CheckProcessNameValidOnPinHolder process name: %{public}s invalid.", processName.c_str()); return false; } @@ -246,13 +239,11 @@ std::unordered_set PermissionManager::GetWhiteListSystemSA() bool PermissionManager::CheckSystemSA(const std::string &pkgName) { - LOGI("Get calling tokenID."); AccessTokenID tokenCaller = IPCSkeleton::GetCallingTokenID(); if (tokenCaller == 0) { LOGE("CheckMonitorPermission GetCallingTokenID error."); return false; } - LOGI("Get token type flag."); ATokenTypeEnum tokenTypeFlag = AccessTokenKit::GetTokenTypeFlag(tokenCaller); if (tokenTypeFlag == ATokenTypeEnum::TOKEN_NATIVE) { return true; @@ -273,8 +264,6 @@ bool PermissionManager::CheckProcessNameValidOnSetDnPolicy(const std::string &pr return true; } } - - LOGE("Process name: %{public}s invalid.", processName.c_str()); return false; } @@ -291,8 +280,6 @@ bool PermissionManager::CheckProcessNameValidOnGetDeviceInfo(const std::string & return true; } } - - LOGE("Process name: %{public}s invalid.", processName.c_str()); return false; } @@ -309,8 +296,6 @@ bool PermissionManager::CheckProcessNameValidModifyLocalDeviceName(const std::st return true; } } - - LOGE("Process name: %{public}s invalid.", processName.c_str()); return false; } @@ -327,8 +312,6 @@ bool PermissionManager::CheckProcessNameValidModifyRemoteDeviceName(const std::s return true; } } - - LOGE("Process name: %{public}s invalid.", processName.c_str()); return false; } @@ -345,8 +328,6 @@ bool PermissionManager::CheckProcessNameValidPutDeviceProfileInfoList(const std: return true; } } - - LOGE("Process name: %{public}s invalid.", processName.c_str()); return false; } } // namespace DistributedHardware diff --git a/services/service/src/pinholder/pin_holder_session.cpp b/services/service/src/pinholder/pin_holder_session.cpp index 1b1e45013..44b8a3b8d 100644 --- a/services/service/src/pinholder/pin_holder_session.cpp +++ b/services/service/src/pinholder/pin_holder_session.cpp @@ -38,7 +38,6 @@ int32_t PinHolderSession::RegisterSessionCallback(std::shared_ptr autoLock(pinHolderSessionLock_); pinholderSessionCallback_ = callback; - LOGI("end."); return DM_OK; } @@ -46,7 +45,6 @@ int32_t PinHolderSession::UnRegisterSessionCallback() { std::lock_guard autoLock(pinHolderSessionLock_); pinholderSessionCallback_ = nullptr; - LOGI("end."); return DM_OK; } @@ -64,7 +62,7 @@ int32_t PinHolderSession::OpenSessionServer(const PeerTargetId &targetId) LOGE("[SOFTBUS]open session error, sessionId: %{public}d.", sessionId); return sessionId; } - LOGI("OpenAuthSession success. sessionId: %{public}d.", sessionId); + LOGI("success. sessionId: %{public}d.", sessionId); return sessionId; } @@ -82,7 +80,7 @@ int PinHolderSession::OnSessionOpened(int sessionId, int result) std::lock_guard autoLock(pinHolderSessionLock_); tempCbk = pinholderSessionCallback_; } - LOGI("[SOFTBUS]OnBytesReceived sessionId: %{public}d", sessionId); + LOGI("[SOFTBUS]OnSessionOpened sessionId: %{public}d", sessionId); if (tempCbk == nullptr) { LOGE("OnSessionOpened error, pinholderSessionCallback_ is nullptr."); return ERR_DM_FAILED; diff --git a/services/service/src/relationshipsyncmgr/dm_comm_tool.cpp b/services/service/src/relationshipsyncmgr/dm_comm_tool.cpp index a1c20d253..f6e4b6df6 100644 --- a/services/service/src/relationshipsyncmgr/dm_comm_tool.cpp +++ b/services/service/src/relationshipsyncmgr/dm_comm_tool.cpp @@ -106,7 +106,7 @@ int32_t DMCommTool::SendUserIds(const std::string rmtNetworkId, LOGE("Send local foreground userids failed, ret: %{public}d", ret); return ERR_DM_FAILED; } - LOGI("Send local foreground userids success"); + LOGI("success"); return DM_OK; } @@ -136,7 +136,7 @@ void DMCommTool::RspLocalFrontOrBackUserIds(const std::string rmtNetworkId, LOGE("Response local foreground userids failed, ret: %{public}d", ret); return; } - LOGI("Response local foreground userids success"); + LOGI("success"); } DMCommTool::DMCommToolEventHandler::DMCommToolEventHandler(const std::shared_ptr runner, @@ -212,7 +212,7 @@ void DMCommTool::DMCommToolEventHandler::ProcessEvent(const AppExecFwk::InnerEve void DMCommTool::ProcessReceiveCommonEvent(const std::shared_ptr commMsg) { - LOGI("ProcessReceiveCommonEvent, process and rsp local userid"); + LOGI("start"); std::string rmtUdid = ""; SoftbusCache::GetInstance().GetUdidFromCache(commMsg->remoteNetworkId.c_str(), rmtUdid); if (rmtUdid.empty()) { @@ -255,7 +255,7 @@ void DMCommTool::ProcessReceiveCommonEvent(const std::shared_ptr c void DMCommTool::ProcessResponseCommonEvent(const std::shared_ptr commMsg) { - LOGI("process receive remote userids response"); + LOGI("start"); // step1: close socket this->dmTransportPtr_->StopSocket(commMsg->remoteNetworkId); @@ -281,7 +281,7 @@ void DMCommTool::ProcessResponseCommonEvent(const std::shared_ptr void DMCommTool::ProcessReceiveUserIdsEvent(const std::shared_ptr commMsg) { - LOGI("Receive remote userids, process and rsp local userid"); + LOGI("start"); std::string rmtUdid = ""; SoftbusCache::GetInstance().GetUdidFromCache(commMsg->remoteNetworkId.c_str(), rmtUdid); if (rmtUdid.empty()) { @@ -331,7 +331,7 @@ void DMCommTool::ProcessReceiveUserIdsEvent(const std::shared_ptr void DMCommTool::ProcessResponseUserIdsEvent(const std::shared_ptr commMsg) { - LOGI("process receive remote userids response"); + LOGI("start"); // step1: close socket this->dmTransportPtr_->StopSocket(commMsg->remoteNetworkId); @@ -551,7 +551,7 @@ int32_t DMCommTool::SendLogoutAccountInfo(const std::string &rmtNetworkId, LOGE("Send account logout failed, ret: %{public}d", ret); return ERR_DM_FAILED; } - LOGI("Send account logout success"); + LOGI("success"); return DM_OK; } @@ -584,7 +584,7 @@ void DMCommTool::ProcessReceiveLogoutEvent(const std::shared_ptr c } DeviceManagerService::GetInstance().ProcessSyncAccountLogout(logoutAccountMsg.accountId, rmtUdid, logoutAccountMsg.userId); - LOGI("process remote logout success."); + LOGI("success."); } int32_t DMCommTool::StartCommonEvent(std::string commonEventType, EventCallback eventCallback) @@ -594,7 +594,7 @@ int32_t DMCommTool::StartCommonEvent(std::string commonEventType, EventCallback return ERR_DM_INPUT_PARA_INVALID; } CHECK_NULL_RETURN(eventQueue_, ERR_DM_POINT_NULL); - LOGI("StartCommonEvent start eventType: %{public}s", commonEventType.c_str()); + LOGI("start eventType: %{public}s", commonEventType.c_str()); std::lock_guard locker(eventMutex_); auto taskFunc = [eventCallback] () { eventCallback(); }; eventQueue_->submit(taskFunc); diff --git a/services/service/src/softbus/softbus_listener.cpp b/services/service/src/softbus/softbus_listener.cpp index 9f6167b00..d604a642f 100644 --- a/services/service/src/softbus/softbus_listener.cpp +++ b/services/service/src/softbus/softbus_listener.cpp @@ -232,12 +232,11 @@ void SoftbusListener::OnCredentialAuthStatus(const char *deviceList, uint32_t de void SoftbusListener::OnDeviceScreenStatusChanged(NodeStatusType type, NodeStatus *status) { - LOGI("received device screen status change callback from softbus."); if (status == nullptr) { LOGE("[SOFTBUS]status is nullptr, type = %{public}d", static_cast(type)); return; } - LOGI("screenStatusChanged networkId: %{public}s, screenStatus: %{public}d", + LOGI("networkId: %{public}s, screenStatus: %{public}d", GetAnonyString(status->basicInfo.networkId).c_str(), static_cast(status->reserved[0])); if (type != NodeStatusType::TYPE_SCREEN_STATUS) { LOGE("type is not matching."); @@ -363,7 +362,7 @@ void SoftbusListener::UpdateDeviceName(NodeBasicInfo *info) LOGE("GetUdidByNetworkId failed, not update device name"); return; } - LOGI("UpdateDeviceName, info->deviceName: %{public}s.", GetAnonyString(info->deviceName).c_str()); + LOGI("info->deviceName: %{public}s.", GetAnonyString(info->deviceName).c_str()); DeviceProfileConnector::GetInstance().UpdateAclDeviceName(udid, info->deviceName); #endif } @@ -376,7 +375,6 @@ void SoftbusListener::OnSoftbusDeviceInfoChanged(NodeBasicInfoType type, NodeBas return; } if (type == NodeBasicInfoType::TYPE_DEVICE_NAME || type == NodeBasicInfoType::TYPE_NETWORK_INFO) { - LOGI("DeviceInfo %{public}d change.", type); DmDeviceInfo dmDeviceInfo; int32_t networkType = -1; if (type == NodeBasicInfoType::TYPE_NETWORK_INFO) { @@ -385,7 +383,7 @@ void SoftbusListener::OnSoftbusDeviceInfoChanged(NodeBasicInfoType type, NodeBas LOGE("[SOFTBUS]GetNodeKeyInfo networkType failed."); return; } - LOGI("OnSoftbusDeviceInfoChanged NetworkType %{public}d.", networkType); + LOGI("NetworkType %{public}d.", networkType); } if (type == NodeBasicInfoType::TYPE_DEVICE_NAME) { UpdateDeviceName(info); @@ -408,7 +406,7 @@ void SoftbusListener::OnSoftbusDeviceInfoChanged(NodeBasicInfoType type, NodeBas void SoftbusListener::OnLocalDevInfoChange() { - LOGI("SoftbusListener::OnLocalDevInfoChange"); + LOGI("start"); SoftbusCache::GetInstance().UpDataLocalDevInfo(); #if !(defined(__LITEOS_M__) || defined(LITE_DEVICE)) NodeBasicInfo nodeBasicInfo; @@ -429,7 +427,7 @@ void SoftbusListener::OnLocalDevInfoChange() void SoftbusListener::OnDeviceTrustedChange(TrustChangeType type, const char *msg, uint32_t msgLen) { - LOGI("OnDeviceTrustedChange."); + LOGI("start."); if (msg == nullptr || msgLen > MAX_SOFTBUS_MSG_LEN || strlen(msg) != msgLen) { LOGE("OnDeviceTrustedChange msg invalied."); return; @@ -527,7 +525,7 @@ void SoftbusListener::OnSoftbusDiscoveryResult(int subscribeId, RefreshResult re void SoftbusListener::OnSoftbusPublishResult(int publishId, PublishResult result) { - LOGD("OnSoftbusPublishResult, publishId: %{public}d, result: %{public}d.", publishId, result); + LOGD("publishId: %{public}d, result: %{public}d.", publishId, result); } SoftbusListener::SoftbusListener() @@ -598,7 +596,7 @@ int32_t SoftbusListener::InitSoftPublishLNN() publishInfo.freq = ExchangeFreq::LOW; publishInfo.capability = DM_CAPABILITY_OSD; publishInfo.ranging = false; - LOGI("InitSoftPublishLNN begin, publishId: %{public}d, mode: 0x%{public}x, medium: %{public}d, capability:" + LOGI("begin, publishId: %{public}d, mode: 0x%{public}x, medium: %{public}d, capability:" "%{public}s, ranging: %{public}d, freq: %{public}d.", publishInfo.publishId, publishInfo.mode, publishInfo.medium, publishInfo.capability, publishInfo.ranging, publishInfo.freq); @@ -613,7 +611,7 @@ int32_t SoftbusListener::InitSoftPublishLNN() int32_t SoftbusListener::RefreshSoftbusLNN(const char *pkgName, const DmSubscribeInfo &dmSubInfo, const std::string &customData) { - LOGI("RefreshSoftbusLNN begin, subscribeId: %{public}d.", dmSubInfo.subscribeId); + LOGI("begin, subscribeId: %{public}d.", dmSubInfo.subscribeId); SubscribeInfo subscribeInfo; if (memset_s(&subscribeInfo, sizeof(SubscribeInfo), 0, sizeof(SubscribeInfo)) != DM_OK) { LOGE("RefreshSoftbusLNN memset_s failed."); @@ -630,7 +628,7 @@ int32_t SoftbusListener::RefreshSoftbusLNN(const char *pkgName, const DmSubscrib subscribeInfo.capabilityData = const_cast(reinterpret_cast(customData.c_str())); subscribeInfo.dataLen = customData.size(); - LOGI("RefreshSoftbusLNN begin, subscribeId: %{public}d, mode: 0x%{public}x, medium: %{public}d, capability:" + LOGI("subscribeId: %{public}d, mode: 0x%{public}x, medium: %{public}d, capability:" "%{public}s, freq: %{public}d.", subscribeInfo.subscribeId, subscribeInfo.mode, subscribeInfo.medium, subscribeInfo.capability, subscribeInfo.freq); int32_t ret = ::RefreshLNN(pkgName, &subscribeInfo, &softbusRefreshCallback_); @@ -659,7 +657,7 @@ int32_t SoftbusListener::RefreshSoftbusLNN(const char *pkgName, const DmSubscrib int32_t SoftbusListener::StopRefreshSoftbusLNN(uint16_t subscribeId) { - LOGI("StopRefreshSoftbusLNN begin, subscribeId: %{public}d.", (int32_t)subscribeId); + LOGI("begin, subscribeId: %{public}d.", (int32_t)subscribeId); { std::lock_guard lock(g_lockDeviceIdSet); deviceIdSet.clear(); @@ -751,7 +749,7 @@ int32_t SoftbusListener::GetTrustedDeviceList(std::vector &deviceI { int32_t ret = SoftbusCache::GetInstance().GetDeviceInfoFromCache(deviceInfoList); size_t deviceCount = deviceInfoList.size(); - LOGI("Success from cache deviceInfoList size is %{public}zu.", deviceCount); + LOGI("size is %{public}zu.", deviceCount); return ret; } @@ -989,7 +987,7 @@ int32_t SoftbusListener::GetNetworkTypeByNetworkId(const char *networkId, int32_ return ret; } networkType = tempNetworkType; - LOGI("GetNetworkTypeByNetworkId networkType %{public}d.", tempNetworkType); + LOGI("networkType %{public}d.", tempNetworkType); return DM_OK; } @@ -1098,7 +1096,6 @@ bool SoftbusListener::IsDmRadarHelperReady() bool SoftbusListener::CloseDmRadarHelperObj(std::string name) { (void)name; - LOGI("SoftbusListener::CloseDmRadarHelperObj start."); std::lock_guard lock(g_radarLoadLock); if (!isRadarSoLoad_ && (dmRadarHelper_ == nullptr) && (radarHandle_ == nullptr)) { return true; @@ -1112,7 +1109,7 @@ bool SoftbusListener::CloseDmRadarHelperObj(std::string name) isRadarSoLoad_ = false; dmRadarHelper_ = nullptr; radarHandle_ = nullptr; - LOGI("close libdevicemanagerradar so success."); + LOGI("success."); return true; } @@ -1195,7 +1192,7 @@ std::string SoftbusListener::GetHostPkgName() void SoftbusListener::SendAclChangedBroadcast(const std::string &msg) { - LOGI("SendAclChangedBroadcast"); + LOGI("start"); if (SyncTrustedRelationShip(DM_PKG_NAME, msg.c_str(), msg.length()) != DM_OK) { LOGE("SyncTrustedRelationShip failed."); } @@ -1216,7 +1213,7 @@ int32_t SoftbusListener::GetDeviceScreenStatus(const char *networkId, int32_t &s return ret; } screenStatus = devScreenStatus; - LOGI("GetDeviceScreenStatus screenStatus: %{public}d.", devScreenStatus); + LOGI("screenStatus: %{public}d.", devScreenStatus); return DM_OK; } @@ -1226,7 +1223,6 @@ int32_t SoftbusListener::SetForegroundUserIdsToDSoftBus(const std::string &remot #if !(defined(__LITEOS_M__) || defined(LITE_DEVICE)) NotifyUserIds notifyUserIds(remoteUdid, userIds); std::string msg = notifyUserIds.ToString(); - LOGI("Notify remote userid to dsoftbus, msg: %{public}s", GetAnonyString(msg).c_str()); return DM_OK; #else (void)remoteUdid; @@ -1237,7 +1233,7 @@ int32_t SoftbusListener::SetForegroundUserIdsToDSoftBus(const std::string &remot void SoftbusListener::DeleteCacheDeviceInfo() { - LOGI("DeleteCacheDeviceInfo start."); + LOGI("start."); std::vector onlineDevInfoVec; SoftbusCache::GetInstance().GetDeviceInfoFromCache(onlineDevInfoVec); if (onlineDevInfoVec.empty()) { @@ -1253,7 +1249,7 @@ void SoftbusListener::DeleteCacheDeviceInfo() int32_t SoftbusListener::SetLocalDisplayName(const std::string &displayName) { - LOGI("SoftbusListener Start SetLocalDisplayName!"); + LOGI("start"); uint32_t len = static_cast(displayName.size()); int32_t ret = ::SetDisplayName(DM_PKG_NAME, displayName.c_str(), len); if (ret != DM_OK) { diff --git a/services/service/src/softbus/softbus_publish.cpp b/services/service/src/softbus/softbus_publish.cpp index 94a605c14..c6ccd4425 100644 --- a/services/service/src/softbus/softbus_publish.cpp +++ b/services/service/src/softbus/softbus_publish.cpp @@ -40,7 +40,7 @@ std::mutex g_publishMutex; void PublishCommonEventCallback(int32_t bluetoothState, int32_t wifiState, int32_t screenState) { - LOGI("PublishCommonEventCallback start, bleState: %{public}d, wifiState: %{public}d, screenState: %{public}d", + LOGI("start, bleState: %{public}d, wifiState: %{public}d, screenState: %{public}d", bluetoothState, wifiState, screenState); std::lock_guard saLock(g_publishMutex); DmDeviceInfo info; @@ -49,7 +49,6 @@ void PublishCommonEventCallback(int32_t bluetoothState, int32_t wifiState, int32 LOGE("deviceType: %{public}d is watch, not publish", static_cast(info.deviceTypeId)); return; } - LOGI("deviceType: %{public}d", static_cast(info.deviceTypeId)); SoftbusPublish softbusPublish; if (screenState == DM_SCREEN_OFF) { int32_t ret = softbusPublish.StopPublishSoftbusLNN(DISTRIBUTED_HARDWARE_DEVICEMANAGER_SA_ID); @@ -101,7 +100,7 @@ SoftbusPublish::~SoftbusPublish() void SoftbusPublish::OnSoftbusPublishResult(int publishId, PublishResult result) { - LOGD("OnSoftbusPublishResult, publishId: %{public}d, result: %{public}d.", publishId, result); + LOGD("publishId: %{public}d, result: %{public}d.", publishId, result); } int32_t SoftbusPublish::PublishSoftbusLNN() @@ -114,10 +113,7 @@ int32_t SoftbusPublish::PublishSoftbusLNN() publishInfo.capability = DM_CAPABILITY_OSD; publishInfo.ranging = false; - LOGI("Begin, publishId: %{public}d, mode: 0x%{public}x, medium: %{public}d, capability:" - "%{public}s, ranging: %{public}d, freq: %{public}d.", publishInfo.publishId, publishInfo.mode, - publishInfo.medium, publishInfo.capability, publishInfo.ranging, publishInfo.freq); - + LOGI("Begin"); int32_t ret = PublishLNN(DM_PKG_NAME, &publishInfo, &softbusPublishCallback_); if (ret != DM_OK) { LOGE("[SOFTBUS]PublishLNN failed, ret: %{public}d.", ret); diff --git a/services/softbuscache/src/dm_softbus_cache.cpp b/services/softbuscache/src/dm_softbus_cache.cpp index 273f05d77..1c285bcd9 100644 --- a/services/softbuscache/src/dm_softbus_cache.cpp +++ b/services/softbuscache/src/dm_softbus_cache.cpp @@ -29,7 +29,7 @@ DmDeviceInfo localDeviceInfo_; std::mutex localDevInfoMutex_; void SoftbusCache::SaveLocalDeviceInfo() { - LOGI("SoftbusCache::SaveLocalDeviceInfo"); + LOGI("start"); std::lock_guard mutexLock(localDevInfoMutex_); if (g_online) { return; @@ -41,8 +41,7 @@ void SoftbusCache::SaveLocalDeviceInfo() return; } ConvertNodeBasicInfoToDmDevice(nodeBasicInfo, localDeviceInfo_); - LOGI("SoftbusCache::SaveLocalDeviceInfo networkid %{public}s.", - GetAnonyString(std::string(localDeviceInfo_.networkId)).c_str()); + LOGI("networkid %{public}s.", GetAnonyString(std::string(localDeviceInfo_.networkId)).c_str()); SaveDeviceInfo(localDeviceInfo_); SaveDeviceSecurityLevel(localDeviceInfo_.networkId); g_online = true; @@ -51,8 +50,7 @@ void SoftbusCache::SaveLocalDeviceInfo() void SoftbusCache::DeleteLocalDeviceInfo() { - LOGI("SoftbusCache::DeleteLocalDeviceInfo networkid %{public}s.", - GetAnonyString(std::string(localDeviceInfo_.networkId)).c_str()); + LOGI("networkid %{public}s.", GetAnonyString(std::string(localDeviceInfo_.networkId)).c_str()); std::lock_guard mutexLock(localDevInfoMutex_); g_online = false; g_getLocalDevInfo = false; @@ -63,7 +61,7 @@ int32_t SoftbusCache::GetLocalDeviceInfo(DmDeviceInfo &nodeInfo) std::lock_guard mutexLock(localDevInfoMutex_); if (g_getLocalDevInfo) { nodeInfo = localDeviceInfo_; - LOGD("SoftbusCache::GetLocalDeviceInfo from dm cache."); + LOGD("dm cache success."); return DM_OK; } NodeBasicInfo nodeBasicInfo; @@ -77,13 +75,13 @@ int32_t SoftbusCache::GetLocalDeviceInfo(DmDeviceInfo &nodeInfo) SaveDeviceInfo(localDeviceInfo_); SaveDeviceSecurityLevel(localDeviceInfo_.networkId); g_getLocalDevInfo = true; - LOGI("SoftbusCache::GetLocalDeviceInfo from softbus."); + LOGI("from softbus success."); return DM_OK; } void SoftbusCache::UpDataLocalDevInfo() { - LOGI("SoftbusCache::UpDataLocalDevInfo"); + LOGI("start"); NodeBasicInfo nodeBasicInfo; int32_t ret = GetLocalNodeDeviceInfo(DM_PKG_NAME, &nodeBasicInfo); if (ret != DM_OK) { @@ -121,7 +119,7 @@ int32_t SoftbusCache::GetUuidByNetworkId(const char *networkId, std::string &uui void SoftbusCache::SaveDeviceInfo(DmDeviceInfo deviceInfo) { - LOGI("SoftbusCache::SaveDeviceInfo"); + LOGI("start"); std::string udid = ""; std::string uuid = ""; if (deviceInfo.networkId[0] == '\0') { @@ -146,18 +144,17 @@ void SoftbusCache::SaveDeviceInfo(DmDeviceInfo deviceInfo) } std::lock_guard mutexLock(deviceInfosMutex_); deviceInfo_[udid] = std::pair(uuid, deviceInfo); - LOGI("SaveDeviceInfo success udid %{public}s, networkId %{public}s", + LOGI("success udid %{public}s, networkId %{public}s", GetAnonyString(udid).c_str(), GetAnonyString(std::string(deviceInfo.networkId)).c_str()); } void SoftbusCache::DeleteDeviceInfo(const DmDeviceInfo &nodeInfo) { - LOGI("SoftbusCache::DeleteDeviceInfo networkId %{public}s", - GetAnonyString(std::string(nodeInfo.networkId)).c_str()); + LOGI("networkId %{public}s", GetAnonyString(std::string(nodeInfo.networkId)).c_str()); std::lock_guard mutexLock(deviceInfosMutex_); for (const auto &item : deviceInfo_) { if (std::string(item.second.second.networkId) == std::string(nodeInfo.networkId)) { - LOGI("DeleteDeviceInfo success udid %{public}s", GetAnonyString(item.first).c_str()); + LOGI("success udid %{public}s", GetAnonyString(item.first).c_str()); deviceInfo_.erase(item.first); break; } @@ -172,7 +169,7 @@ void SoftbusCache::DeleteDeviceInfo() void SoftbusCache::ChangeDeviceInfo(const DmDeviceInfo deviceInfo) { - LOGI("SoftbusCache::ChangeDeviceInfo"); + LOGI("start"); std::string udid = ""; GetUdidByNetworkId(deviceInfo.networkId, udid); std::lock_guard mutexLock(deviceInfosMutex_); @@ -192,7 +189,7 @@ void SoftbusCache::ChangeDeviceInfo(const DmDeviceInfo deviceInfo) GetUuidByNetworkId(deviceInfo.networkId, uuid); deviceInfo_[udid].first = uuid; } - LOGI("ChangeDeviceInfo sucess udid %{public}s, networkId %{public}s.", + LOGI("sucess udid %{public}s, networkId %{public}s.", GetAnonyString(udid).c_str(), GetAnonyString(std::string(deviceInfo.networkId)).c_str()); } @@ -210,7 +207,7 @@ int32_t SoftbusCache::GetDeviceInfoFromCache(std::vector &deviceIn void SoftbusCache::UpdateDeviceInfoCache() { - LOGI("SoftbusCache::UpdateDeviceInfoCache"); + LOGI("start"); int32_t deviceCount = 0; NodeBasicInfo *nodeInfo = nullptr; int32_t ret = GetAllNodeDeviceInfo(DM_PKG_NAME, &nodeInfo, &deviceCount); @@ -226,7 +223,7 @@ void SoftbusCache::UpdateDeviceInfoCache() SaveDeviceInfo(deviceInfo); } FreeNodeInfo(nodeInfo); - LOGI("UpdateDeviceInfoCache success, deviceCount: %{public}d.", deviceCount); + LOGI("success, deviceCount: %{public}d.", deviceCount); return; } @@ -299,7 +296,7 @@ int32_t SoftbusCache::ConvertNodeBasicInfoToDmDevice(const NodeBasicInfo &nodeIn void SoftbusCache::SaveDeviceSecurityLevel(const char *networkId) { - LOGI("SoftbusCache::SaveDeviceSecurityLevel networkId %{public}s.", GetAnonyString(std::string(networkId)).c_str()); + LOGI("networkId %{public}s.", GetAnonyString(std::string(networkId)).c_str()); std::lock_guard mutexLock(deviceSecurityLevelMutex_); if (deviceSecurityLevel_.find(std::string(networkId)) != deviceSecurityLevel_.end()) { return; @@ -315,8 +312,7 @@ void SoftbusCache::SaveDeviceSecurityLevel(const char *networkId) void SoftbusCache::DeleteDeviceSecurityLevel(const char *networkId) { - LOGI("SoftbusCache::DeleteDeviceSecurityLevel networkId %{public}s.", - GetAnonyString(std::string(networkId)).c_str()); + LOGI("networkId %{public}s.", GetAnonyString(std::string(networkId)).c_str()); std::lock_guard mutexLock(deviceSecurityLevelMutex_); if (deviceSecurityLevel_.find(std::string(networkId)) != deviceSecurityLevel_.end()) { deviceSecurityLevel_.erase(std::string(networkId)); @@ -364,7 +360,7 @@ int32_t SoftbusCache::GetDevInfoByNetworkId(const std::string &networkId, DmDevi for (const auto &item : deviceInfo_) { if (std::string(item.second.second.networkId) == networkId) { nodeInfo = item.second.second; - LOGI("GetDevInfoByNetworkId success networkId %{public}s, udid %{public}s.", + LOGI("success networkId %{public}s, udid %{public}s.", GetAnonyString(networkId).c_str(), GetAnonyString(item.first).c_str()); return DM_OK; } @@ -403,23 +399,22 @@ int32_t SoftbusCache::GetDevInfoFromBus(const std::string &networkId, DmDeviceIn int32_t SoftbusCache::GetUdidByUdidHash(const std::string &udidHash, std::string &udid) { - LOGI("udidHash %{public}s.", GetAnonyString(udidHash).c_str()); { std::lock_guard mutexLock(deviceInfosMutex_); for (const auto &item : deviceInfo_) { if (std::string(item.second.second.deviceId) == udidHash) { udid = item.first; - LOGI("GetUdidByUdidHash success udid %{public}s.", GetAnonyString(udid).c_str()); + LOGI("success udid %{public}s.", GetAnonyString(udid).c_str()); return DM_OK; } } } + LOGI("failed udidHash %{public}s.", GetAnonyString(udidHash).c_str()); return ERR_DM_FAILED; } int32_t SoftbusCache::GetUuidByUdid(const std::string &udid, std::string &uuid) { - LOGI("udid %{public}s.", GetAnonyString(udid).c_str()); { std::lock_guard mutexLock(deviceInfosMutex_); if (deviceInfo_.find(udid) != deviceInfo_.end()) { @@ -428,36 +423,37 @@ int32_t SoftbusCache::GetUuidByUdid(const std::string &udid, std::string &uuid) return DM_OK; } } + LOGI("failed udid %{public}s.", GetAnonyString(udid).c_str()); return ERR_DM_FAILED; } int32_t SoftbusCache::GetNetworkIdFromCache(const std::string &udid, std::string &networkId) { - LOGI("udid %{public}s.", GetAnonyString(udid).c_str()); { std::lock_guard mutexLock(deviceInfosMutex_); if (deviceInfo_.find(udid) != deviceInfo_.end()) { networkId = deviceInfo_[udid].second.networkId; - LOGI("GetNetworkIdFromCache success networkId %{public}s, udid %{public}s.", + LOGI("success networkId %{public}s, udid %{public}s.", GetAnonyString(networkId).c_str(), GetAnonyString(udid).c_str()); return DM_OK; } } + LOGI("failed udid %{public}s.", GetAnonyString(udid).c_str()); return ERR_DM_FAILED; } int32_t SoftbusCache::GetDeviceNameFromCache(const std::string &udid, std::string &deviceName) { - LOGI("udid %{public}s.", GetAnonyString(udid).c_str()); { std::lock_guard mutexLock(deviceInfosMutex_); if (deviceInfo_.find(udid) != deviceInfo_.end()) { deviceName = deviceInfo_[udid].second.deviceName; - LOGI("GetDeviceNameFromCache success deviceName: %{public}s, udid: %{public}s.", + LOGI("success deviceName: %{public}s, udid: %{public}s.", deviceName.c_str(), GetAnonyString(udid).c_str()); return DM_OK; } } + LOGI("failed udid %{public}s.", GetAnonyString(udid).c_str()); return ERR_DM_FAILED; } diff --git a/utils/src/appInfo/standard/app_manager.cpp b/utils/src/appInfo/standard/app_manager.cpp index 25a734ce0..cb9c967a4 100644 --- a/utils/src/appInfo/standard/app_manager.cpp +++ b/utils/src/appInfo/standard/app_manager.cpp @@ -78,7 +78,7 @@ DM_EXPORT void AppManager::RegisterCallerAppId(const std::string &pkgName) } std::string appId = GetAppId(); if (appId.empty()) { - LOGE("PkgName %{public}s get appid failed.", pkgName.c_str()); + LOGD("PkgName %{public}s get appid failed.", pkgName.c_str()); return; } LOGI("PkgName %{public}s, appId %{public}s.", pkgName.c_str(), GetAnonyString(appId).c_str()); @@ -222,7 +222,6 @@ DM_EXPORT int32_t AppManager::GetCallerProcessName(std::string &processName) LOGE("GetCallerProcessName GetCallingTokenID error."); return ERR_DM_FAILED; } - LOGI("GetCallerProcessName::tokenCaller ID == %{public}s", GetAnonyInt32(tokenCaller).c_str()); ATokenTypeEnum tokenTypeFlag = AccessTokenKit::GetTokenTypeFlag(tokenCaller); if (tokenTypeFlag == ATokenTypeEnum::TOKEN_HAP) { HapTokenInfo tokenInfo; diff --git a/utils/src/fwkload/standard/dm_distributed_hardware_load.cpp b/utils/src/fwkload/standard/dm_distributed_hardware_load.cpp index a3465cbba..43c1dd014 100644 --- a/utils/src/fwkload/standard/dm_distributed_hardware_load.cpp +++ b/utils/src/fwkload/standard/dm_distributed_hardware_load.cpp @@ -27,7 +27,7 @@ constexpr uint32_t MAX_LOAD_VALUE = 3; constexpr int32_t DM_OK = 0; DM_EXPORT void DmDistributedHardwareLoad::LoadDistributedHardwareFwk(void) { - LOGI("enter DmDistributedHardwareLoad::LoadDistributedHardwareFwk"); + LOGI("start"); sptr samgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); if (samgr == nullptr) { LOGE("failed to get system ability mgr."); @@ -54,7 +54,7 @@ uint32_t DmDistributedHardwareLoad::GetDistributedHardwareLoadCount() void DistributedHardwareLoadCallback::OnLoadSystemAbilitySuccess( int32_t systemAbilityId, const sptr &remoteObject) { - LOGI("DmDistributedHardware Load SA success, systemAbilityId:%{public}d, remoteObject result:%{public}s", + LOGI("Load SA success, systemAbilityId:%{public}d, remoteObject result:%{public}s", systemAbilityId, (remoteObject != nullptr) ? "true" : "false"); if (remoteObject == nullptr) { LOGE("remoteObject is nullptr"); @@ -64,7 +64,7 @@ void DistributedHardwareLoadCallback::OnLoadSystemAbilitySuccess( } void DistributedHardwareLoadCallback::OnLoadSystemAbilityFail(int32_t systemAbilityId) { - LOGE("DmDistributedHardware Load SA failed, systemAbilityId:%{public}d", systemAbilityId); + LOGE("Load SA failed, systemAbilityId:%{public}d", systemAbilityId); if (DmDistributedHardwareLoad::GetInstance().GetDistributedHardwareLoadCount() < MAX_LOAD_VALUE) { DmDistributedHardwareLoad::GetInstance().LoadDistributedHardwareFwk(); diff --git a/utils/src/timer/dm_timer.cpp b/utils/src/timer/dm_timer.cpp index a41c1fdd1..27d1a2777 100644 --- a/utils/src/timer/dm_timer.cpp +++ b/utils/src/timer/dm_timer.cpp @@ -49,7 +49,7 @@ int32_t DmTimer::StartTimer(std::string name, int32_t timeOut, TimerCallback cal return ERR_DM_INPUT_PARA_INVALID; } CHECK_NULL_RETURN(queue_, ERR_DM_POINT_NULL); - LOGI("DmTimer StartTimer start name: %{public}s", name.c_str()); + LOGI("start name: %{public}s", name.c_str()); std::lock_guard locker(timerMutex_); auto taskFunc = [callback, name] () { callback(name); }; @@ -68,7 +68,7 @@ int32_t DmTimer::DeleteTimer(std::string timerName) LOGE("DmTimer DeleteTimer timer is null"); return ERR_DM_INPUT_PARA_INVALID; } - LOGI("DmTimer DeleteTimer start name: %{public}s", timerName.c_str()); + LOGI("start name: %{public}s", timerName.c_str()); std::lock_guard locker(timerMutex_); auto item = timerVec_.find(timerName); if (item == timerVec_.end()) { @@ -87,7 +87,7 @@ int32_t DmTimer::DeleteTimer(std::string timerName) DM_EXPORT int32_t DmTimer::DeleteAll() { - LOGI("DmTimer DeleteAll start"); + LOGI("start"); std::lock_guard locker(timerMutex_); for (const auto &name : timerVec_) { if (name.second != nullptr && queue_ != nullptr) { -- Gitee