diff --git a/common/include/interfaces/distributed_device_profile_enums.h b/common/include/interfaces/distributed_device_profile_enums.h index f482ecfba472b291b55d296a26f06d083f5827cd..3e7ebe208d7e18491b565fe76ac61f2442c0c5e2 100644 --- a/common/include/interfaces/distributed_device_profile_enums.h +++ b/common/include/interfaces/distributed_device_profile_enums.h @@ -21,81 +21,6 @@ namespace OHOS { namespace DistributedDeviceProfile { -enum class DPInterfaceCode : uint32_t { - MIN = 0, - PUT_ACL_PROFILE = 7, // new ipc code - UPDATE_ACL_PROFILE = 8, - GET_TRUST_DEVICE_PROFILE = 9, - GET_ALL_TRUST_DEVICE_PROFILE = 10, - GET_ACL_PROFILE = 11, - GET_ALL_ACL_PROFILE = 12, - DELETE_ACL_PROFILE = 13, - PUT_SERVICE_PROFILE = 14, - PUT_SERVICE_PROFILE_BATCH = 15, - PUT_CHAR_PROFILE = 16, - PUT_CHAR_PROFILE_BATCH = 17, - GET_DEVICE_PROFILE_NEW = 18, - GET_SERVICE_PROFILE = 19, - GET_CHAR_PROFILE = 20, - DEL_SERVICE_PROFILE = 21, - DEL_CHAR_PROFILE = 22, - SUBSCRIBE_DEVICE_PROFILE = 23, - UNSUBSCRIBE_DEVICE_PROFILE = 24, - SYNC_DEVICE_PROFILE_NEW = 25, - SEND_SUBSCRIBE_INFOS = 26, - ON_SYNC_COMPLETED = 27, - ON_TRUST_DEVICE_PROFILE_ADD = 28, - ON_TRUST_DEVICE_PROFILE_UPDATE = 29, - ON_TRUST_DEVICE_PROFILE_DELETE = 30, - ON_DEVICE_PROFILE_ADD = 31, - ON_DEVICE_PROFILE_UPDATE = 32, - ON_DEVICE_PROFILE_DELETE = 33, - ON_SERVICE_PROFILE_ADD = 34, - ON_SERVICE_PROFILE_UPDATE = 35, - ON_SERVICE_PROFILE_DELETE = 36, - ON_CHAR_PROFILE_ADD = 37, - ON_CHAR_PROFILE_UPDATE = 38, - ON_CHAR_PROFILE_DELETE = 39, - ON_DEVICE_PROFILE_INITED = 40, - SUBSCRIBE_DEVICE_PROFILE_INITED = 41, - UNSUBSCRIBE_DEVICE_PROFILE_INITED = 42, - ON_TRUST_DEVICE_PROFILE_ACTIVE = 43, - ON_TRUST_DEVICE_PROFILE_INACTIVE = 44, - PUT_ALL_TRUSTED_DEVICES = 45, - PUT_DEVICE_PROFILE_BATCH = 46, - GET_DEVICE_PROFILES = 47, - GET_DEVICE_ICON_INFOS = 48, - PUT_DEVICE_ICON_INFO_BATCH = 49, - PUT_PRODUCT_INFO_BATCH = 50, - DELETE_DEVICE_PROFILE_BATCH = 51, - PUT_SERVICE_INFO_PROFILE = 52, - DELETE_SERVICE_INFO_PROFILE = 53, - UPDATE_SERVICE_INFO_PROFILE = 54, - GET_SERVICE_INFO_PROFILE_BY_UNIQUE_KEY = 55, - GET_SERVICE_INFO_PROFILE_LIST_BY_TOKEN_ID = 56, - GET_ALL_SERVICE_INFO_PROFILE_LIST = 57, - GET_SERVICE_INFO_PROFILE_LIST_BY_BUNDLE_NAME = 58, - PUT_SESSION_KEY = 59, - GET_SESSION_KEY = 60, - UPDATE_SESSION_KEY = 61, - DELETE_SESSION_KEY = 62, - ON_PINCODE_INVALID = 63, - SUBSCRIBE_PINCODE_INVALID = 64, - UNSUBSCRIBE_PINCODE_INVALID = 65, - PUT_LOCAL_SERVICE_INFO = 66, - UPDATE_LOCAL_SERVICE_INFO = 67, - GET_LOCAL_SERVICE_INFO_BY_BINDLE_AND_PINTYPE = 68, - DELETE_LOCAL_SERVICE_INFO = 69, - GET_ALL_ACL_INCLUDE_LNN_ACL = 70, - ON_BUSINESS_EVENT = 71, - REGISTER_BUSINESS_CALLBACK = 72, - UNREGISTER_BUSINESS_CALLBACK = 73, - PUT_BUSINESS_EVENT = 74, - GET_BUSINESS_EVENT = 75, - SYNC_STATIC_PROFILE = 76, - MAX = 77 -}; - enum class DeviceIdType : uint32_t { MIN = 0, UDID = 1, diff --git a/common/include/interfaces/dp_ipc_interface_code.h b/common/include/interfaces/dp_ipc_interface_code.h new file mode 100644 index 0000000000000000000000000000000000000000..f6bef6a435e23302735ba158aca37476332cf174 --- /dev/null +++ b/common/include/interfaces/dp_ipc_interface_code.h @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OHOS_DP_IPC_INTERFACE_CODE_H +#define OHOS_DP_IPC_INTERFACE_CODE_H + +#include + +/* SAID: 6001 */ +namespace OHOS { +namespace DistributedDeviceProfile { +enum class DpIpcInterfaceCode : uint32_t { + MIN = 0, + PUT_ACL_PROFILE = 7, // new ipc code + UPDATE_ACL_PROFILE = 8, + GET_TRUST_DEVICE_PROFILE = 9, + GET_ALL_TRUST_DEVICE_PROFILE = 10, + GET_ACL_PROFILE = 11, + GET_ALL_ACL_PROFILE = 12, + DELETE_ACL_PROFILE = 13, + PUT_SERVICE_PROFILE = 14, + PUT_SERVICE_PROFILE_BATCH = 15, + PUT_CHAR_PROFILE = 16, + PUT_CHAR_PROFILE_BATCH = 17, + GET_DEVICE_PROFILE_NEW = 18, + GET_SERVICE_PROFILE = 19, + GET_CHAR_PROFILE = 20, + DEL_SERVICE_PROFILE = 21, + DEL_CHAR_PROFILE = 22, + SUBSCRIBE_DEVICE_PROFILE = 23, + UNSUBSCRIBE_DEVICE_PROFILE = 24, + SYNC_DEVICE_PROFILE_NEW = 25, + SEND_SUBSCRIBE_INFOS = 26, + ON_SYNC_COMPLETED = 27, + ON_TRUST_DEVICE_PROFILE_ADD = 28, + ON_TRUST_DEVICE_PROFILE_UPDATE = 29, + ON_TRUST_DEVICE_PROFILE_DELETE = 30, + ON_DEVICE_PROFILE_ADD = 31, + ON_DEVICE_PROFILE_UPDATE = 32, + ON_DEVICE_PROFILE_DELETE = 33, + ON_SERVICE_PROFILE_ADD = 34, + ON_SERVICE_PROFILE_UPDATE = 35, + ON_SERVICE_PROFILE_DELETE = 36, + ON_CHAR_PROFILE_ADD = 37, + ON_CHAR_PROFILE_UPDATE = 38, + ON_CHAR_PROFILE_DELETE = 39, + ON_DEVICE_PROFILE_INITED = 40, + SUBSCRIBE_DEVICE_PROFILE_INITED = 41, + UNSUBSCRIBE_DEVICE_PROFILE_INITED = 42, + ON_TRUST_DEVICE_PROFILE_ACTIVE = 43, + ON_TRUST_DEVICE_PROFILE_INACTIVE = 44, + PUT_ALL_TRUSTED_DEVICES = 45, + PUT_DEVICE_PROFILE_BATCH = 46, + GET_DEVICE_PROFILES = 47, + GET_DEVICE_ICON_INFOS = 48, + PUT_DEVICE_ICON_INFO_BATCH = 49, + PUT_PRODUCT_INFO_BATCH = 50, + DELETE_DEVICE_PROFILE_BATCH = 51, + PUT_SERVICE_INFO_PROFILE = 52, + DELETE_SERVICE_INFO_PROFILE = 53, + UPDATE_SERVICE_INFO_PROFILE = 54, + GET_SERVICE_INFO_PROFILE_BY_UNIQUE_KEY = 55, + GET_SERVICE_INFO_PROFILE_LIST_BY_TOKEN_ID = 56, + GET_ALL_SERVICE_INFO_PROFILE_LIST = 57, + GET_SERVICE_INFO_PROFILE_LIST_BY_BUNDLE_NAME = 58, + PUT_SESSION_KEY = 59, + GET_SESSION_KEY = 60, + UPDATE_SESSION_KEY = 61, + DELETE_SESSION_KEY = 62, + ON_PINCODE_INVALID = 63, + SUBSCRIBE_PINCODE_INVALID = 64, + UNSUBSCRIBE_PINCODE_INVALID = 65, + PUT_LOCAL_SERVICE_INFO = 66, + UPDATE_LOCAL_SERVICE_INFO = 67, + GET_LOCAL_SERVICE_INFO_BY_BINDLE_AND_PINTYPE = 68, + DELETE_LOCAL_SERVICE_INFO = 69, + GET_ALL_ACL_INCLUDE_LNN_ACL = 70, + ON_BUSINESS_EVENT = 71, + REGISTER_BUSINESS_CALLBACK = 72, + UNREGISTER_BUSINESS_CALLBACK = 73, + PUT_BUSINESS_EVENT = 74, + GET_BUSINESS_EVENT = 75, + SYNC_STATIC_PROFILE = 76, + MAX = 77 +}; +} // namespace DistributedDeviceProfile +} // namespace OHOS +#endif // OHOS_DP_IPC_INTERFACE_CODE_H diff --git a/common/src/interfaces/dp_inited_callback_proxy.cpp b/common/src/interfaces/dp_inited_callback_proxy.cpp index c318dc841f808119eb1b56b5a6436a48523aff1a..3df802ed6a967325e258d8d4da099de8b7e0b53a 100644 --- a/common/src/interfaces/dp_inited_callback_proxy.cpp +++ b/common/src/interfaces/dp_inited_callback_proxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Huawei Device Co., Ltd. + * Copyright (c) 2024-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -16,6 +16,7 @@ #include "dp_inited_callback_proxy.h" #include "macro_utils.h" #include "distributed_device_profile_errors.h" +#include "dp_ipc_interface_code.h" #include "i_distributed_device_profile.h" #include "message_parcel.h" @@ -35,7 +36,7 @@ int32_t DpInitedCallbackProxy::OnDpInited() return ERR_FLATTEN_OBJECT; } MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::ON_DEVICE_PROFILE_INITED), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::ON_DEVICE_PROFILE_INITED), data, reply); return DP_SUCCESS; } } // namespace DistributedDeviceProfile diff --git a/common/src/interfaces/dp_inited_callback_stub.cpp b/common/src/interfaces/dp_inited_callback_stub.cpp index a502649b869161c5c8c1502a0554b04524fdea07..a530455b74c0367ecb1ee22bd030beb70f11c94c 100644 --- a/common/src/interfaces/dp_inited_callback_stub.cpp +++ b/common/src/interfaces/dp_inited_callback_stub.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Huawei Device Co., Ltd. + * Copyright (c) 2024-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -17,6 +17,7 @@ #include "ipc_utils.h" #include "message_parcel.h" #include "dp_inited_callback_stub.h" +#include "dp_ipc_interface_code.h" namespace OHOS { namespace DistributedDeviceProfile { @@ -44,7 +45,7 @@ int32_t DpInitedCallbackStub::OnRemoteRequest(uint32_t code, MessageParcel& data HILOGE("Check descriptor failed"); return DP_INTERFACE_CHECK_FAILED; } - if (code != static_cast(DPInterfaceCode::ON_DEVICE_PROFILE_INITED)) { + if (code != static_cast(DpIpcInterfaceCode::ON_DEVICE_PROFILE_INITED)) { HILOGW("Unknown request code, code = %{public}u", code); return IPCObjectStub::OnRemoteRequest(code, data, reply, option); } diff --git a/common/src/interfaces/pincode_invalid_callback_proxy.cpp b/common/src/interfaces/pincode_invalid_callback_proxy.cpp index 50c9255cf31bcd06006ccd312ab2908c1da3cb30..a8187e5fa1794d59fd7371c5fbd587c9fac6e4c4 100644 --- a/common/src/interfaces/pincode_invalid_callback_proxy.cpp +++ b/common/src/interfaces/pincode_invalid_callback_proxy.cpp @@ -16,6 +16,7 @@ #include "pincode_invalid_callback_proxy.h" #include "macro_utils.h" #include "distributed_device_profile_errors.h" +#include "dp_ipc_interface_code.h" #include "i_distributed_device_profile.h" #include "message_parcel.h" @@ -39,7 +40,7 @@ int32_t PinCodeInvalidCallbackProxy::OnPincodeInvalid(const LocalServiceInfo& lo return DP_WRITE_PARCEL_FAIL; } MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::ON_PINCODE_INVALID), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::ON_PINCODE_INVALID), data, reply); return DP_SUCCESS; } } // namespace DistributedDeviceProfile diff --git a/common/src/interfaces/pincode_invalid_callback_stub.cpp b/common/src/interfaces/pincode_invalid_callback_stub.cpp index 564fc430fbfa0ac6d2fdc2a0f378a384dbf1ebb2..6a3f6f5d27a89639d58ed2cf7ba8c36166ffbc1c 100644 --- a/common/src/interfaces/pincode_invalid_callback_stub.cpp +++ b/common/src/interfaces/pincode_invalid_callback_stub.cpp @@ -14,6 +14,7 @@ */ #include "distributed_device_profile_log.h" +#include "dp_ipc_interface_code.h" #include "ipc_utils.h" #include "message_parcel.h" #include "pincode_invalid_callback_stub.h" @@ -44,7 +45,7 @@ int32_t PinCodeInvalidCallbackStub::OnRemoteRequest(uint32_t code, MessageParcel HILOGE("Check descriptor failed"); return DP_INTERFACE_CHECK_FAILED; } - if (code != static_cast(DPInterfaceCode::ON_PINCODE_INVALID)) { + if (code != static_cast(DpIpcInterfaceCode::ON_PINCODE_INVALID)) { HILOGW("Unknown request code, code = %{public}u", code); return IPCObjectStub::OnRemoteRequest(code, data, reply, option); } diff --git a/common/src/interfaces/profile_change_listener_proxy.cpp b/common/src/interfaces/profile_change_listener_proxy.cpp index 740957ae2ead233f83dc7ee13e890a46c30cc3cb..e212e1c4bebd096e57f012573f775e1f9c6d5aca 100644 --- a/common/src/interfaces/profile_change_listener_proxy.cpp +++ b/common/src/interfaces/profile_change_listener_proxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023-2024 Huawei Device Co., Ltd. + * Copyright (c) 2023-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -16,6 +16,7 @@ #include "profile_change_listener_proxy.h" #include "macro_utils.h" #include "distributed_device_profile_errors.h" +#include "dp_ipc_interface_code.h" #include "i_distributed_device_profile.h" #include "message_parcel.h" @@ -35,7 +36,7 @@ int32_t ProfileListenerProxy::OnTrustDeviceProfileAdd(const TrustDeviceProfile& return ERR_FLATTEN_OBJECT; } MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::ON_TRUST_DEVICE_PROFILE_ADD), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::ON_TRUST_DEVICE_PROFILE_ADD), data, reply); return DP_SUCCESS; } @@ -50,7 +51,7 @@ int32_t ProfileListenerProxy::OnTrustDeviceProfileDelete(const TrustDeviceProfil return ERR_FLATTEN_OBJECT; } MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::ON_TRUST_DEVICE_PROFILE_DELETE), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::ON_TRUST_DEVICE_PROFILE_DELETE), data, reply); return DP_SUCCESS; } @@ -70,7 +71,7 @@ int32_t ProfileListenerProxy::OnTrustDeviceProfileUpdate(const TrustDeviceProfil return ERR_FLATTEN_OBJECT; } MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::ON_TRUST_DEVICE_PROFILE_UPDATE), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::ON_TRUST_DEVICE_PROFILE_UPDATE), data, reply); return DP_SUCCESS; } @@ -85,7 +86,7 @@ int32_t ProfileListenerProxy::OnTrustDeviceProfileActive(const TrustDeviceProfil return ERR_FLATTEN_OBJECT; } MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::ON_TRUST_DEVICE_PROFILE_ACTIVE), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::ON_TRUST_DEVICE_PROFILE_ACTIVE), data, reply); return DP_SUCCESS; } @@ -100,7 +101,7 @@ int32_t ProfileListenerProxy::OnTrustDeviceProfileInactive(const TrustDeviceProf return ERR_FLATTEN_OBJECT; } MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::ON_TRUST_DEVICE_PROFILE_INACTIVE), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::ON_TRUST_DEVICE_PROFILE_INACTIVE), data, reply); return DP_SUCCESS; } @@ -115,7 +116,7 @@ int32_t ProfileListenerProxy::OnDeviceProfileAdd(const DeviceProfile& profile) return ERR_FLATTEN_OBJECT; } MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::ON_DEVICE_PROFILE_ADD), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::ON_DEVICE_PROFILE_ADD), data, reply); return DP_SUCCESS; } @@ -130,7 +131,7 @@ int32_t ProfileListenerProxy::OnDeviceProfileDelete(const DeviceProfile& profile return ERR_FLATTEN_OBJECT; } MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::ON_DEVICE_PROFILE_DELETE), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::ON_DEVICE_PROFILE_DELETE), data, reply); return DP_SUCCESS; } @@ -149,7 +150,7 @@ int32_t ProfileListenerProxy::OnDeviceProfileUpdate(const DeviceProfile& oldProf return ERR_FLATTEN_OBJECT; } MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::ON_DEVICE_PROFILE_UPDATE), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::ON_DEVICE_PROFILE_UPDATE), data, reply); return DP_SUCCESS; } @@ -164,7 +165,7 @@ int32_t ProfileListenerProxy::OnServiceProfileAdd(const ServiceProfile& profile) return ERR_FLATTEN_OBJECT; } MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::ON_SERVICE_PROFILE_ADD), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::ON_SERVICE_PROFILE_ADD), data, reply); return DP_SUCCESS; } @@ -179,7 +180,7 @@ int32_t ProfileListenerProxy::OnServiceProfileDelete(const ServiceProfile& profi return ERR_FLATTEN_OBJECT; } MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::ON_SERVICE_PROFILE_DELETE), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::ON_SERVICE_PROFILE_DELETE), data, reply); return DP_SUCCESS; } @@ -198,7 +199,7 @@ int32_t ProfileListenerProxy::OnServiceProfileUpdate(const ServiceProfile& oldPr return ERR_FLATTEN_OBJECT; } MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::ON_SERVICE_PROFILE_UPDATE), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::ON_SERVICE_PROFILE_UPDATE), data, reply); return DP_SUCCESS; } @@ -213,7 +214,7 @@ int32_t ProfileListenerProxy::OnCharacteristicProfileAdd(const CharacteristicPro return ERR_FLATTEN_OBJECT; } MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::ON_CHAR_PROFILE_ADD), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::ON_CHAR_PROFILE_ADD), data, reply); return DP_SUCCESS; } @@ -228,7 +229,7 @@ int32_t ProfileListenerProxy::OnCharacteristicProfileDelete(const Characteristic return ERR_FLATTEN_OBJECT; } MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::ON_CHAR_PROFILE_DELETE), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::ON_CHAR_PROFILE_DELETE), data, reply); return DP_SUCCESS; } @@ -248,7 +249,7 @@ int32_t ProfileListenerProxy::OnCharacteristicProfileUpdate(const Characteristic return ERR_FLATTEN_OBJECT; } MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::ON_CHAR_PROFILE_UPDATE), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::ON_CHAR_PROFILE_UPDATE), data, reply); return DP_SUCCESS; } } // namespace DistributedDeviceProfile diff --git a/common/src/interfaces/profile_change_listener_stub.cpp b/common/src/interfaces/profile_change_listener_stub.cpp index 16bd8d30fcef2f24aa29b29ca06e11ce1cce1513..88a0526f1b01c20fca179e589c2bf7db2caeab3b 100644 --- a/common/src/interfaces/profile_change_listener_stub.cpp +++ b/common/src/interfaces/profile_change_listener_stub.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023-2024 Huawei Device Co., Ltd. + * Copyright (c) 2023-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -14,15 +14,18 @@ */ #include "profile_change_listener_stub.h" -#include "distributed_device_profile_errors.h" -#include "trust_device_profile.h" + +#include "message_parcel.h" + #include "access_control_profile.h" -#include "device_profile.h" -#include "service_profile.h" #include "characteristic_profile.h" +#include "device_profile.h" +#include "distributed_device_profile_errors.h" #include "distributed_device_profile_log.h" +#include "dp_ipc_interface_code.h" #include "ipc_utils.h" -#include "message_parcel.h" +#include "service_profile.h" +#include "trust_device_profile.h" namespace OHOS { namespace DistributedDeviceProfile { @@ -32,33 +35,33 @@ namespace { ProfileChangeListenerStub::ProfileChangeListenerStub() { HILOGI("construct!"); - funcsMap_[static_cast(DPInterfaceCode::ON_TRUST_DEVICE_PROFILE_ADD)] = + funcsMap_[static_cast(DpIpcInterfaceCode::ON_TRUST_DEVICE_PROFILE_ADD)] = &ProfileChangeListenerStub::OnTrustDeviceProfileAddInner; - funcsMap_[static_cast(DPInterfaceCode::ON_TRUST_DEVICE_PROFILE_DELETE)] = + funcsMap_[static_cast(DpIpcInterfaceCode::ON_TRUST_DEVICE_PROFILE_DELETE)] = &ProfileChangeListenerStub::OnTrustDeviceProfileDeleteInner; - funcsMap_[static_cast(DPInterfaceCode::ON_TRUST_DEVICE_PROFILE_UPDATE)] = + funcsMap_[static_cast(DpIpcInterfaceCode::ON_TRUST_DEVICE_PROFILE_UPDATE)] = &ProfileChangeListenerStub::OnTrustDeviceProfileUpdateInner; - funcsMap_[static_cast(DPInterfaceCode::ON_TRUST_DEVICE_PROFILE_ACTIVE)] = + funcsMap_[static_cast(DpIpcInterfaceCode::ON_TRUST_DEVICE_PROFILE_ACTIVE)] = &ProfileChangeListenerStub::OnTrustDeviceProfileActiveInner; - funcsMap_[static_cast(DPInterfaceCode::ON_TRUST_DEVICE_PROFILE_INACTIVE)] = + funcsMap_[static_cast(DpIpcInterfaceCode::ON_TRUST_DEVICE_PROFILE_INACTIVE)] = &ProfileChangeListenerStub::OnTrustDeviceProfileInactiveInner; - funcsMap_[static_cast(DPInterfaceCode::ON_DEVICE_PROFILE_ADD)] = + funcsMap_[static_cast(DpIpcInterfaceCode::ON_DEVICE_PROFILE_ADD)] = &ProfileChangeListenerStub::OnDeviceProfileAddInner; - funcsMap_[static_cast(DPInterfaceCode::ON_DEVICE_PROFILE_DELETE)] = + funcsMap_[static_cast(DpIpcInterfaceCode::ON_DEVICE_PROFILE_DELETE)] = &ProfileChangeListenerStub::OnDeviceProfileDeleteInner; - funcsMap_[static_cast(DPInterfaceCode::ON_DEVICE_PROFILE_UPDATE)] = + funcsMap_[static_cast(DpIpcInterfaceCode::ON_DEVICE_PROFILE_UPDATE)] = &ProfileChangeListenerStub::OnDeviceProfileUpdateInner; - funcsMap_[static_cast(DPInterfaceCode::ON_SERVICE_PROFILE_ADD)] = + funcsMap_[static_cast(DpIpcInterfaceCode::ON_SERVICE_PROFILE_ADD)] = &ProfileChangeListenerStub::OnServiceProfileAddInner; - funcsMap_[static_cast(DPInterfaceCode::ON_SERVICE_PROFILE_DELETE)] = + funcsMap_[static_cast(DpIpcInterfaceCode::ON_SERVICE_PROFILE_DELETE)] = &ProfileChangeListenerStub::OnServiceProfileDeleteInner; - funcsMap_[static_cast(DPInterfaceCode::ON_SERVICE_PROFILE_UPDATE)] = + funcsMap_[static_cast(DpIpcInterfaceCode::ON_SERVICE_PROFILE_UPDATE)] = &ProfileChangeListenerStub::OnServiceProfileUpdateInner; - funcsMap_[static_cast(DPInterfaceCode::ON_CHAR_PROFILE_ADD)] = + funcsMap_[static_cast(DpIpcInterfaceCode::ON_CHAR_PROFILE_ADD)] = &ProfileChangeListenerStub::OnCharacteristicProfileAddInner; - funcsMap_[static_cast(DPInterfaceCode::ON_CHAR_PROFILE_DELETE)] = + funcsMap_[static_cast(DpIpcInterfaceCode::ON_CHAR_PROFILE_DELETE)] = &ProfileChangeListenerStub::OnCharacteristicProfileDeleteInner; - funcsMap_[static_cast(DPInterfaceCode::ON_CHAR_PROFILE_UPDATE)] = + funcsMap_[static_cast(DpIpcInterfaceCode::ON_CHAR_PROFILE_UPDATE)] = &ProfileChangeListenerStub::OnCharacteristicProfileUpdateInner; } @@ -82,33 +85,33 @@ int32_t ProfileChangeListenerStub::OnRemoteRequest(uint32_t code, MessageParcel& return DP_INTERFACE_CHECK_FAILED; } switch (code) { - case static_cast(DPInterfaceCode::ON_TRUST_DEVICE_PROFILE_ADD): + case static_cast(DpIpcInterfaceCode::ON_TRUST_DEVICE_PROFILE_ADD): return ProfileChangeListenerStub::OnTrustDeviceProfileAddInner(data, reply); - case static_cast(DPInterfaceCode::ON_TRUST_DEVICE_PROFILE_DELETE): + case static_cast(DpIpcInterfaceCode::ON_TRUST_DEVICE_PROFILE_DELETE): return ProfileChangeListenerStub::OnTrustDeviceProfileDeleteInner(data, reply); - case static_cast(DPInterfaceCode::ON_TRUST_DEVICE_PROFILE_UPDATE): + case static_cast(DpIpcInterfaceCode::ON_TRUST_DEVICE_PROFILE_UPDATE): return ProfileChangeListenerStub::OnTrustDeviceProfileUpdateInner(data, reply); - case static_cast(DPInterfaceCode::ON_TRUST_DEVICE_PROFILE_ACTIVE): + case static_cast(DpIpcInterfaceCode::ON_TRUST_DEVICE_PROFILE_ACTIVE): return ProfileChangeListenerStub::OnTrustDeviceProfileActiveInner(data, reply); - case static_cast(DPInterfaceCode::ON_TRUST_DEVICE_PROFILE_INACTIVE): + case static_cast(DpIpcInterfaceCode::ON_TRUST_DEVICE_PROFILE_INACTIVE): return ProfileChangeListenerStub::OnTrustDeviceProfileInactiveInner(data, reply); - case static_cast(DPInterfaceCode::ON_DEVICE_PROFILE_ADD): + case static_cast(DpIpcInterfaceCode::ON_DEVICE_PROFILE_ADD): return ProfileChangeListenerStub::OnDeviceProfileAddInner(data, reply); - case static_cast(DPInterfaceCode::ON_DEVICE_PROFILE_DELETE): + case static_cast(DpIpcInterfaceCode::ON_DEVICE_PROFILE_DELETE): return ProfileChangeListenerStub::OnDeviceProfileDeleteInner(data, reply); - case static_cast(DPInterfaceCode::ON_DEVICE_PROFILE_UPDATE): + case static_cast(DpIpcInterfaceCode::ON_DEVICE_PROFILE_UPDATE): return ProfileChangeListenerStub::OnDeviceProfileUpdateInner(data, reply); - case static_cast(DPInterfaceCode::ON_SERVICE_PROFILE_ADD): + case static_cast(DpIpcInterfaceCode::ON_SERVICE_PROFILE_ADD): return ProfileChangeListenerStub::OnServiceProfileAddInner(data, reply); - case static_cast(DPInterfaceCode::ON_SERVICE_PROFILE_DELETE): + case static_cast(DpIpcInterfaceCode::ON_SERVICE_PROFILE_DELETE): return ProfileChangeListenerStub::OnServiceProfileDeleteInner(data, reply); - case static_cast(DPInterfaceCode::ON_SERVICE_PROFILE_UPDATE): + case static_cast(DpIpcInterfaceCode::ON_SERVICE_PROFILE_UPDATE): return ProfileChangeListenerStub::OnServiceProfileUpdateInner(data, reply); - case static_cast(DPInterfaceCode::ON_CHAR_PROFILE_ADD): + case static_cast(DpIpcInterfaceCode::ON_CHAR_PROFILE_ADD): return ProfileChangeListenerStub::OnCharacteristicProfileAddInner(data, reply); - case static_cast(DPInterfaceCode::ON_CHAR_PROFILE_DELETE): + case static_cast(DpIpcInterfaceCode::ON_CHAR_PROFILE_DELETE): return ProfileChangeListenerStub::OnCharacteristicProfileDeleteInner(data, reply); - case static_cast(DPInterfaceCode::ON_CHAR_PROFILE_UPDATE): + case static_cast(DpIpcInterfaceCode::ON_CHAR_PROFILE_UPDATE): return ProfileChangeListenerStub::OnCharacteristicProfileUpdateInner(data, reply); default: HILOGW("unknown request code, please check, code = %{public}u", code); diff --git a/common/src/interfaces/sync_completed_callback_proxy.cpp b/common/src/interfaces/sync_completed_callback_proxy.cpp index c6c9088085e0a26217dc25c38b45963d70e11a57..07017327dd7ed3b1e83f2949bec7f7c32e0f127e 100644 --- a/common/src/interfaces/sync_completed_callback_proxy.cpp +++ b/common/src/interfaces/sync_completed_callback_proxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2023-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -15,6 +15,7 @@ #include "sync_completed_callback_proxy.h" #include "distributed_device_profile_log.h" +#include "dp_ipc_interface_code.h" #include "macro_utils.h" #include "message_parcel.h" @@ -55,7 +56,7 @@ void SyncCompletedCallbackProxy::OnSyncCompleted(const SyncResult &syncResults) HILOGE("Remote is nullptr"); return; } - int32_t errCode = Remote()->SendRequest(static_cast(DPInterfaceCode::ON_SYNC_COMPLETED), data, reply, + int32_t errCode = Remote()->SendRequest(static_cast(DpIpcInterfaceCode::ON_SYNC_COMPLETED), data, reply, option); if (errCode != ERR_OK) { HILOGE("send request failed, errCode = %{public}d", errCode); diff --git a/common/src/interfaces/sync_completed_callback_stub.cpp b/common/src/interfaces/sync_completed_callback_stub.cpp index 84ca0d56bfa6e299adeb0a4d466d2549c304034f..1d452fa3c8006a26342153bfd981ec10877cbdc6 100644 --- a/common/src/interfaces/sync_completed_callback_stub.cpp +++ b/common/src/interfaces/sync_completed_callback_stub.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2023-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -19,9 +19,10 @@ #include #include +#include "distributed_device_profile_constants.h" #include "distributed_device_profile_errors.h" #include "distributed_device_profile_log.h" -#include "distributed_device_profile_constants.h" +#include "dp_ipc_interface_code.h" #include "ipc_object_stub.h" #include "message_parcel.h" #include "macro_utils.h" @@ -53,7 +54,7 @@ int32_t SyncCompletedCallbackStub::OnRemoteRequest(uint32_t code, MessageParcel& return DP_INTERFACE_CHECK_FAILED; } - if (code != static_cast(DPInterfaceCode::ON_SYNC_COMPLETED)) { + if (code != static_cast(DpIpcInterfaceCode::ON_SYNC_COMPLETED)) { HILOGW("Unknown request code, code = %{public}u", code); return IPCObjectStub::OnRemoteRequest(code, data, reply, option); } diff --git a/common/test/profilechangelistenerstubunittest/profile_change_listener_stub_test.cpp b/common/test/profilechangelistenerstubunittest/profile_change_listener_stub_test.cpp index 08d45d80f7bc36e331f42865d857b97fdb6f0383..ac93fa2d1504123cd66a0fc4a1fe26d2637f4798 100644 --- a/common/test/profilechangelistenerstubunittest/profile_change_listener_stub_test.cpp +++ b/common/test/profilechangelistenerstubunittest/profile_change_listener_stub_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Huawei Device Co., Ltd. + * Copyright (c) 2024-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -17,8 +17,9 @@ #include "ipc_types.h" -#include "distributed_device_profile_errors.h" #include "distributed_device_profile_enums.h" +#include "distributed_device_profile_errors.h" +#include "dp_ipc_interface_code.h" using namespace testing::ext; namespace OHOS { @@ -133,7 +134,7 @@ int32_t MockProfileChangeListenerStub::OnCharacteristicProfileUpdate(const Chara HWTEST_F(ProfileChangeListenerStubTest, OnRemoteRequest_001, TestSize.Level0) { - uint32_t code = static_cast(DPInterfaceCode::ON_TRUST_DEVICE_PROFILE_ADD); + uint32_t code = static_cast(DpIpcInterfaceCode::ON_TRUST_DEVICE_PROFILE_ADD); MessageParcel data; MessageParcel reply; MessageOption option; @@ -269,7 +270,7 @@ HWTEST_F(ProfileChangeListenerStubTest, OnCharacteristicProfileUpdateInner_001, HWTEST_F(ProfileChangeListenerStubTest, OnRemoteRequest_002, TestSize.Level0) { - uint32_t code = static_cast(DPInterfaceCode::ON_TRUST_DEVICE_PROFILE_ADD); + uint32_t code = static_cast(DpIpcInterfaceCode::ON_TRUST_DEVICE_PROFILE_ADD); MessageParcel data; data.WriteInterfaceToken(IProfileChangeListener::GetDescriptor()); MessageParcel reply; @@ -280,7 +281,7 @@ HWTEST_F(ProfileChangeListenerStubTest, OnRemoteRequest_002, TestSize.Level0) HWTEST_F(ProfileChangeListenerStubTest, OnRemoteRequest_003, TestSize.Level0) { - uint32_t code = static_cast(DPInterfaceCode::ON_TRUST_DEVICE_PROFILE_DELETE); + uint32_t code = static_cast(DpIpcInterfaceCode::ON_TRUST_DEVICE_PROFILE_DELETE); MessageParcel data; data.WriteInterfaceToken(IProfileChangeListener::GetDescriptor()); MessageParcel reply; @@ -291,7 +292,7 @@ HWTEST_F(ProfileChangeListenerStubTest, OnRemoteRequest_003, TestSize.Level0) HWTEST_F(ProfileChangeListenerStubTest, OnRemoteRequest_004, TestSize.Level0) { - uint32_t code = static_cast(DPInterfaceCode::ON_TRUST_DEVICE_PROFILE_UPDATE); + uint32_t code = static_cast(DpIpcInterfaceCode::ON_TRUST_DEVICE_PROFILE_UPDATE); MessageParcel data; data.WriteInterfaceToken(IProfileChangeListener::GetDescriptor()); MessageParcel reply; @@ -302,7 +303,7 @@ HWTEST_F(ProfileChangeListenerStubTest, OnRemoteRequest_004, TestSize.Level0) HWTEST_F(ProfileChangeListenerStubTest, OnRemoteRequest_005, TestSize.Level0) { - uint32_t code = static_cast(DPInterfaceCode::ON_DEVICE_PROFILE_ADD); + uint32_t code = static_cast(DpIpcInterfaceCode::ON_DEVICE_PROFILE_ADD); MessageParcel data; data.WriteInterfaceToken(IProfileChangeListener::GetDescriptor()); MessageParcel reply; @@ -313,7 +314,7 @@ HWTEST_F(ProfileChangeListenerStubTest, OnRemoteRequest_005, TestSize.Level0) HWTEST_F(ProfileChangeListenerStubTest, OnRemoteRequest_006, TestSize.Level0) { - uint32_t code = static_cast(DPInterfaceCode::ON_DEVICE_PROFILE_DELETE); + uint32_t code = static_cast(DpIpcInterfaceCode::ON_DEVICE_PROFILE_DELETE); MessageParcel data; data.WriteInterfaceToken(IProfileChangeListener::GetDescriptor()); MessageParcel reply; @@ -324,7 +325,7 @@ HWTEST_F(ProfileChangeListenerStubTest, OnRemoteRequest_006, TestSize.Level0) HWTEST_F(ProfileChangeListenerStubTest, OnRemoteRequest_007, TestSize.Level0) { - uint32_t code = static_cast(DPInterfaceCode::ON_DEVICE_PROFILE_UPDATE); + uint32_t code = static_cast(DpIpcInterfaceCode::ON_DEVICE_PROFILE_UPDATE); MessageParcel data; data.WriteInterfaceToken(IProfileChangeListener::GetDescriptor()); MessageParcel reply; @@ -335,7 +336,7 @@ HWTEST_F(ProfileChangeListenerStubTest, OnRemoteRequest_007, TestSize.Level0) HWTEST_F(ProfileChangeListenerStubTest, OnRemoteRequest_008, TestSize.Level0) { - uint32_t code = static_cast(DPInterfaceCode::ON_SERVICE_PROFILE_ADD); + uint32_t code = static_cast(DpIpcInterfaceCode::ON_SERVICE_PROFILE_ADD); MessageParcel data; data.WriteInterfaceToken(IProfileChangeListener::GetDescriptor()); MessageParcel reply; @@ -346,7 +347,7 @@ HWTEST_F(ProfileChangeListenerStubTest, OnRemoteRequest_008, TestSize.Level0) HWTEST_F(ProfileChangeListenerStubTest, OnRemoteRequest_009, TestSize.Level0) { - uint32_t code = static_cast(DPInterfaceCode::ON_SERVICE_PROFILE_DELETE); + uint32_t code = static_cast(DpIpcInterfaceCode::ON_SERVICE_PROFILE_DELETE); MessageParcel data; data.WriteInterfaceToken(IProfileChangeListener::GetDescriptor()); MessageParcel reply; @@ -357,7 +358,7 @@ HWTEST_F(ProfileChangeListenerStubTest, OnRemoteRequest_009, TestSize.Level0) HWTEST_F(ProfileChangeListenerStubTest, OnRemoteRequest_010, TestSize.Level0) { - uint32_t code = static_cast(DPInterfaceCode::ON_SERVICE_PROFILE_UPDATE); + uint32_t code = static_cast(DpIpcInterfaceCode::ON_SERVICE_PROFILE_UPDATE); MessageParcel data; data.WriteInterfaceToken(IProfileChangeListener::GetDescriptor()); MessageParcel reply; @@ -368,7 +369,7 @@ HWTEST_F(ProfileChangeListenerStubTest, OnRemoteRequest_010, TestSize.Level0) HWTEST_F(ProfileChangeListenerStubTest, OnRemoteRequest_011, TestSize.Level0) { - uint32_t code = static_cast(DPInterfaceCode::ON_CHAR_PROFILE_ADD); + uint32_t code = static_cast(DpIpcInterfaceCode::ON_CHAR_PROFILE_ADD); MessageParcel data; data.WriteInterfaceToken(IProfileChangeListener::GetDescriptor()); MessageParcel reply; @@ -379,7 +380,7 @@ HWTEST_F(ProfileChangeListenerStubTest, OnRemoteRequest_011, TestSize.Level0) HWTEST_F(ProfileChangeListenerStubTest, OnRemoteRequest_012, TestSize.Level0) { - uint32_t code = static_cast(DPInterfaceCode::ON_CHAR_PROFILE_DELETE); + uint32_t code = static_cast(DpIpcInterfaceCode::ON_CHAR_PROFILE_DELETE); MessageParcel data; data.WriteInterfaceToken(IProfileChangeListener::GetDescriptor()); MessageParcel reply; @@ -390,7 +391,7 @@ HWTEST_F(ProfileChangeListenerStubTest, OnRemoteRequest_012, TestSize.Level0) HWTEST_F(ProfileChangeListenerStubTest, OnRemoteRequest_013, TestSize.Level0) { - uint32_t code = static_cast(DPInterfaceCode::ON_CHAR_PROFILE_UPDATE); + uint32_t code = static_cast(DpIpcInterfaceCode::ON_CHAR_PROFILE_UPDATE); MessageParcel data; data.WriteInterfaceToken(IProfileChangeListener::GetDescriptor()); MessageParcel reply; diff --git a/interfaces/innerkits/core/src/distributed_device_profile_proxy.cpp b/interfaces/innerkits/core/src/distributed_device_profile_proxy.cpp index 5c34c844619328d6ad7dabd7b98b3b162ebd3972..6f50a6c00334cbe0567028cf31120d0774c70877 100644 --- a/interfaces/innerkits/core/src/distributed_device_profile_proxy.cpp +++ b/interfaces/innerkits/core/src/distributed_device_profile_proxy.cpp @@ -15,6 +15,7 @@ #include #include "distributed_device_profile_proxy.h" +#include "dp_ipc_interface_code.h" namespace OHOS { namespace DistributedDeviceProfile { @@ -33,7 +34,7 @@ int32_t DistributedDeviceProfileProxy::PutAccessControlProfile(const AccessContr return DP_WRITE_PARCEL_FAIL; } MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::PUT_ACL_PROFILE), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::PUT_ACL_PROFILE), data, reply); return DP_SUCCESS; } @@ -48,7 +49,7 @@ int32_t DistributedDeviceProfileProxy::UpdateAccessControlProfile(const AccessCo return DP_WRITE_PARCEL_FAIL; } MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::UPDATE_ACL_PROFILE), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::UPDATE_ACL_PROFILE), data, reply); return DP_SUCCESS; } @@ -63,7 +64,7 @@ int32_t DistributedDeviceProfileProxy::PutProductInfoBatch(const std::vector(DPInterfaceCode::PUT_PRODUCT_INFO_BATCH), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::PUT_PRODUCT_INFO_BATCH), data, reply); return DP_SUCCESS; } @@ -78,7 +79,7 @@ int32_t DistributedDeviceProfileProxy::PutDeviceIconInfoBatch(const std::vector< return DP_WRITE_PARCEL_FAIL; } MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::PUT_DEVICE_ICON_INFO_BATCH), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::PUT_DEVICE_ICON_INFO_BATCH), data, reply); return DP_SUCCESS; } @@ -94,7 +95,7 @@ int32_t DistributedDeviceProfileProxy::GetDeviceIconInfos(const DeviceIconInfoFi return DP_WRITE_PARCEL_FAIL; } MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::GET_DEVICE_ICON_INFOS), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::GET_DEVICE_ICON_INFOS), data, reply); if (!IpcUtils::UnMarshalling(reply, deviceIconInfos)) { HILOGE("dp ipc write parcel fail"); return DP_WRITE_PARCEL_FAIL; @@ -111,7 +112,7 @@ int32_t DistributedDeviceProfileProxy::GetTrustDeviceProfile(const std::string& WRITE_INTERFACE_TOKEN(data); WRITE_HELPER(data, String, deviceId); MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::GET_TRUST_DEVICE_PROFILE), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::GET_TRUST_DEVICE_PROFILE), data, reply); if (!trustDeviceProfile.UnMarshalling(reply)) { HILOGE("dp ipc write parcel fail"); return DP_WRITE_PARCEL_FAIL; @@ -126,7 +127,7 @@ int32_t DistributedDeviceProfileProxy::GetAllTrustDeviceProfile(std::vector(DPInterfaceCode::GET_ALL_TRUST_DEVICE_PROFILE), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::GET_ALL_TRUST_DEVICE_PROFILE), data, reply); if (!IpcUtils::UnMarshalling(reply, trustDeviceProfiles)) { HILOGE("dp ipc read parcel fail"); return DP_READ_PARCEL_FAIL; @@ -146,7 +147,7 @@ int32_t DistributedDeviceProfileProxy::GetAccessControlProfile(std::map(DPInterfaceCode::GET_ACL_PROFILE), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::GET_ACL_PROFILE), data, reply); if (!IpcUtils::UnMarshalling(reply, accessControlProfiles)) { HILOGE("dp ipc read parcel fail"); return DP_READ_PARCEL_FAIL; @@ -162,7 +163,7 @@ int32_t DistributedDeviceProfileProxy::GetAllAccessControlProfile( MessageParcel data; WRITE_INTERFACE_TOKEN(data); MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::GET_ALL_ACL_PROFILE), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::GET_ALL_ACL_PROFILE), data, reply); if (!IpcUtils::UnMarshalling(reply, accessControlProfiles)) { HILOGE("dp ipc read parcel fail"); return DP_READ_PARCEL_FAIL; @@ -177,7 +178,7 @@ int32_t DistributedDeviceProfileProxy::GetAllAclIncludeLnnAcl(std::vector(DPInterfaceCode::GET_ALL_ACL_INCLUDE_LNN_ACL), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::GET_ALL_ACL_INCLUDE_LNN_ACL), data, reply); if (!IpcUtils::UnMarshalling(reply, accessControlProfiles)) { HILOGE("dp ipc read parcel fail"); return DP_READ_PARCEL_FAIL; @@ -193,7 +194,7 @@ int32_t DistributedDeviceProfileProxy::DeleteAccessControlProfile(int32_t access WRITE_INTERFACE_TOKEN(data); WRITE_HELPER(data, Int32, accessControlId); MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::DELETE_ACL_PROFILE), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::DELETE_ACL_PROFILE), data, reply); return DP_SUCCESS; } @@ -210,7 +211,7 @@ int32_t DistributedDeviceProfileProxy::PutSessionKey( return DP_WRITE_PARCEL_FAIL; } MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::PUT_SESSION_KEY), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::PUT_SESSION_KEY), data, reply); READ_HELPER(reply, Int32, sessionKeyId); return DP_SUCCESS; } @@ -225,7 +226,7 @@ int32_t DistributedDeviceProfileProxy::GetSessionKey( WRITE_HELPER(data, Uint32, userId); WRITE_HELPER(data, Int32, sessionKeyId); MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::GET_SESSION_KEY), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::GET_SESSION_KEY), data, reply); if (!IpcUtils::UnMarshalling(reply, sessionKey)) { HILOGE("dp ipc read parcel fail"); return DP_WRITE_PARCEL_FAIL; @@ -247,7 +248,7 @@ int32_t DistributedDeviceProfileProxy::UpdateSessionKey( return DP_WRITE_PARCEL_FAIL; } MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::UPDATE_SESSION_KEY), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::UPDATE_SESSION_KEY), data, reply); return DP_SUCCESS; } @@ -260,7 +261,7 @@ int32_t DistributedDeviceProfileProxy::DeleteSessionKey(uint32_t userId, int32_t WRITE_HELPER(data, Uint32, userId); WRITE_HELPER(data, Int32, sessionKeyId); MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::DELETE_SESSION_KEY), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::DELETE_SESSION_KEY), data, reply); return DP_SUCCESS; } @@ -275,7 +276,7 @@ int32_t DistributedDeviceProfileProxy::PutDeviceProfileBatch(std::vector(DPInterfaceCode::PUT_DEVICE_PROFILE_BATCH), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::PUT_DEVICE_PROFILE_BATCH), data, reply); return DP_SUCCESS; } @@ -290,7 +291,7 @@ int32_t DistributedDeviceProfileProxy::PutServiceProfile(const ServiceProfile& s return DP_WRITE_PARCEL_FAIL; } MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::PUT_SERVICE_PROFILE), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::PUT_SERVICE_PROFILE), data, reply); return DP_SUCCESS; } @@ -305,7 +306,7 @@ int32_t DistributedDeviceProfileProxy::PutServiceProfileBatch(const std::vector< return DP_WRITE_PARCEL_FAIL; } MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::PUT_SERVICE_PROFILE_BATCH), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::PUT_SERVICE_PROFILE_BATCH), data, reply); return DP_SUCCESS; } @@ -320,7 +321,7 @@ int32_t DistributedDeviceProfileProxy::PutCharacteristicProfile(const Characteri return DP_WRITE_PARCEL_FAIL; } MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::PUT_CHAR_PROFILE), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::PUT_CHAR_PROFILE), data, reply); return DP_SUCCESS; } @@ -336,7 +337,7 @@ int32_t DistributedDeviceProfileProxy::PutCharacteristicProfileBatch( return DP_WRITE_PARCEL_FAIL; } MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::PUT_CHAR_PROFILE_BATCH), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::PUT_CHAR_PROFILE_BATCH), data, reply); return DP_SUCCESS; } @@ -350,7 +351,7 @@ int32_t DistributedDeviceProfileProxy::GetDeviceProfile(const std::string& devic WRITE_HELPER(data, Bool, deviceProfile.IsMultiUser()); WRITE_HELPER(data, Int32, deviceProfile.GetUserId()); MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::GET_DEVICE_PROFILE_NEW), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::GET_DEVICE_PROFILE_NEW), data, reply); if (!deviceProfile.UnMarshalling(reply)) { HILOGE("dp ipc read parcel fail"); return DP_READ_PARCEL_FAIL; @@ -370,7 +371,7 @@ int32_t DistributedDeviceProfileProxy::GetDeviceProfiles(DeviceProfileFilterOpti return DP_WRITE_PARCEL_FAIL; } MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::GET_DEVICE_PROFILES), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::GET_DEVICE_PROFILES), data, reply); if (!IpcUtils::UnMarshalling(reply, deviceProfiles)) { HILOGE("dp ipc read parcel fail"); return DP_READ_PARCEL_FAIL; @@ -389,7 +390,7 @@ int32_t DistributedDeviceProfileProxy::DeleteDeviceProfileBatch(std::vector(DPInterfaceCode::DELETE_DEVICE_PROFILE_BATCH), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::DELETE_DEVICE_PROFILE_BATCH), data, reply); return DP_SUCCESS; } @@ -405,7 +406,7 @@ int32_t DistributedDeviceProfileProxy::GetServiceProfile(const std::string& devi WRITE_HELPER(data, Bool, serviceProfile.IsMultiUser()); WRITE_HELPER(data, Int32, serviceProfile.GetUserId()); MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::GET_SERVICE_PROFILE), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::GET_SERVICE_PROFILE), data, reply); if (!serviceProfile.UnMarshalling(reply)) { HILOGE("dp ipc read parcel fail"); return DP_READ_PARCEL_FAIL; @@ -424,7 +425,7 @@ int32_t DistributedDeviceProfileProxy::PutServiceInfoProfile(const ServiceInfoPr return DP_WRITE_PARCEL_FAIL; } MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::PUT_SERVICE_INFO_PROFILE), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::PUT_SERVICE_INFO_PROFILE), data, reply); return DP_SUCCESS; } @@ -439,7 +440,7 @@ int32_t DistributedDeviceProfileProxy::DeleteServiceInfoProfile(const ServiceInf return DP_WRITE_PARCEL_FAIL; } MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::DELETE_SERVICE_INFO_PROFILE), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::DELETE_SERVICE_INFO_PROFILE), data, reply); return DP_SUCCESS; } @@ -454,7 +455,7 @@ int32_t DistributedDeviceProfileProxy::UpdateServiceInfoProfile(const ServiceInf return DP_WRITE_PARCEL_FAIL; } MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::UPDATE_SERVICE_INFO_PROFILE), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::UPDATE_SERVICE_INFO_PROFILE), data, reply); return DP_SUCCESS; } @@ -470,7 +471,8 @@ int32_t DistributedDeviceProfileProxy::GetServiceInfoProfileByUniqueKey(const Se return DP_WRITE_PARCEL_FAIL; } MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::GET_SERVICE_INFO_PROFILE_BY_UNIQUE_KEY), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::GET_SERVICE_INFO_PROFILE_BY_UNIQUE_KEY), + data, reply); if (!serviceInfoProfile.UnMarshalling(reply)) { HILOGE("dp ipc read parcel fail"); return DP_READ_PARCEL_FAIL; @@ -490,7 +492,7 @@ int32_t DistributedDeviceProfileProxy::GetServiceInfoProfileListByTokenId(const return DP_WRITE_PARCEL_FAIL; } MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::GET_SERVICE_INFO_PROFILE_LIST_BY_TOKEN_ID), + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::GET_SERVICE_INFO_PROFILE_LIST_BY_TOKEN_ID), data, reply); if (!IpcUtils::UnMarshalling(reply, serviceInfoProfiles)) { HILOGE("dp ipc read parcel fail"); @@ -507,7 +509,7 @@ int32_t DistributedDeviceProfileProxy::GetAllServiceInfoProfileList( MessageParcel data; WRITE_INTERFACE_TOKEN(data); MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::GET_ALL_SERVICE_INFO_PROFILE_LIST), + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::GET_ALL_SERVICE_INFO_PROFILE_LIST), data, reply); if (!IpcUtils::UnMarshalling(reply, serviceInfoProfiles)) { HILOGE("dp ipc read parcel fail"); @@ -528,7 +530,7 @@ int32_t DistributedDeviceProfileProxy::GetServiceInfoProfileListByBundleName(con return DP_WRITE_PARCEL_FAIL; } MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::GET_SERVICE_INFO_PROFILE_LIST_BY_BUNDLE_NAME), + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::GET_SERVICE_INFO_PROFILE_LIST_BY_BUNDLE_NAME), data, reply); if (!IpcUtils::UnMarshalling(reply, serviceInfoProfiles)) { HILOGE("dp ipc read parcel fail"); @@ -550,7 +552,7 @@ int32_t DistributedDeviceProfileProxy::GetCharacteristicProfile(const std::strin WRITE_HELPER(data, Bool, charProfile.IsMultiUser()); WRITE_HELPER(data, Int32, charProfile.GetUserId()); MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::GET_CHAR_PROFILE), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::GET_CHAR_PROFILE), data, reply); if (!charProfile.UnMarshalling(reply)) { HILOGE("dp ipc read parcel fail"); return DP_READ_PARCEL_FAIL; @@ -570,7 +572,7 @@ int32_t DistributedDeviceProfileProxy::DeleteServiceProfile(const std::string& d WRITE_HELPER(data, Bool, isMultiUser); WRITE_HELPER(data, Int32, userId); MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::DEL_SERVICE_PROFILE), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::DEL_SERVICE_PROFILE), data, reply); return DP_SUCCESS; } @@ -587,7 +589,7 @@ int32_t DistributedDeviceProfileProxy::DeleteCharacteristicProfile(const std::st WRITE_HELPER(data, Bool, isMultiUser); WRITE_HELPER(data, Int32, userId); MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::DEL_CHAR_PROFILE), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::DEL_CHAR_PROFILE), data, reply); return DP_SUCCESS; } @@ -602,7 +604,7 @@ int32_t DistributedDeviceProfileProxy::SubscribeDeviceProfile(const SubscribeInf return DP_WRITE_PARCEL_FAIL; } MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::SUBSCRIBE_DEVICE_PROFILE), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::SUBSCRIBE_DEVICE_PROFILE), data, reply); return DP_SUCCESS; } @@ -617,7 +619,7 @@ int32_t DistributedDeviceProfileProxy::UnSubscribeDeviceProfile(const SubscribeI return DP_WRITE_PARCEL_FAIL; } MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::UNSUBSCRIBE_DEVICE_PROFILE), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::UNSUBSCRIBE_DEVICE_PROFILE), data, reply); return DP_SUCCESS; } @@ -634,7 +636,7 @@ int32_t DistributedDeviceProfileProxy::SyncDeviceProfile(const DpSyncOptions& sy } WRITE_HELPER(data, RemoteObject, syncCompletedCallback); MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::SYNC_DEVICE_PROFILE_NEW), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::SYNC_DEVICE_PROFILE_NEW), data, reply); return DP_SUCCESS; } @@ -651,7 +653,7 @@ int32_t DistributedDeviceProfileProxy::SyncStaticProfile(const DpSyncOptions& sy } WRITE_HELPER(data, RemoteObject, syncCompletedCallback); MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::SYNC_STATIC_PROFILE), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::SYNC_STATIC_PROFILE), data, reply); return DP_SUCCESS; } @@ -666,7 +668,7 @@ int32_t DistributedDeviceProfileProxy::SendSubscribeInfos(std::map(DPInterfaceCode::SEND_SUBSCRIBE_INFOS), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::SEND_SUBSCRIBE_INFOS), data, reply); return DP_SUCCESS; } @@ -679,7 +681,7 @@ int32_t DistributedDeviceProfileProxy::SubscribeDeviceProfileInited(int32_t saId WRITE_HELPER(data, Int32, saId); WRITE_HELPER(data, RemoteObject, dpInitedCallback); MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::SUBSCRIBE_DEVICE_PROFILE_INITED), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::SUBSCRIBE_DEVICE_PROFILE_INITED), data, reply); return DP_SUCCESS; } @@ -691,7 +693,7 @@ int32_t OHOS::DistributedDeviceProfile::DistributedDeviceProfileProxy::UnSubscri WRITE_INTERFACE_TOKEN(data); WRITE_HELPER(data, Int32, saId); MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::UNSUBSCRIBE_DEVICE_PROFILE_INITED), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::UNSUBSCRIBE_DEVICE_PROFILE_INITED), data, reply); return DP_SUCCESS; } @@ -706,7 +708,7 @@ int32_t OHOS::DistributedDeviceProfile::DistributedDeviceProfileProxy::Subscribe WRITE_HELPER(data, Int32, pinExchangeType); WRITE_HELPER(data, RemoteObject, pinCodeCallback); MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::SUBSCRIBE_PINCODE_INVALID), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::SUBSCRIBE_PINCODE_INVALID), data, reply); return DP_SUCCESS; } @@ -720,7 +722,7 @@ int32_t OHOS::DistributedDeviceProfile::DistributedDeviceProfileProxy::UnSubscri WRITE_HELPER(data, String, bundleName); WRITE_HELPER(data, Int32, pinExchangeType); MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::UNSUBSCRIBE_PINCODE_INVALID), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::UNSUBSCRIBE_PINCODE_INVALID), data, reply); return DP_SUCCESS; } @@ -736,7 +738,7 @@ int32_t OHOS::DistributedDeviceProfile::DistributedDeviceProfileProxy::PutAllTru return DP_WRITE_PARCEL_FAIL; } MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::PUT_ALL_TRUSTED_DEVICES), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::PUT_ALL_TRUSTED_DEVICES), data, reply); return DP_SUCCESS; } @@ -751,7 +753,7 @@ int32_t DistributedDeviceProfileProxy::PutLocalServiceInfo(const LocalServiceInf return DP_WRITE_PARCEL_FAIL; } MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::PUT_LOCAL_SERVICE_INFO), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::PUT_LOCAL_SERVICE_INFO), data, reply); return DP_SUCCESS; } @@ -766,7 +768,7 @@ int32_t DistributedDeviceProfileProxy::UpdateLocalServiceInfo(const LocalService return DP_WRITE_PARCEL_FAIL; } MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::UPDATE_LOCAL_SERVICE_INFO), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::UPDATE_LOCAL_SERVICE_INFO), data, reply); return DP_SUCCESS; } @@ -781,7 +783,7 @@ int32_t DistributedDeviceProfileProxy::GetLocalServiceInfoByBundleAndPinType(con WRITE_HELPER(data, Int32, pinExchangeType); MessageParcel reply; SEND_REQUEST(remote, - static_cast(DPInterfaceCode::GET_LOCAL_SERVICE_INFO_BY_BINDLE_AND_PINTYPE), data, reply); + static_cast(DpIpcInterfaceCode::GET_LOCAL_SERVICE_INFO_BY_BINDLE_AND_PINTYPE), data, reply); if (!localServiceInfo.UnMarshalling(reply)) { HILOGE("dp ipc read parcel fail"); return DP_READ_PARCEL_FAIL; @@ -799,7 +801,7 @@ int32_t DistributedDeviceProfileProxy::DeleteLocalServiceInfo(const std::string& WRITE_HELPER(data, Int32, pinExchangeType); MessageParcel reply; SEND_REQUEST(remote, - static_cast(DPInterfaceCode::DELETE_LOCAL_SERVICE_INFO), data, reply); + static_cast(DpIpcInterfaceCode::DELETE_LOCAL_SERVICE_INFO), data, reply); return DP_SUCCESS; } @@ -814,7 +816,7 @@ int32_t DistributedDeviceProfileProxy::RegisterBusinessCallback(const std::strin WRITE_HELPER(data, String, businessKey); WRITE_HELPER(data, RemoteObject, businessCallback); MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::REGISTER_BUSINESS_CALLBACK), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::REGISTER_BUSINESS_CALLBACK), data, reply); return DP_SUCCESS; } @@ -828,7 +830,7 @@ int32_t DistributedDeviceProfileProxy::UnRegisterBusinessCallback(const std::str WRITE_HELPER(data, String, saId); WRITE_HELPER(data, String, businessKey); MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::UNREGISTER_BUSINESS_CALLBACK), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::UNREGISTER_BUSINESS_CALLBACK), data, reply); return DP_SUCCESS; } @@ -843,7 +845,7 @@ int32_t DistributedDeviceProfileProxy::PutBusinessEvent(const BusinessEvent& eve return DP_WRITE_PARCEL_FAIL; } MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::PUT_BUSINESS_EVENT), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::PUT_BUSINESS_EVENT), data, reply); return DP_SUCCESS; } @@ -858,7 +860,7 @@ int32_t DistributedDeviceProfileProxy::GetBusinessEvent(BusinessEvent& event) return DP_WRITE_PARCEL_FAIL; } MessageParcel reply; - SEND_REQUEST(remote, static_cast(DPInterfaceCode::GET_BUSINESS_EVENT), data, reply); + SEND_REQUEST(remote, static_cast(DpIpcInterfaceCode::GET_BUSINESS_EVENT), data, reply); if (!event.UnMarshalling(reply)) { HILOGE("dp ipc read parcel fail"); return DP_READ_PARCEL_FAIL; diff --git a/services/core/src/distributed_device_profile_stub_new.cpp b/services/core/src/distributed_device_profile_stub_new.cpp index cc2b600ec5932cfba3f4048571576eb6b0e1b23f..f67b9a8c757bfd0910d0502bd52bf48592c7760b 100644 --- a/services/core/src/distributed_device_profile_stub_new.cpp +++ b/services/core/src/distributed_device_profile_stub_new.cpp @@ -24,6 +24,7 @@ #include "distributed_device_profile_errors.h" #include "distributed_device_profile_log.h" #include "distributed_device_profile_service_new.h" +#include "dp_ipc_interface_code.h" #include "profile_utils.h" namespace OHOS { @@ -39,36 +40,36 @@ DistributedDeviceProfileStubNew::DistributedDeviceProfileStubNew() void DistributedDeviceProfileStubNew::InitAclAndSubscribe() { - aclAndSubscribeFuncs_.insert(static_cast(DPInterfaceCode::PUT_ACL_PROFILE)); - aclAndSubscribeFuncs_.insert(static_cast(DPInterfaceCode::UPDATE_ACL_PROFILE)); - aclAndSubscribeFuncs_.insert(static_cast(DPInterfaceCode::GET_TRUST_DEVICE_PROFILE)); - aclAndSubscribeFuncs_.insert(static_cast(DPInterfaceCode::GET_ALL_TRUST_DEVICE_PROFILE)); - aclAndSubscribeFuncs_.insert(static_cast(DPInterfaceCode::GET_ACL_PROFILE)); - aclAndSubscribeFuncs_.insert(static_cast(DPInterfaceCode::GET_ALL_ACL_PROFILE)); - aclAndSubscribeFuncs_.insert(static_cast(DPInterfaceCode::GET_ALL_ACL_INCLUDE_LNN_ACL)); - aclAndSubscribeFuncs_.insert(static_cast(DPInterfaceCode::DELETE_ACL_PROFILE)); - aclAndSubscribeFuncs_.insert(static_cast(DPInterfaceCode::SUBSCRIBE_DEVICE_PROFILE)); - aclAndSubscribeFuncs_.insert(static_cast(DPInterfaceCode::UNSUBSCRIBE_DEVICE_PROFILE)); - aclAndSubscribeFuncs_.insert(static_cast(DPInterfaceCode::SEND_SUBSCRIBE_INFOS)); - aclAndSubscribeFuncs_.insert(static_cast(DPInterfaceCode::PUT_SERVICE_PROFILE)); - aclAndSubscribeFuncs_.insert(static_cast(DPInterfaceCode::PUT_SERVICE_PROFILE_BATCH)); - aclAndSubscribeFuncs_.insert(static_cast(DPInterfaceCode::PUT_CHAR_PROFILE)); - aclAndSubscribeFuncs_.insert(static_cast(DPInterfaceCode::PUT_CHAR_PROFILE_BATCH)); - aclAndSubscribeFuncs_.insert(static_cast(DPInterfaceCode::SUBSCRIBE_DEVICE_PROFILE_INITED)); - aclAndSubscribeFuncs_.insert(static_cast(DPInterfaceCode::UNSUBSCRIBE_DEVICE_PROFILE_INITED)); - aclAndSubscribeFuncs_.insert(static_cast(DPInterfaceCode::PUT_ALL_TRUSTED_DEVICES)); - aclAndSubscribeFuncs_.insert(static_cast(DPInterfaceCode::PUT_DEVICE_PROFILE_BATCH)); - aclAndSubscribeFuncs_.insert(static_cast(DPInterfaceCode::GET_DEVICE_PROFILES)); - aclAndSubscribeFuncs_.insert(static_cast(DPInterfaceCode::DELETE_DEVICE_PROFILE_BATCH)); - aclAndSubscribeFuncs_.insert(static_cast(DPInterfaceCode::GET_DEVICE_ICON_INFOS)); - aclAndSubscribeFuncs_.insert(static_cast(DPInterfaceCode::PUT_DEVICE_ICON_INFO_BATCH)); - aclAndSubscribeFuncs_.insert(static_cast(DPInterfaceCode::PUT_PRODUCT_INFO_BATCH)); - aclAndSubscribeFuncs_.insert(static_cast(DPInterfaceCode::PUT_SESSION_KEY)); - aclAndSubscribeFuncs_.insert(static_cast(DPInterfaceCode::GET_SESSION_KEY)); - aclAndSubscribeFuncs_.insert(static_cast(DPInterfaceCode::UPDATE_SESSION_KEY)); - aclAndSubscribeFuncs_.insert(static_cast(DPInterfaceCode::DELETE_SESSION_KEY)); - aclAndSubscribeFuncs_.insert(static_cast(DPInterfaceCode::SUBSCRIBE_PINCODE_INVALID)); - aclAndSubscribeFuncs_.insert(static_cast(DPInterfaceCode::UNSUBSCRIBE_PINCODE_INVALID)); + aclAndSubscribeFuncs_.insert(static_cast(DpIpcInterfaceCode::PUT_ACL_PROFILE)); + aclAndSubscribeFuncs_.insert(static_cast(DpIpcInterfaceCode::UPDATE_ACL_PROFILE)); + aclAndSubscribeFuncs_.insert(static_cast(DpIpcInterfaceCode::GET_TRUST_DEVICE_PROFILE)); + aclAndSubscribeFuncs_.insert(static_cast(DpIpcInterfaceCode::GET_ALL_TRUST_DEVICE_PROFILE)); + aclAndSubscribeFuncs_.insert(static_cast(DpIpcInterfaceCode::GET_ACL_PROFILE)); + aclAndSubscribeFuncs_.insert(static_cast(DpIpcInterfaceCode::GET_ALL_ACL_PROFILE)); + aclAndSubscribeFuncs_.insert(static_cast(DpIpcInterfaceCode::GET_ALL_ACL_INCLUDE_LNN_ACL)); + aclAndSubscribeFuncs_.insert(static_cast(DpIpcInterfaceCode::DELETE_ACL_PROFILE)); + aclAndSubscribeFuncs_.insert(static_cast(DpIpcInterfaceCode::SUBSCRIBE_DEVICE_PROFILE)); + aclAndSubscribeFuncs_.insert(static_cast(DpIpcInterfaceCode::UNSUBSCRIBE_DEVICE_PROFILE)); + aclAndSubscribeFuncs_.insert(static_cast(DpIpcInterfaceCode::SEND_SUBSCRIBE_INFOS)); + aclAndSubscribeFuncs_.insert(static_cast(DpIpcInterfaceCode::PUT_SERVICE_PROFILE)); + aclAndSubscribeFuncs_.insert(static_cast(DpIpcInterfaceCode::PUT_SERVICE_PROFILE_BATCH)); + aclAndSubscribeFuncs_.insert(static_cast(DpIpcInterfaceCode::PUT_CHAR_PROFILE)); + aclAndSubscribeFuncs_.insert(static_cast(DpIpcInterfaceCode::PUT_CHAR_PROFILE_BATCH)); + aclAndSubscribeFuncs_.insert(static_cast(DpIpcInterfaceCode::SUBSCRIBE_DEVICE_PROFILE_INITED)); + aclAndSubscribeFuncs_.insert(static_cast(DpIpcInterfaceCode::UNSUBSCRIBE_DEVICE_PROFILE_INITED)); + aclAndSubscribeFuncs_.insert(static_cast(DpIpcInterfaceCode::PUT_ALL_TRUSTED_DEVICES)); + aclAndSubscribeFuncs_.insert(static_cast(DpIpcInterfaceCode::PUT_DEVICE_PROFILE_BATCH)); + aclAndSubscribeFuncs_.insert(static_cast(DpIpcInterfaceCode::GET_DEVICE_PROFILES)); + aclAndSubscribeFuncs_.insert(static_cast(DpIpcInterfaceCode::DELETE_DEVICE_PROFILE_BATCH)); + aclAndSubscribeFuncs_.insert(static_cast(DpIpcInterfaceCode::GET_DEVICE_ICON_INFOS)); + aclAndSubscribeFuncs_.insert(static_cast(DpIpcInterfaceCode::PUT_DEVICE_ICON_INFO_BATCH)); + aclAndSubscribeFuncs_.insert(static_cast(DpIpcInterfaceCode::PUT_PRODUCT_INFO_BATCH)); + aclAndSubscribeFuncs_.insert(static_cast(DpIpcInterfaceCode::PUT_SESSION_KEY)); + aclAndSubscribeFuncs_.insert(static_cast(DpIpcInterfaceCode::GET_SESSION_KEY)); + aclAndSubscribeFuncs_.insert(static_cast(DpIpcInterfaceCode::UPDATE_SESSION_KEY)); + aclAndSubscribeFuncs_.insert(static_cast(DpIpcInterfaceCode::DELETE_SESSION_KEY)); + aclAndSubscribeFuncs_.insert(static_cast(DpIpcInterfaceCode::SUBSCRIBE_PINCODE_INVALID)); + aclAndSubscribeFuncs_.insert(static_cast(DpIpcInterfaceCode::UNSUBSCRIBE_PINCODE_INVALID)); } DistributedDeviceProfileStubNew::~DistributedDeviceProfileStubNew() @@ -86,29 +87,29 @@ int32_t DistributedDeviceProfileStubNew::NotifyAclEventInner(uint32_t code, Mess MessageParcel& reply, MessageOption& option) { switch (code) { - case static_cast(DPInterfaceCode::PUT_ACL_PROFILE): + case static_cast(DpIpcInterfaceCode::PUT_ACL_PROFILE): return PutAccessControlProfileInner(data, reply); - case static_cast(DPInterfaceCode::UPDATE_ACL_PROFILE): + case static_cast(DpIpcInterfaceCode::UPDATE_ACL_PROFILE): return UpdateAccessControlProfileInner(data, reply); - case static_cast(DPInterfaceCode::GET_TRUST_DEVICE_PROFILE): + case static_cast(DpIpcInterfaceCode::GET_TRUST_DEVICE_PROFILE): return GetTrustDeviceProfileInner(data, reply); - case static_cast(DPInterfaceCode::GET_ALL_TRUST_DEVICE_PROFILE): + case static_cast(DpIpcInterfaceCode::GET_ALL_TRUST_DEVICE_PROFILE): return GetAllTrustDeviceProfileInner(data, reply); - case static_cast(DPInterfaceCode::GET_ACL_PROFILE): + case static_cast(DpIpcInterfaceCode::GET_ACL_PROFILE): return GetAccessControlProfileInner(data, reply); - case static_cast(DPInterfaceCode::GET_ALL_ACL_PROFILE): + case static_cast(DpIpcInterfaceCode::GET_ALL_ACL_PROFILE): return GetAllAccessControlProfileInner(data, reply); - case static_cast(DPInterfaceCode::GET_ALL_ACL_INCLUDE_LNN_ACL): + case static_cast(DpIpcInterfaceCode::GET_ALL_ACL_INCLUDE_LNN_ACL): return GetAllAclIncludeLnnAclInner(data, reply); - case static_cast(DPInterfaceCode::DELETE_ACL_PROFILE): + case static_cast(DpIpcInterfaceCode::DELETE_ACL_PROFILE): return DeleteAccessControlProfileInner(data, reply); - case static_cast(DPInterfaceCode::PUT_SESSION_KEY): + case static_cast(DpIpcInterfaceCode::PUT_SESSION_KEY): return PutSessionKeyInner(data, reply); - case static_cast(DPInterfaceCode::GET_SESSION_KEY): + case static_cast(DpIpcInterfaceCode::GET_SESSION_KEY): return GetSessionKeyInner(data, reply); - case static_cast(DPInterfaceCode::UPDATE_SESSION_KEY): + case static_cast(DpIpcInterfaceCode::UPDATE_SESSION_KEY): return UpdateSessionKeyInner(data, reply); - case static_cast(DPInterfaceCode::DELETE_SESSION_KEY): + case static_cast(DpIpcInterfaceCode::DELETE_SESSION_KEY): return DeleteSessionKeyInner(data, reply); default: return NotifyProfileDataEventInner(code, data, reply, option); @@ -119,41 +120,41 @@ int32_t DistributedDeviceProfileStubNew::NotifyProfileDataEventInner( uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) { switch (code) { - case static_cast(DPInterfaceCode::SUBSCRIBE_DEVICE_PROFILE): + case static_cast(DpIpcInterfaceCode::SUBSCRIBE_DEVICE_PROFILE): return SubscribeDeviceProfileInner(data, reply); - case static_cast(DPInterfaceCode::UNSUBSCRIBE_DEVICE_PROFILE): + case static_cast(DpIpcInterfaceCode::UNSUBSCRIBE_DEVICE_PROFILE): return UnSubscribeDeviceProfileInner(data, reply); - case static_cast(DPInterfaceCode::SEND_SUBSCRIBE_INFOS): + case static_cast(DpIpcInterfaceCode::SEND_SUBSCRIBE_INFOS): return SendSubscribeInfosInner(data, reply); - case static_cast(DPInterfaceCode::PUT_SERVICE_PROFILE): + case static_cast(DpIpcInterfaceCode::PUT_SERVICE_PROFILE): return PutServiceProfileInner(data, reply); - case static_cast(DPInterfaceCode::PUT_SERVICE_PROFILE_BATCH): + case static_cast(DpIpcInterfaceCode::PUT_SERVICE_PROFILE_BATCH): return PutServiceProfileBatchInner(data, reply); - case static_cast(DPInterfaceCode::PUT_CHAR_PROFILE): + case static_cast(DpIpcInterfaceCode::PUT_CHAR_PROFILE): return PutCharacteristicProfileInner(data, reply); - case static_cast(DPInterfaceCode::PUT_CHAR_PROFILE_BATCH): + case static_cast(DpIpcInterfaceCode::PUT_CHAR_PROFILE_BATCH): return PutCharacteristicProfileBatchInner(data, reply); - case static_cast(DPInterfaceCode::SUBSCRIBE_DEVICE_PROFILE_INITED): + case static_cast(DpIpcInterfaceCode::SUBSCRIBE_DEVICE_PROFILE_INITED): return SubscribeDeviceProfileInitedInner(data, reply); - case static_cast(DPInterfaceCode::UNSUBSCRIBE_DEVICE_PROFILE_INITED): + case static_cast(DpIpcInterfaceCode::UNSUBSCRIBE_DEVICE_PROFILE_INITED): return UnSubscribeDeviceProfileInitedInner(data, reply); - case static_cast(DPInterfaceCode::PUT_ALL_TRUSTED_DEVICES): + case static_cast(DpIpcInterfaceCode::PUT_ALL_TRUSTED_DEVICES): return PutAllTrustedDevicesInner(data, reply); - case static_cast(DPInterfaceCode::PUT_DEVICE_PROFILE_BATCH): + case static_cast(DpIpcInterfaceCode::PUT_DEVICE_PROFILE_BATCH): return PutDeviceProfileBatchInner(data, reply); - case static_cast(DPInterfaceCode::GET_DEVICE_PROFILES): + case static_cast(DpIpcInterfaceCode::GET_DEVICE_PROFILES): return GetDeviceProfilesInner(data, reply); - case static_cast(DPInterfaceCode::GET_DEVICE_ICON_INFOS): + case static_cast(DpIpcInterfaceCode::GET_DEVICE_ICON_INFOS): return GetDeviceIconInfosInner(data, reply); - case static_cast(DPInterfaceCode::PUT_DEVICE_ICON_INFO_BATCH): + case static_cast(DpIpcInterfaceCode::PUT_DEVICE_ICON_INFO_BATCH): return PutDeviceIconInfoBatchInner(data, reply); - case static_cast(DPInterfaceCode::PUT_PRODUCT_INFO_BATCH): + case static_cast(DpIpcInterfaceCode::PUT_PRODUCT_INFO_BATCH): return PutProductInfoBatchInner(data, reply); - case static_cast(DPInterfaceCode::DELETE_DEVICE_PROFILE_BATCH): + case static_cast(DpIpcInterfaceCode::DELETE_DEVICE_PROFILE_BATCH): return DeleteDeviceProfileBatchInner(data, reply); - case static_cast(DPInterfaceCode::SUBSCRIBE_PINCODE_INVALID): + case static_cast(DpIpcInterfaceCode::SUBSCRIBE_PINCODE_INVALID): return SubscribePinCodeInvalidInner(data, reply); - case static_cast(DPInterfaceCode::UNSUBSCRIBE_PINCODE_INVALID): + case static_cast(DpIpcInterfaceCode::UNSUBSCRIBE_PINCODE_INVALID): return UnSubscribePinCodeInvalidInner(data, reply); default: HILOGE("unknown request code, please check, code = %{public}u", code); @@ -165,33 +166,33 @@ int32_t DistributedDeviceProfileStubNew::NotifyEventInner(uint32_t code, Message MessageParcel& reply, MessageOption& option) { switch (code) { - case static_cast(DPInterfaceCode::GET_DEVICE_PROFILE_NEW): + case static_cast(DpIpcInterfaceCode::GET_DEVICE_PROFILE_NEW): return GetDeviceProfileInner(data, reply); - case static_cast(DPInterfaceCode::GET_SERVICE_PROFILE): + case static_cast(DpIpcInterfaceCode::GET_SERVICE_PROFILE): return GetServiceProfileInner(data, reply); - case static_cast(DPInterfaceCode::GET_CHAR_PROFILE): + case static_cast(DpIpcInterfaceCode::GET_CHAR_PROFILE): return GetCharacteristicProfileInner(data, reply); - case static_cast(DPInterfaceCode::DEL_SERVICE_PROFILE): + case static_cast(DpIpcInterfaceCode::DEL_SERVICE_PROFILE): return DeleteServiceProfileInner(data, reply); - case static_cast(DPInterfaceCode::DEL_CHAR_PROFILE): + case static_cast(DpIpcInterfaceCode::DEL_CHAR_PROFILE): return DeleteCharacteristicProfileInner(data, reply); - case static_cast(DPInterfaceCode::SYNC_DEVICE_PROFILE_NEW): + case static_cast(DpIpcInterfaceCode::SYNC_DEVICE_PROFILE_NEW): return SyncDeviceProfileInner(data, reply); - case static_cast(DPInterfaceCode::SYNC_STATIC_PROFILE): + case static_cast(DpIpcInterfaceCode::SYNC_STATIC_PROFILE): return SyncStaticProfileInner(data, reply); - case static_cast(DPInterfaceCode::PUT_SERVICE_INFO_PROFILE): + case static_cast(DpIpcInterfaceCode::PUT_SERVICE_INFO_PROFILE): return PutServiceInfoProfileInner(data, reply); - case static_cast(DPInterfaceCode::DELETE_SERVICE_INFO_PROFILE): + case static_cast(DpIpcInterfaceCode::DELETE_SERVICE_INFO_PROFILE): return DeleteServiceInfoProfileInner(data, reply); - case static_cast(DPInterfaceCode::UPDATE_SERVICE_INFO_PROFILE): + case static_cast(DpIpcInterfaceCode::UPDATE_SERVICE_INFO_PROFILE): return UpdateServiceInfoProfileInner(data, reply); - case static_cast(DPInterfaceCode::GET_SERVICE_INFO_PROFILE_BY_UNIQUE_KEY): + case static_cast(DpIpcInterfaceCode::GET_SERVICE_INFO_PROFILE_BY_UNIQUE_KEY): return GetServiceInfoProfileByUniqueKeyInner(data, reply); - case static_cast(DPInterfaceCode::GET_SERVICE_INFO_PROFILE_LIST_BY_TOKEN_ID): + case static_cast(DpIpcInterfaceCode::GET_SERVICE_INFO_PROFILE_LIST_BY_TOKEN_ID): return GetServiceInfoProfileListByTokenIdInner(data, reply); - case static_cast(DPInterfaceCode::GET_ALL_SERVICE_INFO_PROFILE_LIST): + case static_cast(DpIpcInterfaceCode::GET_ALL_SERVICE_INFO_PROFILE_LIST): return GetAllServiceInfoProfileListInner(data, reply); - case static_cast(DPInterfaceCode::GET_SERVICE_INFO_PROFILE_LIST_BY_BUNDLE_NAME): + case static_cast(DpIpcInterfaceCode::GET_SERVICE_INFO_PROFILE_LIST_BY_BUNDLE_NAME): return GetServiceInfoProfileListByBundleNameInner(data, reply); default: return NotifyLocalServiceEventInner(code, data, reply, option); @@ -202,21 +203,21 @@ int32_t DistributedDeviceProfileStubNew::NotifyLocalServiceEventInner(uint32_t c MessageParcel& reply, MessageOption& option) { switch (code) { - case static_cast(DPInterfaceCode::PUT_LOCAL_SERVICE_INFO): + case static_cast(DpIpcInterfaceCode::PUT_LOCAL_SERVICE_INFO): return PutLocalServiceInfoInner(data, reply); - case static_cast(DPInterfaceCode::UPDATE_LOCAL_SERVICE_INFO): + case static_cast(DpIpcInterfaceCode::UPDATE_LOCAL_SERVICE_INFO): return UpdateLocalServiceInfoInner(data, reply); - case static_cast(DPInterfaceCode::GET_LOCAL_SERVICE_INFO_BY_BINDLE_AND_PINTYPE): + case static_cast(DpIpcInterfaceCode::GET_LOCAL_SERVICE_INFO_BY_BINDLE_AND_PINTYPE): return GetLocalServiceInfoByBundleAndPinTypeInner(data, reply); - case static_cast(DPInterfaceCode::DELETE_LOCAL_SERVICE_INFO): + case static_cast(DpIpcInterfaceCode::DELETE_LOCAL_SERVICE_INFO): return DeleteLocalServiceInfoInner(data, reply); - case static_cast(DPInterfaceCode::REGISTER_BUSINESS_CALLBACK): + case static_cast(DpIpcInterfaceCode::REGISTER_BUSINESS_CALLBACK): return RegisterBusinessCallbackInner(data, reply); - case static_cast(DPInterfaceCode::UNREGISTER_BUSINESS_CALLBACK): + case static_cast(DpIpcInterfaceCode::UNREGISTER_BUSINESS_CALLBACK): return UnRegisterBusinessCallbackInner(data, reply); - case static_cast(DPInterfaceCode::PUT_BUSINESS_EVENT): + case static_cast(DpIpcInterfaceCode::PUT_BUSINESS_EVENT): return PutBusinessEventInner(data, reply); - case static_cast(DPInterfaceCode::GET_BUSINESS_EVENT): + case static_cast(DpIpcInterfaceCode::GET_BUSINESS_EVENT): return GetBusinessEventInner(data, reply); default: HILOGW("unknown request code, please check, code = %{public}u", code); diff --git a/services/core/test/fuzztest/newdeviceprofile_fuzzer/new_device_profile_fuzzer.cpp b/services/core/test/fuzztest/newdeviceprofile_fuzzer/new_device_profile_fuzzer.cpp index 56b9834367d01eeb2acfb38d27b8eb39521a9391..70fe241dd724bc09d13eefc544876ae78d4671fe 100644 --- a/services/core/test/fuzztest/newdeviceprofile_fuzzer/new_device_profile_fuzzer.cpp +++ b/services/core/test/fuzztest/newdeviceprofile_fuzzer/new_device_profile_fuzzer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Huawei Device Co., Ltd. + * Copyright (c) 2024-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -30,6 +30,7 @@ #include "distributed_device_profile_enums.h" #include "distributed_device_profile_service_new.h" +#include "dp_ipc_interface_code.h" namespace OHOS { namespace DistributedDeviceProfile { namespace { @@ -96,7 +97,7 @@ void FuzzDeviceProfile(const uint8_t* rawData, size_t size) DistributedDeviceProfileServiceNew::GetInstance().Init(); g_flag = true; } - code = code % static_cast(DPInterfaceCode::MAX) + 1; + code = code % static_cast(DpIpcInterfaceCode::MAX) + 1; if (code < MIN_INTERFACE_CODE) { code += MIN_INTERFACE_CODE; } diff --git a/services/core/test/unittest/distributed_device_profile_client_kv_test.cpp b/services/core/test/unittest/distributed_device_profile_client_kv_test.cpp index cd587ebb6daec2986bea051d0dacc133e4af5289..a46277e740265d46921029147b0dcd99e336b04b 100644 --- a/services/core/test/unittest/distributed_device_profile_client_kv_test.cpp +++ b/services/core/test/unittest/distributed_device_profile_client_kv_test.cpp @@ -20,19 +20,20 @@ #include "gtest/gtest.h" #include "refbase.h" #include "business_callback_stub.h" +#include "characteristic_profile.h" +#include "device_profile.h" +#include "distributed_device_profile_client.h" #include "distributed_device_profile_constants.h" +#include "distributed_device_profile_enums.h" #include "distributed_device_profile_errors.h" #include "distributed_device_profile_log.h" -#include "distributed_device_profile_enums.h" #include "dp_inited_callback_stub.h" #include "dp_inited_callback_proxy.h" -#include "device_profile.h" -#include "service_profile.h" +#include "dp_ipc_interface_code.h" #include "dp_subscribe_info.h" #include "i_sync_completed_callback.h" -#include "characteristic_profile.h" -#include "distributed_device_profile_client.h" #include "pincode_invalid_callback_stub.h" +#include "service_profile.h" #include "trusted_device_info.h" #undef private #undef protected @@ -657,7 +658,7 @@ HWTEST_F(DistributedDeviceProfileClientKvTest, DpinitedCallback001, TestSize.Lev HWTEST_F(DistributedDeviceProfileClientKvTest, OnRemoteRequest_001, TestSize.Level0) { std::shared_ptr DpinitedCallbackStub_ = std::make_shared(); - uint32_t code = static_cast(DPInterfaceCode::ON_DEVICE_PROFILE_INITED); + uint32_t code = static_cast(DpIpcInterfaceCode::ON_DEVICE_PROFILE_INITED); MessageParcel data; MessageParcel reply; MessageOption option; diff --git a/services/core/test/unittest/distributed_device_profile_stub_new_test.cpp b/services/core/test/unittest/distributed_device_profile_stub_new_test.cpp index 0a9e9549cb59d1787ed7d7e1fa7e5dc1a4872798..75c07b8b2adb8594176990ca0605a6c97f1de471 100644 --- a/services/core/test/unittest/distributed_device_profile_stub_new_test.cpp +++ b/services/core/test/unittest/distributed_device_profile_stub_new_test.cpp @@ -20,14 +20,15 @@ #include #include -#include "profile_utils.h" -#include "distributed_device_profile_constants.h" #include "distributed_device_profile_client.h" -#include "distributed_device_profile_log.h" -#include "distributed_device_profile_errors.h" +#include "distributed_device_profile_constants.h" #include "distributed_device_profile_enums.h" +#include "distributed_device_profile_errors.h" +#include "distributed_device_profile_log.h" #include "distributed_device_profile_service_new.h" #include "distributed_device_profile_stub_new.h" +#include "dp_ipc_interface_code.h" +#include "profile_utils.h" namespace OHOS { namespace DistributedDeviceProfile { @@ -514,7 +515,7 @@ HWTEST_F(DistributedDeviceProfileStubNewTest, IsInterfaceTokenValid_001, TestSiz */ HWTEST_F(DistributedDeviceProfileStubNewTest, OnRemoteRequest_001, TestSize.Level1) { - uint32_t code = static_cast(DPInterfaceCode::ON_TRUST_DEVICE_PROFILE_ADD); + uint32_t code = static_cast(DpIpcInterfaceCode::ON_TRUST_DEVICE_PROFILE_ADD); MessageParcel data; MessageParcel reply; MessageOption option; @@ -530,7 +531,7 @@ HWTEST_F(DistributedDeviceProfileStubNewTest, OnRemoteRequest_001, TestSize.Leve */ HWTEST_F(DistributedDeviceProfileStubNewTest, OnRemoteRequest_002, TestSize.Level1) { - uint32_t code = static_cast(DPInterfaceCode::PUT_ACL_PROFILE); + uint32_t code = static_cast(DpIpcInterfaceCode::PUT_ACL_PROFILE); MessageParcel data; MessageParcel reply; MessageOption option; @@ -546,7 +547,7 @@ HWTEST_F(DistributedDeviceProfileStubNewTest, OnRemoteRequest_002, TestSize.Leve */ HWTEST_F(DistributedDeviceProfileStubNewTest, OnRemoteRequest_003, TestSize.Level1) { - uint32_t code = static_cast(DPInterfaceCode::PUT_ACL_PROFILE); + uint32_t code = static_cast(DpIpcInterfaceCode::PUT_ACL_PROFILE); MessageParcel data; MessageParcel reply; MessageOption option; @@ -863,7 +864,7 @@ HWTEST_F(DistributedDeviceProfileStubNewTest, NotifyAclEventInner_001, TestSize. */ HWTEST_F(DistributedDeviceProfileStubNewTest, NotifyAclEventInner_002, TestSize.Level0) { - uint32_t code = static_cast(DPInterfaceCode::PUT_ACL_PROFILE); + uint32_t code = static_cast(DpIpcInterfaceCode::PUT_ACL_PROFILE); MessageParcel data; MessageParcel reply; MessageOption option; @@ -879,7 +880,7 @@ HWTEST_F(DistributedDeviceProfileStubNewTest, NotifyAclEventInner_002, TestSize. */ HWTEST_F(DistributedDeviceProfileStubNewTest, NotifyAclEventInner_003, TestSize.Level0) { - uint32_t code = static_cast(DPInterfaceCode::UPDATE_ACL_PROFILE); + uint32_t code = static_cast(DpIpcInterfaceCode::UPDATE_ACL_PROFILE); MessageParcel data; MessageParcel reply; MessageOption option; @@ -895,7 +896,7 @@ HWTEST_F(DistributedDeviceProfileStubNewTest, NotifyAclEventInner_003, TestSize. */ HWTEST_F(DistributedDeviceProfileStubNewTest, NotifyAclEventInner_004, TestSize.Level0) { - uint32_t code = static_cast(DPInterfaceCode::GET_TRUST_DEVICE_PROFILE); + uint32_t code = static_cast(DpIpcInterfaceCode::GET_TRUST_DEVICE_PROFILE); MessageParcel data; MessageParcel reply; MessageOption option; @@ -911,7 +912,7 @@ HWTEST_F(DistributedDeviceProfileStubNewTest, NotifyAclEventInner_004, TestSize. */ HWTEST_F(DistributedDeviceProfileStubNewTest, NotifyAclEventInner_005, TestSize.Level0) { - uint32_t code = static_cast(DPInterfaceCode::GET_ALL_TRUST_DEVICE_PROFILE); + uint32_t code = static_cast(DpIpcInterfaceCode::GET_ALL_TRUST_DEVICE_PROFILE); MessageParcel data; MessageParcel reply; MessageOption option; @@ -927,7 +928,7 @@ HWTEST_F(DistributedDeviceProfileStubNewTest, NotifyAclEventInner_005, TestSize. */ HWTEST_F(DistributedDeviceProfileStubNewTest, NotifyAclEventInner_006, TestSize.Level0) { - uint32_t code = static_cast(DPInterfaceCode::GET_ACL_PROFILE); + uint32_t code = static_cast(DpIpcInterfaceCode::GET_ACL_PROFILE); MessageParcel data; MessageParcel reply; MessageOption option; @@ -943,7 +944,7 @@ HWTEST_F(DistributedDeviceProfileStubNewTest, NotifyAclEventInner_006, TestSize. */ HWTEST_F(DistributedDeviceProfileStubNewTest, NotifyAclEventInner_007, TestSize.Level0) { - uint32_t code = static_cast(DPInterfaceCode::GET_ALL_ACL_PROFILE); + uint32_t code = static_cast(DpIpcInterfaceCode::GET_ALL_ACL_PROFILE); MessageParcel data; MessageParcel reply; MessageOption option; @@ -959,7 +960,7 @@ HWTEST_F(DistributedDeviceProfileStubNewTest, NotifyAclEventInner_007, TestSize. */ HWTEST_F(DistributedDeviceProfileStubNewTest, NotifyAclEventInner_008, TestSize.Level0) { - uint32_t code = static_cast(DPInterfaceCode::DELETE_ACL_PROFILE); + uint32_t code = static_cast(DpIpcInterfaceCode::DELETE_ACL_PROFILE); MessageParcel data; MessageParcel reply; MessageOption option; @@ -975,7 +976,7 @@ HWTEST_F(DistributedDeviceProfileStubNewTest, NotifyAclEventInner_008, TestSize. */ HWTEST_F(DistributedDeviceProfileStubNewTest, NotifyAclEventInner_009, TestSize.Level0) { - uint32_t code = static_cast(DPInterfaceCode::SUBSCRIBE_DEVICE_PROFILE); + uint32_t code = static_cast(DpIpcInterfaceCode::SUBSCRIBE_DEVICE_PROFILE); MessageParcel data; MessageParcel reply; MessageOption option; @@ -991,7 +992,7 @@ HWTEST_F(DistributedDeviceProfileStubNewTest, NotifyAclEventInner_009, TestSize. */ HWTEST_F(DistributedDeviceProfileStubNewTest, NotifyAclEventInner_010, TestSize.Level0) { - uint32_t code = static_cast(DPInterfaceCode::UNSUBSCRIBE_DEVICE_PROFILE); + uint32_t code = static_cast(DpIpcInterfaceCode::UNSUBSCRIBE_DEVICE_PROFILE); MessageParcel data; MessageParcel reply; MessageOption option; @@ -1007,7 +1008,7 @@ HWTEST_F(DistributedDeviceProfileStubNewTest, NotifyAclEventInner_010, TestSize. */ HWTEST_F(DistributedDeviceProfileStubNewTest, NotifyAclEventInner_011, TestSize.Level0) { - uint32_t code = static_cast(DPInterfaceCode::SEND_SUBSCRIBE_INFOS); + uint32_t code = static_cast(DpIpcInterfaceCode::SEND_SUBSCRIBE_INFOS); MessageParcel data; MessageParcel reply; MessageOption option; @@ -1023,7 +1024,7 @@ HWTEST_F(DistributedDeviceProfileStubNewTest, NotifyAclEventInner_011, TestSize. */ HWTEST_F(DistributedDeviceProfileStubNewTest, NotifyAclEventInner_012, TestSize.Level0) { - uint32_t code = static_cast(DPInterfaceCode::PUT_SERVICE_PROFILE); + uint32_t code = static_cast(DpIpcInterfaceCode::PUT_SERVICE_PROFILE); MessageParcel data; MessageParcel reply; MessageOption option; @@ -1039,7 +1040,7 @@ HWTEST_F(DistributedDeviceProfileStubNewTest, NotifyAclEventInner_012, TestSize. */ HWTEST_F(DistributedDeviceProfileStubNewTest, NotifyAclEventInner_013, TestSize.Level0) { - uint32_t code = static_cast(DPInterfaceCode::PUT_SERVICE_PROFILE_BATCH); + uint32_t code = static_cast(DpIpcInterfaceCode::PUT_SERVICE_PROFILE_BATCH); MessageParcel data; MessageParcel reply; MessageOption option; @@ -1055,7 +1056,7 @@ HWTEST_F(DistributedDeviceProfileStubNewTest, NotifyAclEventInner_013, TestSize. */ HWTEST_F(DistributedDeviceProfileStubNewTest, NotifyAclEventInner_014, TestSize.Level0) { - uint32_t code = static_cast(DPInterfaceCode::PUT_CHAR_PROFILE); + uint32_t code = static_cast(DpIpcInterfaceCode::PUT_CHAR_PROFILE); MessageParcel data; MessageParcel reply; MessageOption option; @@ -1071,7 +1072,7 @@ HWTEST_F(DistributedDeviceProfileStubNewTest, NotifyAclEventInner_014, TestSize. */ HWTEST_F(DistributedDeviceProfileStubNewTest, NotifyAclEventInner_015, TestSize.Level0) { - uint32_t code = static_cast(DPInterfaceCode::PUT_CHAR_PROFILE_BATCH); + uint32_t code = static_cast(DpIpcInterfaceCode::PUT_CHAR_PROFILE_BATCH); MessageParcel data; MessageParcel reply; MessageOption option; @@ -1087,7 +1088,7 @@ HWTEST_F(DistributedDeviceProfileStubNewTest, NotifyAclEventInner_015, TestSize. */ HWTEST_F(DistributedDeviceProfileStubNewTest, NotifyEventInner_001, TestSize.Level0) { - uint32_t code = static_cast(DPInterfaceCode::GET_DEVICE_PROFILE_NEW); + uint32_t code = static_cast(DpIpcInterfaceCode::GET_DEVICE_PROFILE_NEW); MessageParcel data; MessageParcel reply; MessageOption option; @@ -1103,7 +1104,7 @@ HWTEST_F(DistributedDeviceProfileStubNewTest, NotifyEventInner_001, TestSize.Lev */ HWTEST_F(DistributedDeviceProfileStubNewTest, NotifyEventInner_002, TestSize.Level0) { - uint32_t code = static_cast(DPInterfaceCode::GET_SERVICE_PROFILE); + uint32_t code = static_cast(DpIpcInterfaceCode::GET_SERVICE_PROFILE); MessageParcel data; MessageParcel reply; MessageOption option; @@ -1119,7 +1120,7 @@ HWTEST_F(DistributedDeviceProfileStubNewTest, NotifyEventInner_002, TestSize.Lev */ HWTEST_F(DistributedDeviceProfileStubNewTest, NotifyEventInner_003, TestSize.Level0) { - uint32_t code = static_cast(DPInterfaceCode::GET_CHAR_PROFILE); + uint32_t code = static_cast(DpIpcInterfaceCode::GET_CHAR_PROFILE); MessageParcel data; MessageParcel reply; MessageOption option; @@ -1135,7 +1136,7 @@ HWTEST_F(DistributedDeviceProfileStubNewTest, NotifyEventInner_003, TestSize.Lev */ HWTEST_F(DistributedDeviceProfileStubNewTest, NotifyEventInner_004, TestSize.Level0) { - uint32_t code = static_cast(DPInterfaceCode::DEL_SERVICE_PROFILE); + uint32_t code = static_cast(DpIpcInterfaceCode::DEL_SERVICE_PROFILE); MessageParcel data; MessageParcel reply; MessageOption option; @@ -1151,7 +1152,7 @@ HWTEST_F(DistributedDeviceProfileStubNewTest, NotifyEventInner_004, TestSize.Lev */ HWTEST_F(DistributedDeviceProfileStubNewTest, NotifyEventInner_005, TestSize.Level0) { - uint32_t code = static_cast(DPInterfaceCode::DEL_CHAR_PROFILE); + uint32_t code = static_cast(DpIpcInterfaceCode::DEL_CHAR_PROFILE); MessageParcel data; MessageParcel reply; MessageOption option; @@ -1167,7 +1168,7 @@ HWTEST_F(DistributedDeviceProfileStubNewTest, NotifyEventInner_005, TestSize.Lev */ HWTEST_F(DistributedDeviceProfileStubNewTest, NotifyEventInner_006, TestSize.Level0) { - uint32_t code = static_cast(DPInterfaceCode::SYNC_DEVICE_PROFILE_NEW); + uint32_t code = static_cast(DpIpcInterfaceCode::SYNC_DEVICE_PROFILE_NEW); MessageParcel data; MessageParcel reply; MessageOption option;