修改检视意见

Signed-off-by: wangzhaohao <wangzhaohao@huawei.com>
This commit is contained in:
wangzhaohao 2024-07-25 12:12:48 +08:00
parent 7a8a79bc49
commit 3ee37db67e
4 changed files with 14 additions and 22 deletions

View File

@ -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

View File

@ -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<std::mutex> 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<std::mutex> 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!");

View File

@ -96,10 +96,6 @@ void DistributedDeviceProfileStub::InitNewIpcInterface()
&DistributedDeviceProfileStub::SendSubscribeInfosInner;
funcsMap_[static_cast<uint32_t>(DPInterfaceCode::SYNC_DEVICE_PROFILE_NEW)] =
&DistributedDeviceProfileStub::SyncDeviceProfileNewInner;
funcsMap_[static_cast<uint32_t>(DPInterfaceCode::SUBSCRIBE_DEVICE_PROFILE_INITED)] =
&DistributedDeviceProfileStub::SubscribeDeviceProfileInitedInner;
funcsMap_[static_cast<uint32_t>(DPInterfaceCode::UNSUBSCRIBE_DEVICE_PROFILE_INITED)] =
&DistributedDeviceProfileStub::UnSubscribeDeviceProfileInitedInner;
InitAclAndSubscribe();
}

View File

@ -73,10 +73,6 @@ DistributedDeviceProfileStubNew::DistributedDeviceProfileStubNew()
&DistributedDeviceProfileStubNew::SyncDeviceProfileInner;
funcsMap_[static_cast<uint32_t>(DPInterfaceCode::SEND_SUBSCRIBE_INFOS)] =
&DistributedDeviceProfileStubNew::SendSubscribeInfosInner;
funcsMap_[static_cast<uint32_t>(DPInterfaceCode::SUBSCRIBE_DEVICE_PROFILE_INITED)] =
&DistributedDeviceProfileStubNew::SubscribeDeviceProfileInitedInner;
funcsMap_[static_cast<uint32_t>(DPInterfaceCode::UNSUBSCRIBE_DEVICE_PROFILE_INITED)] =
&DistributedDeviceProfileStubNew::UnSubscribeDeviceProfileInitedInner;
InitAclAndSubscribe();
}