From 3ee37db67e410a7082ebbf9de295e33dc4e930bd Mon Sep 17 00:00:00 2001 From: wangzhaohao Date: Thu, 25 Jul 2024 12:12:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A3=80=E8=A7=86=E6=84=8F?= =?UTF-8?q?=E8=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangzhaohao --- .../interfaces/dp_inited_callback_stub.h | 6 ++--- .../src/distributed_device_profile_client.cpp | 22 +++++++++---------- .../src/distributed_device_profile_stub.cpp | 4 ---- .../distributed_device_profile_stub_new.cpp | 4 ---- 4 files changed, 14 insertions(+), 22 deletions(-) diff --git a/common/include/interfaces/dp_inited_callback_stub.h b/common/include/interfaces/dp_inited_callback_stub.h index f2001697..4ac4e049 100644 --- a/common/include/interfaces/dp_inited_callback_stub.h +++ b/common/include/interfaces/dp_inited_callback_stub.h @@ -31,11 +31,11 @@ public: DpInitedCallbackStub(); ~DpInitedCallbackStub(); - virtual int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, - MessageOption &option) override; + virtual int32_t OnRemoteRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, + MessageOption& option) override; private: - int32_t OnDpInitedInner(MessageParcel &data, MessageParcel &reply); + int32_t OnDpInitedInner(MessageParcel& data, MessageParcel& reply); }; } // namespace DistributedDeviceProfile } // namespace OHOS diff --git a/interfaces/innerkits/core/src/distributed_device_profile_client.cpp b/interfaces/innerkits/core/src/distributed_device_profile_client.cpp index bbbc43bd..1a8d7bd4 100644 --- a/interfaces/innerkits/core/src/distributed_device_profile_client.cpp +++ b/interfaces/innerkits/core/src/distributed_device_profile_client.cpp @@ -307,7 +307,7 @@ int32_t DistributedDeviceProfileClient::DeleteCharacteristicProfile(const std::s return dpService->DeleteCharacteristicProfile(deviceId, serviceName, characteristicKey); } - int32_t DistributedDeviceProfileClient::SubscribeDeviceProfile(const SubscribeInfo& subscribeInfo) +int32_t DistributedDeviceProfileClient::SubscribeDeviceProfile(const SubscribeInfo& subscribeInfo) { SubscribeDeviceProfileSA(); auto dpService = GetDeviceProfileService(); @@ -493,13 +493,13 @@ int32_t DistributedDeviceProfileClient::SubscribeDeviceProfileInited(int32_t saI HILOGE("SyncCb ipc cast fail!"); return DP_SUBSCRIBE_INITED_FALI; } - int32_t ret = dpService->SubscribeDeviceProfileInited(saId, dpInitedCallback); - if (ret != DP_SUCCESS) { - HILOGE("Subscribe DP Inited failed!"); - return ret; - } { std::lock_guard lock(serviceLock_); + int32_t ret = dpService->SubscribeDeviceProfileInited(saId, dpInitedCallback); + if (ret != DP_SUCCESS) { + HILOGE("Subscribe DP Inited failed!"); + return ret; + } saId_ = saId; dpInitedCallback_ = initedCb; } @@ -524,13 +524,13 @@ int32_t DistributedDeviceProfileClient::UnSubscribeDeviceProfileInited(int32_t s HILOGE("saId is invalid, saId:%{public}d", saId); return DP_INVALID_PARAM; } - int32_t ret = dpService->UnSubscribeDeviceProfileInited(saId); - if (ret != DP_SUCCESS) { - HILOGE("Unsubscribe DP Inited failed!"); - return ret; - } { std::lock_guard lock(serviceLock_); + int32_t ret = dpService->UnSubscribeDeviceProfileInited(saId); + if (ret != DP_SUCCESS) { + HILOGE("Unsubscribe DP Inited failed!"); + return ret; + } dpInitedCallback_ = nullptr; } HILOGI("Unsubscribe DP Inited succeed!"); diff --git a/old/services/core/src/distributed_device_profile_stub.cpp b/old/services/core/src/distributed_device_profile_stub.cpp index ba6dfcb0..8a79ecd1 100644 --- a/old/services/core/src/distributed_device_profile_stub.cpp +++ b/old/services/core/src/distributed_device_profile_stub.cpp @@ -96,10 +96,6 @@ void DistributedDeviceProfileStub::InitNewIpcInterface() &DistributedDeviceProfileStub::SendSubscribeInfosInner; funcsMap_[static_cast(DPInterfaceCode::SYNC_DEVICE_PROFILE_NEW)] = &DistributedDeviceProfileStub::SyncDeviceProfileNewInner; - funcsMap_[static_cast(DPInterfaceCode::SUBSCRIBE_DEVICE_PROFILE_INITED)] = - &DistributedDeviceProfileStub::SubscribeDeviceProfileInitedInner; - funcsMap_[static_cast(DPInterfaceCode::UNSUBSCRIBE_DEVICE_PROFILE_INITED)] = - &DistributedDeviceProfileStub::UnSubscribeDeviceProfileInitedInner; InitAclAndSubscribe(); } diff --git a/services/core/src/distributed_device_profile_stub_new.cpp b/services/core/src/distributed_device_profile_stub_new.cpp index a7064248..c2be32e6 100644 --- a/services/core/src/distributed_device_profile_stub_new.cpp +++ b/services/core/src/distributed_device_profile_stub_new.cpp @@ -73,10 +73,6 @@ DistributedDeviceProfileStubNew::DistributedDeviceProfileStubNew() &DistributedDeviceProfileStubNew::SyncDeviceProfileInner; funcsMap_[static_cast(DPInterfaceCode::SEND_SUBSCRIBE_INFOS)] = &DistributedDeviceProfileStubNew::SendSubscribeInfosInner; - funcsMap_[static_cast(DPInterfaceCode::SUBSCRIBE_DEVICE_PROFILE_INITED)] = - &DistributedDeviceProfileStubNew::SubscribeDeviceProfileInitedInner; - funcsMap_[static_cast(DPInterfaceCode::UNSUBSCRIBE_DEVICE_PROFILE_INITED)] = - &DistributedDeviceProfileStubNew::UnSubscribeDeviceProfileInitedInner; InitAclAndSubscribe(); }