From 7026aafca9e3fb4cd1c58187b85e8ce4b5ec9f31 Mon Sep 17 00:00:00 2001 From: hwzhangchuang Date: Tue, 16 May 2023 11:18:23 +0800 Subject: [PATCH 1/6] add ipc code modify Signed-off-by: hwzhangchuang --- common/include/dinput_ipc_interface_code.h | 46 +++++++------- frameworks/include/i_distributed_sink_input.h | 9 --- .../include/i_distributed_source_input.h | 26 -------- .../include/distributed_input_source_proxy.h | 2 +- .../add_white_list_infos_call_back_proxy.cpp | 3 +- .../add_white_list_infos_call_back_stub.cpp | 5 +- .../del_white_list_infos_call_back_proxy.cpp | 3 +- .../del_white_list_infos_call_back_stub.cpp | 5 +- .../ipc/src/distributed_input_sink_proxy.cpp | 14 +++-- .../ipc/src/distributed_input_sink_stub.cpp | 19 ++++-- .../src/distributed_input_source_proxy.cpp | 60 +++++++++++-------- .../ipc/src/distributed_input_source_stub.cpp | 47 ++++++++------- .../get_sink_screen_infos_call_back_proxy.cpp | 3 +- .../get_sink_screen_infos_call_back_stub.cpp | 5 +- .../ipc/src/input_node_listener_proxy.cpp | 5 +- .../ipc/src/input_node_listener_stub.cpp | 7 ++- .../src/prepare_d_input_call_back_proxy.cpp | 3 +- .../src/prepare_d_input_call_back_stub.cpp | 5 +- .../src/register_d_input_call_back_proxy.cpp | 3 +- .../src/register_d_input_call_back_stub.cpp | 5 +- .../ipc/src/sharing_dhid_listener_proxy.cpp | 5 +- .../ipc/src/sharing_dhid_listener_stub.cpp | 7 ++- .../src/simulation_event_listener_proxy.cpp | 3 +- .../src/simulation_event_listener_stub.cpp | 5 +- .../ipc/src/start_d_input_call_back_proxy.cpp | 3 +- .../ipc/src/start_d_input_call_back_stub.cpp | 5 +- .../start_stop_d_inputs_call_back_proxy.cpp | 3 +- .../start_stop_d_inputs_call_back_stub.cpp | 5 +- .../src/start_stop_result_call_back_proxy.cpp | 5 +- .../src/start_stop_result_call_back_stub.cpp | 7 ++- .../ipc/src/stop_d_input_call_back_proxy.cpp | 3 +- .../ipc/src/stop_d_input_call_back_stub.cpp | 5 +- .../src/unprepare_d_input_call_back_proxy.cpp | 3 +- .../src/unprepare_d_input_call_back_stub.cpp | 5 +- .../unregister_d_input_call_back_proxy.cpp | 3 +- .../src/unregister_d_input_call_back_stub.cpp | 5 +- .../dinput_source_callback_unittest.cpp | 5 +- 37 files changed, 184 insertions(+), 168 deletions(-) diff --git a/common/include/dinput_ipc_interface_code.h b/common/include/dinput_ipc_interface_code.h index e503c2c..d3e1ba7 100644 --- a/common/include/dinput_ipc_interface_code.h +++ b/common/include/dinput_ipc_interface_code.h @@ -42,29 +42,29 @@ enum class IDInputSinkInterfaceCode : uint32_t { /* SAID: 4809 */ enum class IDInputSourceInterfaceCode : uint32_t { - INIT = 0xf001, - RELEASE = 0xf002, - REGISTER_REMOTE_INPUT = 0xf003, - UNREGISTER_REMOTE_INPUT = 0xf004, - PREPARE_REMOTE_INPUT = 0xf005, - UNPREPARE_REMOTE_INPUT = 0xf006, - START_REMOTE_INPUT = 0xf007, - STOP_REMOTE_INPUT = 0xf008, - PREPARE_RELAY_REMOTE_INPUT = 0xf00a, - UNPREPARE_RELAY_REMOTE_INPUT = 0xf00b, - START_RELAY_TYPE_REMOTE_INPUT = 0xf00c, - STOP_RELAY_TYPE_REMOTE_INPUT = 0xf00d, - START_DHID_REMOTE_INPUT = 0xf00e, - STOP_DHID_REMOTE_INPUT = 0xf00f, - START_RELAY_DHID_REMOTE_INPUT = 0xf010, - STOP_RELAY_DHID_REMOTE_INPUT = 0xf011, - REGISTER_ADD_WHITE_LIST_CB_REMOTE_INPUT = 0xf013, - REGISTER_DEL_WHITE_LIST_CB_REMOTE_INPUT = 0xf014, - REGISTER_NODE_LISTENER = 0xf015, - UNREGISTER_NODE_LISTENER = 0xf016, - REGISTER_SIMULATION_EVENT_LISTENER = 0xf017, - UNREGISTER_SIMULATION_EVENT_LISTENER = 0xf018, - SYNC_NODE_INFO_REMOTE_INPUT = 0xf019, + INIT = 0xf001U, + RELEASE = 0xf002U, + REGISTER_REMOTE_INPUT = 0xf003U, + UNREGISTER_REMOTE_INPUT = 0xf004U, + PREPARE_REMOTE_INPUT = 0xf005U, + UNPREPARE_REMOTE_INPUT = 0xf006U, + START_REMOTE_INPUT = 0xf007U, + STOP_REMOTE_INPUT = 0xf008U, + PREPARE_RELAY_REMOTE_INPUT = 0xf00aU, + UNPREPARE_RELAY_REMOTE_INPUT = 0xf00bU, + START_RELAY_TYPE_REMOTE_INPUT = 0xf00cU, + STOP_RELAY_TYPE_REMOTE_INPUT = 0xf00dU, + START_DHID_REMOTE_INPUT = 0xf00eU, + STOP_DHID_REMOTE_INPUT = 0xf00fU, + START_RELAY_DHID_REMOTE_INPUT = 0xf010U, + STOP_RELAY_DHID_REMOTE_INPUT = 0xf011U, + REGISTER_ADD_WHITE_LIST_CB_REMOTE_INPUT = 0xf013U, + REGISTER_DEL_WHITE_LIST_CB_REMOTE_INPUT = 0xf014U, + REGISTER_NODE_LISTENER = 0xf015U, + UNREGISTER_NODE_LISTENER = 0xf016U, + REGISTER_SIMULATION_EVENT_LISTENER = 0xf017U, + UNREGISTER_SIMULATION_EVENT_LISTENER = 0xf018U, + SYNC_NODE_INFO_REMOTE_INPUT = 0xf019U, }; /* SAID: 4810 */ diff --git a/frameworks/include/i_distributed_sink_input.h b/frameworks/include/i_distributed_sink_input.h index fbc8f03..26fdf33 100644 --- a/frameworks/include/i_distributed_sink_input.h +++ b/frameworks/include/i_distributed_sink_input.h @@ -53,15 +53,6 @@ public: virtual int32_t NotifyStopDScreen(const std::string &srcScreenInfoKey) = 0; virtual int32_t RegisterSharingDhIdListener(sptr sharingDhIdListener) = 0; - - enum { - INIT = 0xf011U, - RELEASE = 0xf012U, - NOTIFY_START_DSCREEN = 0xf013U, - NOTIFY_STOP_DSCREEN = 0xf014U, - REGISTER_SHARING_DHID_LISTENER = 0xf015U, - GET_SINK_SCREEN_INFOS = 0xf016U, - }; }; } // namespace DistributedInput } // namespace DistributedHardware diff --git a/frameworks/include/i_distributed_source_input.h b/frameworks/include/i_distributed_source_input.h index 7e6ea62..f46142c 100644 --- a/frameworks/include/i_distributed_source_input.h +++ b/frameworks/include/i_distributed_source_input.h @@ -98,32 +98,6 @@ public: const std::string &nodeDesc) = 0; virtual int32_t RegisterSimulationEventListener(sptr listener) = 0; virtual int32_t UnregisterSimulationEventListener(sptr listener) = 0; - - enum class MessageCode { - INIT = 0xf001, - RELEASE = 0xf002, - REGISTER_REMOTE_INPUT = 0xf003, - UNREGISTER_REMOTE_INPUT = 0xf004, - PREPARE_REMOTE_INPUT = 0xf005, - UNPREPARE_REMOTE_INPUT = 0xf006, - START_REMOTE_INPUT = 0xf007, - STOP_REMOTE_INPUT = 0xf008, - PREPARE_RELAY_REMOTE_INPUT = 0xf00a, - UNPREPARE_RELAY_REMOTE_INPUT = 0xf00b, - START_RELAY_TYPE_REMOTE_INPUT = 0xf00c, - STOP_RELAY_TYPE_REMOTE_INPUT = 0xf00d, - START_DHID_REMOTE_INPUT = 0xf00e, - STOP_DHID_REMOTE_INPUT = 0xf00f, - START_RELAY_DHID_REMOTE_INPUT = 0xf010, - STOP_RELAY_DHID_REMOTE_INPUT = 0xf011, - REGISTER_ADD_WHITE_LIST_CB_REMOTE_INPUT = 0xf013, - REGISTER_DEL_WHITE_LIST_CB_REMOTE_INPUT = 0xf014, - REGISTER_NODE_LISTENER = 0xf015, - UNREGISTER_NODE_LISTENER = 0xf016, - REGISTER_SIMULATION_EVENT_LISTENER = 0xf017, - UNREGISTER_SIMULATION_EVENT_LISTENER = 0xf018, - SYNC_NODE_INFO_REMOTE_INPUT = 0xf019, - }; }; } // namespace DistributedInput } // namespace DistributedHardware diff --git a/interfaces/ipc/include/distributed_input_source_proxy.h b/interfaces/ipc/include/distributed_input_source_proxy.h index 4855fe4..1da7c16 100644 --- a/interfaces/ipc/include/distributed_input_source_proxy.h +++ b/interfaces/ipc/include/distributed_input_source_proxy.h @@ -85,7 +85,7 @@ public: int32_t UnregisterSimulationEventListener(sptr listener) override; private: - bool SendRequest(const IDistributedSourceInput::MessageCode code, MessageParcel &data, MessageParcel &reply); + bool SendRequest(const uint32_t code, MessageParcel &data, MessageParcel &reply); static inline BrokerDelegator delegator_; }; diff --git a/interfaces/ipc/src/add_white_list_infos_call_back_proxy.cpp b/interfaces/ipc/src/add_white_list_infos_call_back_proxy.cpp index 759dea0..7625ee1 100644 --- a/interfaces/ipc/src/add_white_list_infos_call_back_proxy.cpp +++ b/interfaces/ipc/src/add_white_list_infos_call_back_proxy.cpp @@ -15,6 +15,7 @@ #include "add_white_list_infos_call_back_proxy.h" +#include "dinput_ipc_interface_code.h" #include "ipc_types.h" #include "parcel.h" @@ -54,7 +55,7 @@ void AddWhiteListInfosCallbackProxy::OnResult(const std::string& deviceId, const DHLOGE("AddWhiteListInfosCallbackProxy write strJson failed"); return; } - remote->SendRequest(static_cast(IAddWhiteListInfosCallback::Message::RESULT), data, reply, option); + remote->SendRequest(static_cast(IAddWhiteListInfosCBInterfaceCode::RESULT), data, reply, option); } } // namespace DistributedInput } // namespace DistributedHardware diff --git a/interfaces/ipc/src/add_white_list_infos_call_back_stub.cpp b/interfaces/ipc/src/add_white_list_infos_call_back_stub.cpp index 622f166..e08a316 100644 --- a/interfaces/ipc/src/add_white_list_infos_call_back_stub.cpp +++ b/interfaces/ipc/src/add_white_list_infos_call_back_stub.cpp @@ -19,6 +19,7 @@ #include "constants_dinput.h" #include "dinput_errcode.h" +#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { @@ -39,9 +40,9 @@ int32_t AddWhiteListInfosCallbackStub::OnRemoteRequest( DHLOGE("AddWhiteListInfosCallbackStub read token valid failed"); return ERR_DH_INPUT_IPC_READ_TOKEN_VALID_FAIL; } - IAddWhiteListInfosCallback::Message msgCode = static_cast(code); + IAddWhiteListInfosCBInterfaceCode msgCode = static_cast(code); switch (msgCode) { - case IAddWhiteListInfosCallback::Message::RESULT: { + case IAddWhiteListInfosCBInterfaceCode::RESULT: { std::string deviceId = data.ReadString(); std::string strJsion = data.ReadString(); OnResult(deviceId, strJsion); diff --git a/interfaces/ipc/src/del_white_list_infos_call_back_proxy.cpp b/interfaces/ipc/src/del_white_list_infos_call_back_proxy.cpp index ca978e5..08cd69b 100644 --- a/interfaces/ipc/src/del_white_list_infos_call_back_proxy.cpp +++ b/interfaces/ipc/src/del_white_list_infos_call_back_proxy.cpp @@ -15,6 +15,7 @@ #include "del_white_list_infos_call_back_proxy.h" +#include "dinput_ipc_interface_code.h" #include "ipc_types.h" #include "parcel.h" @@ -50,7 +51,7 @@ void DelWhiteListInfosCallbackProxy::OnResult(const std::string& deviceId) DHLOGE("DelWhiteListInfosCallbackProxy write deviceId failed"); return; } - remote->SendRequest(static_cast(IDelWhiteListInfosCallback::Message::RESULT), data, reply, option); + remote->SendRequest(static_cast(IDelWhiteListInfosCBInterfaceCode::RESULT), data, reply, option); } } // namespace DistributedInput } // namespace DistributedHardware diff --git a/interfaces/ipc/src/del_white_list_infos_call_back_stub.cpp b/interfaces/ipc/src/del_white_list_infos_call_back_stub.cpp index 0c2b6b5..fbaffaa 100644 --- a/interfaces/ipc/src/del_white_list_infos_call_back_stub.cpp +++ b/interfaces/ipc/src/del_white_list_infos_call_back_stub.cpp @@ -19,6 +19,7 @@ #include "constants_dinput.h" #include "dinput_errcode.h" +#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { @@ -39,9 +40,9 @@ int32_t DelWhiteListInfosCallbackStub::OnRemoteRequest( DHLOGE("DelWhiteListInfosCallbackStub read token valid failed"); return ERR_DH_INPUT_IPC_READ_TOKEN_VALID_FAIL; } - IDelWhiteListInfosCallback::Message msgCode = static_cast(code); + IDelWhiteListInfosCBInterfaceCode msgCode = static_cast(code); switch (msgCode) { - case IDelWhiteListInfosCallback::Message::RESULT: { + case IDelWhiteListInfosCBInterfaceCode::RESULT: { std::string deviceId = data.ReadString(); OnResult(deviceId); break; diff --git a/interfaces/ipc/src/distributed_input_sink_proxy.cpp b/interfaces/ipc/src/distributed_input_sink_proxy.cpp index 7a435b5..8b54876 100644 --- a/interfaces/ipc/src/distributed_input_sink_proxy.cpp +++ b/interfaces/ipc/src/distributed_input_sink_proxy.cpp @@ -18,6 +18,7 @@ #include "anonymous_string.h" #include "dinput_errcode.h" +#include "dinput_ipc_interface_code.h" #include "dinput_log.h" #include "dinput_utils_tool.h" #include "i_get_sink_screen_infos_call_back.h" @@ -41,7 +42,7 @@ int32_t DistributedInputSinkProxy::Init() return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL; } int32_t result = ERR_DH_INPUT_SINK_PROXY_INIT_FAIL; - bool ret = SendRequest(INIT, data, reply); + bool ret = SendRequest(static_cast(IDInputSinkInterfaceCode::INIT), data, reply); if (!ret) { DHLOGE("SendRequest fail!"); return ERR_DH_INPUT_SINK_PROXY_INIT_FAIL; @@ -59,7 +60,7 @@ int32_t DistributedInputSinkProxy::Release() return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL; } int32_t result = ERR_DH_INPUT_SINK_PROXY_RELEASE_FAIL; - bool ret = SendRequest(RELEASE, data, reply); + bool ret = SendRequest(static_cast(IDInputSinkInterfaceCode::RELEASE), data, reply); if (!ret) { DHLOGE("SendRequest fail!"); return ERR_DH_INPUT_SINK_PROXY_RELEASE_FAIL; @@ -85,7 +86,7 @@ int32_t DistributedInputSinkProxy::RegisterGetSinkScreenInfosCallback(sptr(IDInputSinkInterfaceCode::GET_SINK_SCREEN_INFOS), data, reply); if (ret) { result = reply.ReadInt32(); } @@ -114,7 +115,7 @@ int32_t DistributedInputSinkProxy::NotifyStartDScreen(const SrcScreenInfo &remot return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL; } int32_t result = ERR_DH_INPUT_NOTIFY_START_DSCREEN_FAIL; - bool ret = SendRequest(NOTIFY_START_DSCREEN, data, reply); + bool ret = SendRequest(static_cast(IDInputSinkInterfaceCode::NOTIFY_START_DSCREEN), data, reply); if (!ret) { DHLOGE("SendRequest fail!"); return ERR_DH_INPUT_NOTIFY_START_DSCREEN_FAIL; @@ -136,7 +137,7 @@ int32_t DistributedInputSinkProxy::NotifyStopDScreen(const std::string &srcScree return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL; } int32_t result = ERR_DH_INPUT_NOTIFY_STOP_DSCREEN_FAIL; - bool ret = SendRequest(NOTIFY_STOP_DSCREEN, data, reply); + bool ret = SendRequest(static_cast(IDInputSinkInterfaceCode::NOTIFY_STOP_DSCREEN), data, reply); if (!ret) { DHLOGE("SendRequest fail!"); return ERR_DH_INPUT_NOTIFY_STOP_DSCREEN_FAIL; @@ -159,7 +160,8 @@ int32_t DistributedInputSinkProxy::RegisterSharingDhIdListener(sptr(IDInputSinkInterfaceCode::REGISTER_SHARING_DHID_LISTENER), + data, reply); if (ret) { result = reply.ReadInt32(); } diff --git a/interfaces/ipc/src/distributed_input_sink_stub.cpp b/interfaces/ipc/src/distributed_input_sink_stub.cpp index 28ff506..7dfca96 100644 --- a/interfaces/ipc/src/distributed_input_sink_stub.cpp +++ b/interfaces/ipc/src/distributed_input_sink_stub.cpp @@ -19,6 +19,7 @@ #include "constants_dinput.h" #include "dinput_errcode.h" +#include "dinput_ipc_interface_code.h" #include "dinput_log.h" #include "i_sharing_dhid_listener.h" @@ -28,12 +29,18 @@ namespace DistributedInput { DistributedInputSinkStub::DistributedInputSinkStub() { DHLOGI("DistributedInputSinkStub ctor!"); - memberFuncMap_[INIT] = &DistributedInputSinkStub::InitInner; - memberFuncMap_[RELEASE] = &DistributedInputSinkStub::ReleaseInner; - memberFuncMap_[NOTIFY_START_DSCREEN] = &DistributedInputSinkStub::NotifyStartDScreenInner; - memberFuncMap_[NOTIFY_STOP_DSCREEN] = &DistributedInputSinkStub::NotifyStopDScreenInner; - memberFuncMap_[REGISTER_SHARING_DHID_LISTENER] = &DistributedInputSinkStub::RegisterSharingDhIdListenerInner; - memberFuncMap_[GET_SINK_SCREEN_INFOS] = &DistributedInputSinkStub::RegisterGetSinkScreenInfosInner; + memberFuncMap_[static_cast(IDInputSinkInterfaceCode::INIT)] = + &DistributedInputSinkStub::InitInner; + memberFuncMap_[static_cast(IDInputSinkInterfaceCode::RELEASE)] = + &DistributedInputSinkStub::ReleaseInner; + memberFuncMap_[static_cast(IDInputSinkInterfaceCode::NOTIFY_START_DSCREEN)] = + &DistributedInputSinkStub::NotifyStartDScreenInner; + memberFuncMap_[static_cast(IDInputSinkInterfaceCode::NOTIFY_STOP_DSCREEN)] = + &DistributedInputSinkStub::NotifyStopDScreenInner; + memberFuncMap_[static_cast(IDInputSinkInterfaceCode::REGISTER_SHARING_DHID_LISTENER)] = + &DistributedInputSinkStub::RegisterSharingDhIdListenerInner; + memberFuncMap_[static_cast(IDInputSinkInterfaceCode::GET_SINK_SCREEN_INFOS)] = + &DistributedInputSinkStub::RegisterGetSinkScreenInfosInner; } DistributedInputSinkStub::~DistributedInputSinkStub() diff --git a/interfaces/ipc/src/distributed_input_source_proxy.cpp b/interfaces/ipc/src/distributed_input_source_proxy.cpp index 25e95b3..dd1c4c8 100644 --- a/interfaces/ipc/src/distributed_input_source_proxy.cpp +++ b/interfaces/ipc/src/distributed_input_source_proxy.cpp @@ -16,6 +16,7 @@ #include "distributed_input_source_proxy.h" #include "dinput_errcode.h" +#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { @@ -37,7 +38,7 @@ int32_t DistributedInputSourceProxy::Init() return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL; } int32_t result = ERR_DH_INPUT_SOURCE_PROXY_INIT_FAIL; - bool ret = SendRequest(IDistributedSourceInput::MessageCode::INIT, data, reply); + bool ret = SendRequest(static_cast(IDInputSourceInterfaceCode::INIT), data, reply); if (ret) { result = reply.ReadInt32(); } @@ -53,7 +54,7 @@ int32_t DistributedInputSourceProxy::Release() DHLOGE("DistributedInputSourceProxy write token valid failed"); return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL; } - bool ret = SendRequest(IDistributedSourceInput::MessageCode::RELEASE, data, reply); + bool ret = SendRequest(static_cast(IDInputSourceInterfaceCode::RELEASE), data, reply); if (ret) { result = reply.ReadInt32(); } @@ -86,7 +87,7 @@ int32_t DistributedInputSourceProxy::RegisterDistributedHardware(const std::stri } MessageParcel reply; int32_t result = ERR_DH_INPUT_SOURCE_PROXY_REGISTER_FAIL; - bool ret = SendRequest(IDistributedSourceInput::MessageCode::REGISTER_REMOTE_INPUT, data, reply); + bool ret = SendRequest(static_cast(IDInputSourceInterfaceCode::REGISTER_REMOTE_INPUT), data, reply); if (ret) { result = reply.ReadInt32(); } @@ -115,7 +116,7 @@ int32_t DistributedInputSourceProxy::UnregisterDistributedHardware(const std::st } MessageParcel reply; int32_t result = ERR_DH_INPUT_SOURCE_PROXY_UNREGISTER_FAIL; - bool ret = SendRequest(IDistributedSourceInput::MessageCode::UNREGISTER_REMOTE_INPUT, data, reply); + bool ret = SendRequest(static_cast(IDInputSourceInterfaceCode::UNREGISTER_REMOTE_INPUT), data, reply); if (ret) { result = reply.ReadInt32(); } @@ -141,7 +142,7 @@ int32_t DistributedInputSourceProxy::PrepareRemoteInput( MessageParcel reply; int32_t result = ERR_DH_INPUT_SOURCE_PROXY_PREPARE_FAIL; - bool ret = SendRequest(IDistributedSourceInput::MessageCode::PREPARE_REMOTE_INPUT, data, reply); + bool ret = SendRequest(static_cast(IDInputSourceInterfaceCode::PREPARE_REMOTE_INPUT), data, reply); if (ret) { result = reply.ReadInt32(); } @@ -167,7 +168,7 @@ int32_t DistributedInputSourceProxy::UnprepareRemoteInput(const std::string &dev } MessageParcel reply; int32_t result = ERR_DH_INPUT_SOURCE_PROXY_UNPREPARE_FAIL; - bool ret = SendRequest(IDistributedSourceInput::MessageCode::UNPREPARE_REMOTE_INPUT, data, reply); + bool ret = SendRequest(static_cast(IDInputSourceInterfaceCode::UNPREPARE_REMOTE_INPUT), data, reply); if (ret) { result = reply.ReadInt32(); } @@ -198,7 +199,7 @@ int32_t DistributedInputSourceProxy::StartRemoteInput( } MessageParcel reply; int32_t result = ERR_DH_INPUT_SOURCE_PROXY_START_FAIL; - bool ret = SendRequest(IDistributedSourceInput::MessageCode::START_REMOTE_INPUT, data, reply); + bool ret = SendRequest(static_cast(IDInputSourceInterfaceCode::START_REMOTE_INPUT), data, reply); if (ret) { result = reply.ReadInt32(); } @@ -228,7 +229,7 @@ int32_t DistributedInputSourceProxy::StopRemoteInput( } MessageParcel reply; int32_t result = ERR_DH_INPUT_SOURCE_PROXY_STOP_FAIL; - bool ret = SendRequest(IDistributedSourceInput::MessageCode::STOP_REMOTE_INPUT, data, reply); + bool ret = SendRequest(static_cast(IDInputSourceInterfaceCode::STOP_REMOTE_INPUT), data, reply); if (ret) { result = reply.ReadInt32(); } @@ -262,7 +263,7 @@ int32_t DistributedInputSourceProxy::StartRemoteInput(const std::string& srcId, } MessageParcel reply; int32_t result = ERR_DH_INPUT_SOURCE_PROXY_START_FAIL; - bool ret = SendRequest(IDistributedSourceInput::MessageCode::START_RELAY_TYPE_REMOTE_INPUT, data, reply); + bool ret = SendRequest(static_cast(IDInputSourceInterfaceCode::START_RELAY_TYPE_REMOTE_INPUT), data, reply); if (ret) { result = reply.ReadInt32(); } @@ -296,7 +297,8 @@ int32_t DistributedInputSourceProxy::StopRemoteInput(const std::string& srcId, c } MessageParcel reply; int32_t result = ERR_DH_INPUT_SOURCE_PROXY_STOP_FAIL; - bool ret = SendRequest(IDistributedSourceInput::MessageCode::STOP_RELAY_TYPE_REMOTE_INPUT, data, reply); + bool ret = SendRequest(static_cast(IDInputSourceInterfaceCode::STOP_RELAY_TYPE_REMOTE_INPUT), + data, reply); if (ret) { result = reply.ReadInt32(); } @@ -326,7 +328,7 @@ int32_t DistributedInputSourceProxy::PrepareRemoteInput(const std::string &srcId MessageParcel reply; int32_t result = ERR_DH_INPUT_SOURCE_PROXY_PREPARE_FAIL; - bool ret = SendRequest(IDistributedSourceInput::MessageCode::PREPARE_RELAY_REMOTE_INPUT, data, reply); + bool ret = SendRequest(static_cast(IDInputSourceInterfaceCode::PREPARE_RELAY_REMOTE_INPUT), data, reply); if (ret) { result = reply.ReadInt32(); } @@ -356,7 +358,8 @@ int32_t DistributedInputSourceProxy::UnprepareRemoteInput(const std::string &src } MessageParcel reply; int32_t result = ERR_DH_INPUT_SOURCE_PROXY_UNPREPARE_FAIL; - bool ret = SendRequest(IDistributedSourceInput::MessageCode::UNPREPARE_RELAY_REMOTE_INPUT, data, reply); + bool ret = SendRequest(static_cast(IDInputSourceInterfaceCode::UNPREPARE_RELAY_REMOTE_INPUT), + data, reply); if (ret) { result = reply.ReadInt32(); } @@ -394,7 +397,7 @@ int32_t DistributedInputSourceProxy::StartRemoteInput(const std::string &sinkId, } MessageParcel reply; int32_t result = ERR_DH_INPUT_SOURCE_PROXY_START_FAIL; - bool ret = SendRequest(IDistributedSourceInput::MessageCode::START_DHID_REMOTE_INPUT, data, reply); + bool ret = SendRequest(static_cast(IDInputSourceInterfaceCode::START_DHID_REMOTE_INPUT), data, reply); if (ret) { result = reply.ReadInt32(); } @@ -432,7 +435,7 @@ int32_t DistributedInputSourceProxy::StopRemoteInput(const std::string &sinkId, } MessageParcel reply; int32_t result = ERR_DH_INPUT_SOURCE_PROXY_STOP_FAIL; - bool ret = SendRequest(IDistributedSourceInput::MessageCode::STOP_DHID_REMOTE_INPUT, data, reply); + bool ret = SendRequest(static_cast(IDInputSourceInterfaceCode::STOP_DHID_REMOTE_INPUT), data, reply); if (ret) { result = reply.ReadInt32(); } @@ -474,7 +477,8 @@ int32_t DistributedInputSourceProxy::StartRemoteInput(const std::string &srcId, } MessageParcel reply; int32_t result = ERR_DH_INPUT_SOURCE_PROXY_START_FAIL; - bool ret = SendRequest(IDistributedSourceInput::MessageCode::START_RELAY_DHID_REMOTE_INPUT, data, reply); + bool ret = SendRequest(static_cast(IDInputSourceInterfaceCode::START_RELAY_DHID_REMOTE_INPUT), + data, reply); if (ret) { result = reply.ReadInt32(); } @@ -516,7 +520,8 @@ int32_t DistributedInputSourceProxy::StopRemoteInput(const std::string &srcId, c } MessageParcel reply; int32_t result = ERR_DH_INPUT_SOURCE_PROXY_STOP_FAIL; - bool ret = SendRequest(IDistributedSourceInput::MessageCode::STOP_RELAY_DHID_REMOTE_INPUT, data, reply); + bool ret = SendRequest(static_cast(IDInputSourceInterfaceCode::STOP_RELAY_DHID_REMOTE_INPUT), + data, reply); if (ret) { result = reply.ReadInt32(); } @@ -541,7 +546,8 @@ int32_t DistributedInputSourceProxy::RegisterAddWhiteListCallback(sptr(IDInputSourceInterfaceCode::REGISTER_ADD_WHITE_LIST_CB_REMOTE_INPUT), + data, reply); if (ret) { result = reply.ReadInt32(); } @@ -565,7 +571,8 @@ int32_t DistributedInputSourceProxy::RegisterDelWhiteListCallback(sptr(IDInputSourceInterfaceCode::REGISTER_DEL_WHITE_LIST_CB_REMOTE_INPUT), + data, reply); if (ret) { result = reply.ReadInt32(); } @@ -586,7 +593,8 @@ int32_t DistributedInputSourceProxy::RegisterInputNodeListener(sptr(IDInputSourceInterfaceCode::REGISTER_NODE_LISTENER), + data, reply); if (ret) { result = reply.ReadInt32(); } @@ -608,7 +616,8 @@ int32_t DistributedInputSourceProxy::UnregisterInputNodeListener(sptr(IDInputSourceInterfaceCode::UNREGISTER_NODE_LISTENER), + data, reply); if (ret) { result = reply.ReadInt32(); } @@ -637,7 +646,8 @@ int32_t DistributedInputSourceProxy::SyncNodeInfoRemoteInput(const std::string & } MessageParcel reply; int32_t result = ERR_DH_INPUT_SOURCE_PROXY_SYNC_NODE_FAIL; - bool ret = SendRequest(IDistributedSourceInput::MessageCode::SYNC_NODE_INFO_REMOTE_INPUT, data, reply); + bool ret = SendRequest(static_cast(IDInputSourceInterfaceCode::SYNC_NODE_INFO_REMOTE_INPUT), + data, reply); if (ret) { result = reply.ReadInt32(); } @@ -660,7 +670,8 @@ int32_t DistributedInputSourceProxy::RegisterSimulationEventListener(sptr(IDInputSourceInterfaceCode::REGISTER_SIMULATION_EVENT_LISTENER), + data, reply); if (ret) { result = reply.ReadInt32(); } @@ -682,14 +693,15 @@ int32_t DistributedInputSourceProxy::UnregisterSimulationEventListener(sptr(IDInputSourceInterfaceCode::UNREGISTER_SIMULATION_EVENT_LISTENER), + data, reply); if (ret) { result = reply.ReadInt32(); } return result; } -bool DistributedInputSourceProxy::SendRequest(const IDistributedSourceInput::MessageCode code, MessageParcel &data, +bool DistributedInputSourceProxy::SendRequest(const uint32_t code, MessageParcel &data, MessageParcel &reply) { sptr remote = Remote(); diff --git a/interfaces/ipc/src/distributed_input_source_stub.cpp b/interfaces/ipc/src/distributed_input_source_stub.cpp index 16e2fda..1c7ec80 100644 --- a/interfaces/ipc/src/distributed_input_source_stub.cpp +++ b/interfaces/ipc/src/distributed_input_source_stub.cpp @@ -17,6 +17,7 @@ #include "constants_dinput.h" #include "dinput_errcode.h" +#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { @@ -393,73 +394,73 @@ int32_t DistributedInputSourceStub::OnRemoteRequest( return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL; } switch (code) { - case static_cast(IDistributedSourceInput::MessageCode::INIT): { + case static_cast(IDInputSourceInterfaceCode::INIT): { return HandleInitDistributedHardware(reply); } - case static_cast(IDistributedSourceInput::MessageCode::RELEASE): { + case static_cast(IDInputSourceInterfaceCode::RELEASE): { return HandleReleaseDistributedHardware(reply); } - case static_cast(IDistributedSourceInput::MessageCode::REGISTER_REMOTE_INPUT): { + case static_cast(IDInputSourceInterfaceCode::REGISTER_REMOTE_INPUT): { return HandleRegisterDistributedHardware(data, reply); } - case static_cast(IDistributedSourceInput::MessageCode::UNREGISTER_REMOTE_INPUT): { + case static_cast(IDInputSourceInterfaceCode::UNREGISTER_REMOTE_INPUT): { return HandleUnregisterDistributedHardware(data, reply); } - case static_cast(IDistributedSourceInput::MessageCode::PREPARE_REMOTE_INPUT): { + case static_cast(IDInputSourceInterfaceCode::PREPARE_REMOTE_INPUT): { return HandlePrepareRemoteInput(data, reply); } - case static_cast(IDistributedSourceInput::MessageCode::UNPREPARE_REMOTE_INPUT): { + case static_cast(IDInputSourceInterfaceCode::UNPREPARE_REMOTE_INPUT): { return HandleUnprepareRemoteInput(data, reply); } - case static_cast(IDistributedSourceInput::MessageCode::START_REMOTE_INPUT): { + case static_cast(IDInputSourceInterfaceCode::START_REMOTE_INPUT): { return HandleStartRemoteInput(data, reply); } - case static_cast(IDistributedSourceInput::MessageCode::STOP_REMOTE_INPUT): { + case static_cast(IDInputSourceInterfaceCode::STOP_REMOTE_INPUT): { return HandleStopRemoteInput(data, reply); } - case static_cast(IDistributedSourceInput::MessageCode::START_RELAY_TYPE_REMOTE_INPUT): { + case static_cast(IDInputSourceInterfaceCode::START_RELAY_TYPE_REMOTE_INPUT): { return HandleStartRelayTypeRemoteInput(data, reply); } - case static_cast(IDistributedSourceInput::MessageCode::STOP_RELAY_TYPE_REMOTE_INPUT): { + case static_cast(IDInputSourceInterfaceCode::STOP_RELAY_TYPE_REMOTE_INPUT): { return HandleStopRelayTypeRemoteInput(data, reply); } - case static_cast(IDistributedSourceInput::MessageCode::PREPARE_RELAY_REMOTE_INPUT): { + case static_cast(IDInputSourceInterfaceCode::PREPARE_RELAY_REMOTE_INPUT): { return HandlePrepareRelayRemoteInput(data, reply); } - case static_cast(IDistributedSourceInput::MessageCode::UNPREPARE_RELAY_REMOTE_INPUT): { + case static_cast(IDInputSourceInterfaceCode::UNPREPARE_RELAY_REMOTE_INPUT): { return HandleUnprepareRelayRemoteInput(data, reply); } - case static_cast(IDistributedSourceInput::MessageCode::START_DHID_REMOTE_INPUT): { + case static_cast(IDInputSourceInterfaceCode::START_DHID_REMOTE_INPUT): { return HandleStartDhidRemoteInput(data, reply); } - case static_cast(IDistributedSourceInput::MessageCode::STOP_DHID_REMOTE_INPUT): { + case static_cast(IDInputSourceInterfaceCode::STOP_DHID_REMOTE_INPUT): { return HandleStopDhidRemoteInput(data, reply); } - case static_cast(IDistributedSourceInput::MessageCode::START_RELAY_DHID_REMOTE_INPUT): { + case static_cast(IDInputSourceInterfaceCode::START_RELAY_DHID_REMOTE_INPUT): { return HandleStartRelayDhidRemoteInput(data, reply); } - case static_cast(IDistributedSourceInput::MessageCode::STOP_RELAY_DHID_REMOTE_INPUT): { + case static_cast(IDInputSourceInterfaceCode::STOP_RELAY_DHID_REMOTE_INPUT): { return HandleStopRelayDhidRemoteInput(data, reply); } - case static_cast(IDistributedSourceInput::MessageCode::REGISTER_ADD_WHITE_LIST_CB_REMOTE_INPUT): { + case static_cast(IDInputSourceInterfaceCode::REGISTER_ADD_WHITE_LIST_CB_REMOTE_INPUT): { return HandleRegisterAddWhiteListCallback(data, reply); } - case static_cast(IDistributedSourceInput::MessageCode::REGISTER_DEL_WHITE_LIST_CB_REMOTE_INPUT): { + case static_cast(IDInputSourceInterfaceCode::REGISTER_DEL_WHITE_LIST_CB_REMOTE_INPUT): { return HandleRegisterDelWhiteListCallback(data, reply); } - case static_cast(IDistributedSourceInput::MessageCode::REGISTER_NODE_LISTENER): { + case static_cast(IDInputSourceInterfaceCode::REGISTER_NODE_LISTENER): { return HandleRegisterInputNodeListener(data, reply); } - case static_cast(IDistributedSourceInput::MessageCode::UNREGISTER_NODE_LISTENER): { + case static_cast(IDInputSourceInterfaceCode::UNREGISTER_NODE_LISTENER): { return HandleUnRegisterInputNodeListener(data, reply); } - case static_cast(IDistributedSourceInput::MessageCode::REGISTER_SIMULATION_EVENT_LISTENER): { + case static_cast(IDInputSourceInterfaceCode::REGISTER_SIMULATION_EVENT_LISTENER): { return HandleRegisterSimulationEventListener(data, reply); } - case static_cast(IDistributedSourceInput::MessageCode::UNREGISTER_SIMULATION_EVENT_LISTENER): { + case static_cast(IDInputSourceInterfaceCode::UNREGISTER_SIMULATION_EVENT_LISTENER): { return HandleUnregisterSimulationEventListener(data, reply); } - case static_cast(IDistributedSourceInput::MessageCode::SYNC_NODE_INFO_REMOTE_INPUT): { + case static_cast(IDInputSourceInterfaceCode::SYNC_NODE_INFO_REMOTE_INPUT): { return HandleSyncNodeInfoRemoteInput(data, reply); } default: diff --git a/interfaces/ipc/src/get_sink_screen_infos_call_back_proxy.cpp b/interfaces/ipc/src/get_sink_screen_infos_call_back_proxy.cpp index c20011f..8170be6 100644 --- a/interfaces/ipc/src/get_sink_screen_infos_call_back_proxy.cpp +++ b/interfaces/ipc/src/get_sink_screen_infos_call_back_proxy.cpp @@ -18,6 +18,7 @@ #include "ipc_types.h" #include "parcel.h" +#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { @@ -50,7 +51,7 @@ void GetSinkScreenInfosCallbackProxy::OnResult(const std::string& strJson) DHLOGE("write strJson failed"); return; } - remote->SendRequest(static_cast(IGetSinkScreenInfosCallback::Message::RESULT), data, reply, option); + remote->SendRequest(static_cast(IGetSinkScreenInfosCBInterfaceCode::RESULT), data, reply, option); } } // namespace DistributedInput } // namespace DistributedHardware diff --git a/interfaces/ipc/src/get_sink_screen_infos_call_back_stub.cpp b/interfaces/ipc/src/get_sink_screen_infos_call_back_stub.cpp index 7537ec5..4f6d4c6 100644 --- a/interfaces/ipc/src/get_sink_screen_infos_call_back_stub.cpp +++ b/interfaces/ipc/src/get_sink_screen_infos_call_back_stub.cpp @@ -19,6 +19,7 @@ #include "constants_dinput.h" #include "dinput_errcode.h" +#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { @@ -39,9 +40,9 @@ int32_t GetSinkScreenInfosCallbackStub::OnRemoteRequest( DHLOGE("GetSinkScreenInfosCallbackStub read token valid failed"); return ERR_DH_INPUT_IPC_READ_TOKEN_VALID_FAIL; } - IGetSinkScreenInfosCallback::Message msgCode = static_cast(code); + IGetSinkScreenInfosCBInterfaceCode msgCode = static_cast(code); switch (msgCode) { - case IGetSinkScreenInfosCallback::Message::RESULT: { + case IGetSinkScreenInfosCBInterfaceCode::RESULT: { std::string strJson = data.ReadString(); OnResult(strJson); break; diff --git a/interfaces/ipc/src/input_node_listener_proxy.cpp b/interfaces/ipc/src/input_node_listener_proxy.cpp index fe7c1ea..3a84bad 100644 --- a/interfaces/ipc/src/input_node_listener_proxy.cpp +++ b/interfaces/ipc/src/input_node_listener_proxy.cpp @@ -18,6 +18,7 @@ #include "ipc_types.h" #include "parcel.h" +#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { @@ -61,7 +62,7 @@ void InputNodeListenerProxy::OnNodeOnLine(const std::string srcDevId, const std: DHLOGE("InputNodeListenerProxy write sinkNodeDesc failed"); return; } - int32_t ret = remote->SendRequest(static_cast(InputNodeListener::Message::RESULT_ON), data, reply, option); + int32_t ret = remote->SendRequest(static_cast(InputNodeListenerInterfaceCode::RESULT_ON), data, reply, option); if (ret != 0) { return; } @@ -95,7 +96,7 @@ void InputNodeListenerProxy::OnNodeOffLine(const std::string srcDevId, const std return; } int32_t ret = - remote->SendRequest(static_cast(InputNodeListener::Message::RESULT_OFF), data, reply, option); + remote->SendRequest(static_cast(InputNodeListenerInterfaceCode::RESULT_OFF), data, reply, option); if (ret != 0) { return; } diff --git a/interfaces/ipc/src/input_node_listener_stub.cpp b/interfaces/ipc/src/input_node_listener_stub.cpp index 348a42b..2f83668 100644 --- a/interfaces/ipc/src/input_node_listener_stub.cpp +++ b/interfaces/ipc/src/input_node_listener_stub.cpp @@ -19,6 +19,7 @@ #include "constants_dinput.h" #include "dinput_errcode.h" +#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { @@ -35,9 +36,9 @@ int32_t InputNodeListenerStub::OnRemoteRequest( DHLOGE("InputNodeListenerStub read token valid failed"); return ERR_DH_INPUT_IPC_READ_TOKEN_VALID_FAIL; } - InputNodeListener::Message msgCode = static_cast(code); + InputNodeListenerInterfaceCode msgCode = static_cast(code); switch (msgCode) { - case InputNodeListener::Message::RESULT_ON: { + case InputNodeListenerInterfaceCode::RESULT_ON: { std::string srcDevId = data.ReadString(); std::string sinkDevId = data.ReadString(); std::string sinkNodeId = data.ReadString(); @@ -45,7 +46,7 @@ int32_t InputNodeListenerStub::OnRemoteRequest( OnNodeOnLine(srcDevId, sinkDevId, sinkNodeId, sinkNodeDesc); break; } - case InputNodeListener::Message::RESULT_OFF: { + case InputNodeListenerInterfaceCode::RESULT_OFF: { std::string srcDevId = data.ReadString(); std::string sinkDevId = data.ReadString(); std::string sinkNodeId = data.ReadString(); diff --git a/interfaces/ipc/src/prepare_d_input_call_back_proxy.cpp b/interfaces/ipc/src/prepare_d_input_call_back_proxy.cpp index 18b4c28..0dce4d2 100644 --- a/interfaces/ipc/src/prepare_d_input_call_back_proxy.cpp +++ b/interfaces/ipc/src/prepare_d_input_call_back_proxy.cpp @@ -18,6 +18,7 @@ #include "ipc_types.h" #include "parcel.h" +#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { @@ -53,7 +54,7 @@ void PrepareDInputCallbackProxy::OnResult(const std::string& deviceId, const int return; } int32_t ret = remote->SendRequest( - static_cast(IPrepareDInputCallback::Message::RESULT), data, reply, option); + static_cast(IPrepareDInputCBInterfaceCode::RESULT), data, reply, option); if (ret != 0) { return; } diff --git a/interfaces/ipc/src/prepare_d_input_call_back_stub.cpp b/interfaces/ipc/src/prepare_d_input_call_back_stub.cpp index 0796aa4..48b7f9c 100644 --- a/interfaces/ipc/src/prepare_d_input_call_back_stub.cpp +++ b/interfaces/ipc/src/prepare_d_input_call_back_stub.cpp @@ -19,6 +19,7 @@ #include "constants_dinput.h" #include "dinput_errcode.h" +#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { @@ -39,9 +40,9 @@ int32_t PrepareDInputCallbackStub::OnRemoteRequest( DHLOGE("PrepareDInputCallbackStub read token valid failed"); return ERR_DH_INPUT_IPC_READ_TOKEN_VALID_FAIL; } - IPrepareDInputCallback::Message msgCode = static_cast(code); + IPrepareDInputCBInterfaceCode msgCode = static_cast(code); switch (msgCode) { - case IPrepareDInputCallback::Message::RESULT: { + case IPrepareDInputCBInterfaceCode::RESULT: { std::string deviceId = data.ReadString(); int32_t status = data.ReadInt32(); OnResult(deviceId, status); diff --git a/interfaces/ipc/src/register_d_input_call_back_proxy.cpp b/interfaces/ipc/src/register_d_input_call_back_proxy.cpp index 58302e6..7713a85 100644 --- a/interfaces/ipc/src/register_d_input_call_back_proxy.cpp +++ b/interfaces/ipc/src/register_d_input_call_back_proxy.cpp @@ -18,6 +18,7 @@ #include "ipc_types.h" #include "parcel.h" +#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { @@ -56,7 +57,7 @@ void RegisterDInputCallbackProxy::OnResult(const std::string& devId, const std:: return; } int32_t ret = remote->SendRequest( - static_cast(IRegisterDInputCallback::Message::RESULT), data, reply, option); + static_cast(IRegisterDInputCBInterfaceCode::RESULT), data, reply, option); if (ret != 0) { return; } diff --git a/interfaces/ipc/src/register_d_input_call_back_stub.cpp b/interfaces/ipc/src/register_d_input_call_back_stub.cpp index 935c6ca..d13404f 100644 --- a/interfaces/ipc/src/register_d_input_call_back_stub.cpp +++ b/interfaces/ipc/src/register_d_input_call_back_stub.cpp @@ -19,6 +19,7 @@ #include "constants_dinput.h" #include "dinput_errcode.h" +#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { @@ -39,9 +40,9 @@ int32_t RegisterDInputCallbackStub::OnRemoteRequest( DHLOGE("RegisterDInputCallbackStub read token valid failed"); return ERR_DH_INPUT_IPC_READ_TOKEN_VALID_FAIL; } - IRegisterDInputCallback::Message msgCode = static_cast(code); + IRegisterDInputCBInterfaceCode msgCode = static_cast(code); switch (msgCode) { - case IRegisterDInputCallback::Message::RESULT: { + case IRegisterDInputCBInterfaceCode::RESULT: { std::string devId = data.ReadString(); std::string dhId = data.ReadString(); int32_t status = data.ReadInt32(); diff --git a/interfaces/ipc/src/sharing_dhid_listener_proxy.cpp b/interfaces/ipc/src/sharing_dhid_listener_proxy.cpp index daabdf8..9af1fea 100644 --- a/interfaces/ipc/src/sharing_dhid_listener_proxy.cpp +++ b/interfaces/ipc/src/sharing_dhid_listener_proxy.cpp @@ -19,6 +19,7 @@ #include "parcel.h" #include "dinput_errcode.h" +#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { @@ -53,7 +54,7 @@ int32_t SharingDhIdListenerProxy::OnSharing(std::string dhId) } int32_t ret = - remote->SendRequest(static_cast(ISharingDhIdListener::Message::SHARING), data, reply, option); + remote->SendRequest(static_cast(ISharingDhIdListenerInterfaceCode::SHARING), data, reply, option); if (ret == DH_SUCCESS) { result = reply.ReadInt32(); } else { @@ -84,7 +85,7 @@ int32_t SharingDhIdListenerProxy::OnNoSharing(std::string dhId) } int32_t ret = - remote->SendRequest(static_cast(ISharingDhIdListener::Message::NO_SHARING), data, reply, option); + remote->SendRequest(static_cast(ISharingDhIdListenerInterfaceCode::NO_SHARING), data, reply, option); if (ret == DH_SUCCESS) { result = reply.ReadInt32(); } else { diff --git a/interfaces/ipc/src/sharing_dhid_listener_stub.cpp b/interfaces/ipc/src/sharing_dhid_listener_stub.cpp index 4410adb..38fdd61 100644 --- a/interfaces/ipc/src/sharing_dhid_listener_stub.cpp +++ b/interfaces/ipc/src/sharing_dhid_listener_stub.cpp @@ -19,6 +19,7 @@ #include "constants_dinput.h" #include "dinput_errcode.h" +#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { @@ -35,9 +36,9 @@ int32_t SharingDhIdListenerStub::OnRemoteRequest( DHLOGE("SharingDhIdListenerStub read token valid failed"); return ERR_DH_INPUT_IPC_READ_TOKEN_VALID_FAIL; } - ISharingDhIdListener::Message msgCode = static_cast(code); + ISharingDhIdListenerInterfaceCode msgCode = static_cast(code); switch (msgCode) { - case ISharingDhIdListener::Message::SHARING: { + case ISharingDhIdListenerInterfaceCode::SHARING: { std::string dhId = data.ReadString(); int32_t ret = OnSharing(dhId); if (!reply.WriteInt32(ret)) { @@ -46,7 +47,7 @@ int32_t SharingDhIdListenerStub::OnRemoteRequest( } break; } - case ISharingDhIdListener::Message::NO_SHARING: { + case ISharingDhIdListenerInterfaceCode::NO_SHARING: { std::string dhId = data.ReadString(); int32_t ret = OnNoSharing(dhId); if (!reply.WriteInt32(ret)) { diff --git a/interfaces/ipc/src/simulation_event_listener_proxy.cpp b/interfaces/ipc/src/simulation_event_listener_proxy.cpp index 4412a77..eaa37a5 100644 --- a/interfaces/ipc/src/simulation_event_listener_proxy.cpp +++ b/interfaces/ipc/src/simulation_event_listener_proxy.cpp @@ -19,6 +19,7 @@ #include "parcel.h" #include "dinput_errcode.h" +#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { @@ -60,7 +61,7 @@ int32_t SimulationEventListenerProxy::OnSimulationEvent(uint32_t type, uint32_t return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL; } int32_t ret = - remote->SendRequest(static_cast(ISimulationEventListener::Message::RESULT_ON), data, reply, option); + remote->SendRequest(static_cast(ISimulationEventListenerInterfaceCode::RESULT_ON), data, reply, option); if (ret == DH_SUCCESS) { result = reply.ReadInt32(); } else { diff --git a/interfaces/ipc/src/simulation_event_listener_stub.cpp b/interfaces/ipc/src/simulation_event_listener_stub.cpp index 34b2b70..03733fb 100644 --- a/interfaces/ipc/src/simulation_event_listener_stub.cpp +++ b/interfaces/ipc/src/simulation_event_listener_stub.cpp @@ -19,6 +19,7 @@ #include "constants_dinput.h" #include "dinput_errcode.h" +#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { @@ -35,9 +36,9 @@ int32_t SimulationEventListenerStub::OnRemoteRequest( DHLOGE("SimulationEventListenerStub read token valid failed"); return ERR_DH_INPUT_IPC_READ_TOKEN_VALID_FAIL; } - ISimulationEventListener::Message msgCode = static_cast(code); + ISimulationEventListenerInterfaceCode msgCode = static_cast(code); switch (msgCode) { - case ISimulationEventListener::Message::RESULT_ON: { + case ISimulationEventListenerInterfaceCode::RESULT_ON: { uint32_t eventType = data.ReadUint32(); uint32_t eventCode = data.ReadUint32(); int32_t eventValue = data.ReadInt32(); diff --git a/interfaces/ipc/src/start_d_input_call_back_proxy.cpp b/interfaces/ipc/src/start_d_input_call_back_proxy.cpp index 1384901..3439dc1 100644 --- a/interfaces/ipc/src/start_d_input_call_back_proxy.cpp +++ b/interfaces/ipc/src/start_d_input_call_back_proxy.cpp @@ -18,6 +18,7 @@ #include "ipc_types.h" #include "parcel.h" +#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { @@ -59,7 +60,7 @@ void StartDInputCallbackProxy::OnResult(const std::string& devId, const uint32_t return; } int32_t ret = remote->SendRequest( - static_cast(IStartDInputCallback::Message::RESULT), data, reply, option); + static_cast(IStartDInputCBInterfaceCode::RESULT), data, reply, option); if (ret != 0) { return; } diff --git a/interfaces/ipc/src/start_d_input_call_back_stub.cpp b/interfaces/ipc/src/start_d_input_call_back_stub.cpp index b9243b1..9b2ce69 100644 --- a/interfaces/ipc/src/start_d_input_call_back_stub.cpp +++ b/interfaces/ipc/src/start_d_input_call_back_stub.cpp @@ -19,6 +19,7 @@ #include "constants_dinput.h" #include "dinput_errcode.h" +#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { @@ -39,9 +40,9 @@ int32_t StartDInputCallbackStub::OnRemoteRequest( DHLOGE("StartDInputCallbackStub read token valid failed"); return ERR_DH_INPUT_IPC_READ_TOKEN_VALID_FAIL; } - IStartDInputCallback::Message msgCode = static_cast(code); + IStartDInputCBInterfaceCode msgCode = static_cast(code); switch (msgCode) { - case IStartDInputCallback::Message::RESULT: { + case IStartDInputCBInterfaceCode::RESULT: { std::string deviceId = data.ReadString(); uint32_t inputTypes = data.ReadUint32(); int32_t status = data.ReadInt32(); diff --git a/interfaces/ipc/src/start_stop_d_inputs_call_back_proxy.cpp b/interfaces/ipc/src/start_stop_d_inputs_call_back_proxy.cpp index d2a4087..7160db6 100644 --- a/interfaces/ipc/src/start_stop_d_inputs_call_back_proxy.cpp +++ b/interfaces/ipc/src/start_stop_d_inputs_call_back_proxy.cpp @@ -18,6 +18,7 @@ #include "ipc_types.h" #include "parcel.h" +#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { @@ -52,7 +53,7 @@ void StartStopDInputsCallbackProxy::OnResultDhids(const std::string &devId, cons DHLOGE("StartStopDInputsCallbackProxy write status valid failed"); return; } - int32_t ret = remote->SendRequest(static_cast(IStartStopDInputsCallback::Message::RESULT_STRING), + int32_t ret = remote->SendRequest(static_cast(IStartStopDInputsCBInterfaceCode::RESULT_STRING), data, reply, option); if (ret != 0) { DHLOGE("OnResultDhids error, ret = %d", ret); diff --git a/interfaces/ipc/src/start_stop_d_inputs_call_back_stub.cpp b/interfaces/ipc/src/start_stop_d_inputs_call_back_stub.cpp index 748b7a6..d04a0de 100644 --- a/interfaces/ipc/src/start_stop_d_inputs_call_back_stub.cpp +++ b/interfaces/ipc/src/start_stop_d_inputs_call_back_stub.cpp @@ -19,6 +19,7 @@ #include "constants_dinput.h" #include "dinput_errcode.h" +#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { @@ -35,9 +36,9 @@ int32_t StartStopDInputsCallbackStub::OnRemoteRequest( if (descriptor != IStartStopDInputsCallback::GetDescriptor()) { return ERR_DH_INPUT_IPC_INVALID_DESCRIPTOR; } - IStartStopDInputsCallback::Message msgCode = static_cast(code); + IStartStopDInputsCBInterfaceCode msgCode = static_cast(code); switch (msgCode) { - case IStartStopDInputsCallback::Message::RESULT_STRING: { + case IStartStopDInputsCBInterfaceCode::RESULT_STRING: { std::string devId = data.ReadString(); int32_t status = data.ReadInt32(); DHLOGW("OnResultDhids received."); diff --git a/interfaces/ipc/src/start_stop_result_call_back_proxy.cpp b/interfaces/ipc/src/start_stop_result_call_back_proxy.cpp index 8307480..97b08ee 100644 --- a/interfaces/ipc/src/start_stop_result_call_back_proxy.cpp +++ b/interfaces/ipc/src/start_stop_result_call_back_proxy.cpp @@ -17,6 +17,7 @@ #include "parcel.h" #include "dinput_errcode.h" +#include "dinput_ipc_interface_code.h" #include "dinput_log.h" #include "start_stop_result_call_back_proxy.h" @@ -67,7 +68,7 @@ void StartStopResultCallbackProxy::OnStart( } int32_t ret = - remote->SendRequest(static_cast(IStartStopResultCallback::Message::RESULT_START), data, reply, option); + remote->SendRequest(static_cast(IStartStopResultCBInterfaceCode::RESULT_START), data, reply, option); if (ret != 0) { DHLOGE("StartStopResultCallbackProxy SendRequest errno:%d", ret); return; @@ -112,7 +113,7 @@ void StartStopResultCallbackProxy::OnStop( } int32_t ret = - remote->SendRequest(static_cast(IStartStopResultCallback::Message::RESULT_STOP), data, reply, option); + remote->SendRequest(static_cast(IStartStopResultCBInterfaceCode::RESULT_STOP), data, reply, option); if (ret != 0) { DHLOGE("StartStopResultCallbackProxy SendRequest errno:%d", ret); return; diff --git a/interfaces/ipc/src/start_stop_result_call_back_stub.cpp b/interfaces/ipc/src/start_stop_result_call_back_stub.cpp index 5c41b09..817369a 100644 --- a/interfaces/ipc/src/start_stop_result_call_back_stub.cpp +++ b/interfaces/ipc/src/start_stop_result_call_back_stub.cpp @@ -19,6 +19,7 @@ #include "constants_dinput.h" #include "dinput_errcode.h" +#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { @@ -35,9 +36,9 @@ int32_t StartStopResultCallbackStub::OnRemoteRequest( if (descriptor != IStartStopResultCallback::GetDescriptor()) { return ERR_DH_INPUT_IPC_INVALID_DESCRIPTOR; } - IStartStopResultCallback::Message msgCode = static_cast(code); + IStartStopResultCBInterfaceCode msgCode = static_cast(code); switch (msgCode) { - case IStartStopResultCallback::Message::RESULT_START: { + case IStartStopResultCBInterfaceCode::RESULT_START: { std::string srcId = data.ReadString(); std::string sinkId = data.ReadString(); uint32_t size = data.ReadUint32(); @@ -54,7 +55,7 @@ int32_t StartStopResultCallbackStub::OnRemoteRequest( OnStart(srcId, sinkId, dhIds); break; } - case IStartStopResultCallback::Message::RESULT_STOP: { + case IStartStopResultCBInterfaceCode::RESULT_STOP: { std::string srcId = data.ReadString(); std::string sinkId = data.ReadString(); uint32_t size = data.ReadUint32(); diff --git a/interfaces/ipc/src/stop_d_input_call_back_proxy.cpp b/interfaces/ipc/src/stop_d_input_call_back_proxy.cpp index dd787fd..056340f 100644 --- a/interfaces/ipc/src/stop_d_input_call_back_proxy.cpp +++ b/interfaces/ipc/src/stop_d_input_call_back_proxy.cpp @@ -18,6 +18,7 @@ #include "ipc_types.h" #include "parcel.h" +#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { @@ -59,7 +60,7 @@ void StopDInputCallbackProxy::OnResult(const std::string& devId, const uint32_t& return; } int32_t ret = remote->SendRequest( - static_cast(IStopDInputCallback::Message::RESULT), data, reply, option); + static_cast(IStopDInputCBInterfaceCode::RESULT), data, reply, option); if (ret != 0) { return; } diff --git a/interfaces/ipc/src/stop_d_input_call_back_stub.cpp b/interfaces/ipc/src/stop_d_input_call_back_stub.cpp index 64f8d5f..a08ffff 100644 --- a/interfaces/ipc/src/stop_d_input_call_back_stub.cpp +++ b/interfaces/ipc/src/stop_d_input_call_back_stub.cpp @@ -19,6 +19,7 @@ #include "constants_dinput.h" #include "dinput_errcode.h" +#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { @@ -39,9 +40,9 @@ int32_t StopDInputCallbackStub::OnRemoteRequest( DHLOGE("StopDInputCallbackStub read token valid failed"); return ERR_DH_INPUT_IPC_READ_TOKEN_VALID_FAIL; } - IStopDInputCallback::Message msgCode = static_cast(code); + IStopDInputCBInterfaceCode msgCode = static_cast(code); switch (msgCode) { - case IStopDInputCallback::Message::RESULT: { + case IStopDInputCBInterfaceCode::RESULT: { std::string deviceId = data.ReadString(); uint32_t inputTypes = data.ReadUint32(); int32_t status = data.ReadInt32(); diff --git a/interfaces/ipc/src/unprepare_d_input_call_back_proxy.cpp b/interfaces/ipc/src/unprepare_d_input_call_back_proxy.cpp index ede240e..48f04ea 100644 --- a/interfaces/ipc/src/unprepare_d_input_call_back_proxy.cpp +++ b/interfaces/ipc/src/unprepare_d_input_call_back_proxy.cpp @@ -18,6 +18,7 @@ #include "ipc_types.h" #include "parcel.h" +#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { @@ -55,7 +56,7 @@ void UnprepareDInputCallbackProxy::OnResult(const std::string& deviceId, const i return; } int32_t ret = remote->SendRequest( - static_cast(IUnprepareDInputCallback::Message::RESULT), data, reply, option); + static_cast(IUnprepareDInputCBInterfaceCode::RESULT), data, reply, option); if (ret != 0) { return; } diff --git a/interfaces/ipc/src/unprepare_d_input_call_back_stub.cpp b/interfaces/ipc/src/unprepare_d_input_call_back_stub.cpp index f248c93..5e780a9 100644 --- a/interfaces/ipc/src/unprepare_d_input_call_back_stub.cpp +++ b/interfaces/ipc/src/unprepare_d_input_call_back_stub.cpp @@ -19,6 +19,7 @@ #include "constants_dinput.h" #include "dinput_errcode.h" +#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { @@ -39,9 +40,9 @@ int32_t UnprepareDInputCallbackStub::OnRemoteRequest( DHLOGE("UnprepareDInputCallbackStub read token valid failed"); return ERR_DH_INPUT_IPC_READ_TOKEN_VALID_FAIL; } - IUnprepareDInputCallback::Message msgCode = static_cast(code); + IUnprepareDInputCBInterfaceCode msgCode = static_cast(code); switch (msgCode) { - case IUnprepareDInputCallback::Message::RESULT: { + case IUnprepareDInputCBInterfaceCode::RESULT: { std::string deviceId = data.ReadString(); int32_t status = data.ReadInt32(); OnResult(deviceId, status); diff --git a/interfaces/ipc/src/unregister_d_input_call_back_proxy.cpp b/interfaces/ipc/src/unregister_d_input_call_back_proxy.cpp index 1648dfd..60b7f33 100644 --- a/interfaces/ipc/src/unregister_d_input_call_back_proxy.cpp +++ b/interfaces/ipc/src/unregister_d_input_call_back_proxy.cpp @@ -18,6 +18,7 @@ #include "ipc_types.h" #include "parcel.h" +#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { @@ -59,7 +60,7 @@ void UnregisterDInputCallbackProxy::OnResult(const std::string& devId, const std return; } int32_t ret = remote->SendRequest( - static_cast(IUnregisterDInputCallback::Message::RESULT), data, reply, option); + static_cast(IUnregisterDInputCBInterfaceCode::RESULT), data, reply, option); if (ret != 0) { return; } diff --git a/interfaces/ipc/src/unregister_d_input_call_back_stub.cpp b/interfaces/ipc/src/unregister_d_input_call_back_stub.cpp index 6270c3c..3af8622 100644 --- a/interfaces/ipc/src/unregister_d_input_call_back_stub.cpp +++ b/interfaces/ipc/src/unregister_d_input_call_back_stub.cpp @@ -19,6 +19,7 @@ #include "constants_dinput.h" #include "dinput_errcode.h" +#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { @@ -39,9 +40,9 @@ int32_t UnregisterDInputCallbackStub::OnRemoteRequest( DHLOGE("UnregisterDInputCallbackStub read token valid failed"); return ERR_DH_INPUT_IPC_READ_TOKEN_VALID_FAIL; } - IUnregisterDInputCallback::Message msgCode = static_cast(code); + IUnregisterDInputCBInterfaceCode msgCode = static_cast(code); switch (msgCode) { - case IUnregisterDInputCallback::Message::RESULT: { + case IUnregisterDInputCBInterfaceCode::RESULT: { std::string devId = data.ReadString(); std::string dhId = data.ReadString(); int32_t status = data.ReadInt32(); diff --git a/interfaces/ipc/test/dinputsourcecallbackunittest/dinput_source_callback_unittest.cpp b/interfaces/ipc/test/dinputsourcecallbackunittest/dinput_source_callback_unittest.cpp index 836b349..160762e 100644 --- a/interfaces/ipc/test/dinputsourcecallbackunittest/dinput_source_callback_unittest.cpp +++ b/interfaces/ipc/test/dinputsourcecallbackunittest/dinput_source_callback_unittest.cpp @@ -17,6 +17,7 @@ #include #include "dinput_errcode.h" +#include "dinput_ipc_interface_code.h" namespace OHOS { namespace DistributedHardware { @@ -352,10 +353,10 @@ HWTEST_F(DInputSourceCallBackTest, SendRequest01, testing::ext::TestSize.Level1) { sptr callBackStubPtr = new TestDInputSourceCallBackStub(); DistributedInputSourceProxy callBackProxy(callBackStubPtr); - IDistributedSourceInput::MessageCode code = IDistributedSourceInput::MessageCode::INIT; + IDInputSourceInterfaceCode code = IDInputSourceInterfaceCode::INIT; MessageParcel data; MessageParcel reply; - bool ret = callBackProxy.SendRequest(code, data, reply); + bool ret = callBackProxy.SendRequest(static_cast(code), data, reply); EXPECT_EQ(false, ret); } -- Gitee From bcc828c81bb6a3d4c892f16a272a3f12fe232c3b Mon Sep 17 00:00:00 2001 From: hwzhangchuang Date: Tue, 16 May 2023 19:38:18 +0800 Subject: [PATCH 2/6] modify format error Signed-off-by: hwzhangchuang --- interfaces/ipc/src/distributed_input_source_proxy.cpp | 3 ++- interfaces/ipc/src/input_node_listener_proxy.cpp | 3 ++- interfaces/ipc/src/input_node_listener_stub.cpp | 2 +- interfaces/ipc/src/simulation_event_listener_proxy.cpp | 4 ++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/interfaces/ipc/src/distributed_input_source_proxy.cpp b/interfaces/ipc/src/distributed_input_source_proxy.cpp index dd1c4c8..357e22a 100644 --- a/interfaces/ipc/src/distributed_input_source_proxy.cpp +++ b/interfaces/ipc/src/distributed_input_source_proxy.cpp @@ -263,7 +263,8 @@ int32_t DistributedInputSourceProxy::StartRemoteInput(const std::string& srcId, } MessageParcel reply; int32_t result = ERR_DH_INPUT_SOURCE_PROXY_START_FAIL; - bool ret = SendRequest(static_cast(IDInputSourceInterfaceCode::START_RELAY_TYPE_REMOTE_INPUT), data, reply); + bool ret = SendRequest(static_cast(IDInputSourceInterfaceCode::START_RELAY_TYPE_REMOTE_INPUT), data, + reply); if (ret) { result = reply.ReadInt32(); } diff --git a/interfaces/ipc/src/input_node_listener_proxy.cpp b/interfaces/ipc/src/input_node_listener_proxy.cpp index 3a84bad..cc8a4f1 100644 --- a/interfaces/ipc/src/input_node_listener_proxy.cpp +++ b/interfaces/ipc/src/input_node_listener_proxy.cpp @@ -62,7 +62,8 @@ void InputNodeListenerProxy::OnNodeOnLine(const std::string srcDevId, const std: DHLOGE("InputNodeListenerProxy write sinkNodeDesc failed"); return; } - int32_t ret = remote->SendRequest(static_cast(InputNodeListenerInterfaceCode::RESULT_ON), data, reply, option); + int32_t ret = remote->SendRequest(static_cast(InputNodeListenerInterfaceCode::RESULT_ON), data, reply, + option); if (ret != 0) { return; } diff --git a/interfaces/ipc/src/input_node_listener_stub.cpp b/interfaces/ipc/src/input_node_listener_stub.cpp index 2f83668..aedb4c3 100644 --- a/interfaces/ipc/src/input_node_listener_stub.cpp +++ b/interfaces/ipc/src/input_node_listener_stub.cpp @@ -19,7 +19,7 @@ #include "constants_dinput.h" #include "dinput_errcode.h" -#include "dinput_ipc_interface_code.h" +#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { diff --git a/interfaces/ipc/src/simulation_event_listener_proxy.cpp b/interfaces/ipc/src/simulation_event_listener_proxy.cpp index eaa37a5..764d138 100644 --- a/interfaces/ipc/src/simulation_event_listener_proxy.cpp +++ b/interfaces/ipc/src/simulation_event_listener_proxy.cpp @@ -60,8 +60,8 @@ int32_t SimulationEventListenerProxy::OnSimulationEvent(uint32_t type, uint32_t DHLOGE("SimulationEventListenerProxy write value failed"); return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL; } - int32_t ret = - remote->SendRequest(static_cast(ISimulationEventListenerInterfaceCode::RESULT_ON), data, reply, option); + int32_t ret = remote->SendRequest(static_cast(ISimulationEventListenerInterfaceCode::RESULT_ON), data, + reply, option); if (ret == DH_SUCCESS) { result = reply.ReadInt32(); } else { -- Gitee From 32e1daee1bcad158cfb26835c13da359a58205cf Mon Sep 17 00:00:00 2001 From: hwzhangchuang Date: Wed, 17 May 2023 14:52:34 +0800 Subject: [PATCH 3/6] modify time scope Signed-off-by: hwzhangchuang --- frameworks/include/i_distributed_sink_input.h | 2 +- frameworks/include/i_distributed_source_input.h | 2 +- interfaces/ipc/include/distributed_input_source_proxy.h | 2 +- interfaces/ipc/src/add_white_list_infos_call_back_proxy.cpp | 2 +- interfaces/ipc/src/add_white_list_infos_call_back_stub.cpp | 2 +- interfaces/ipc/src/del_white_list_infos_call_back_proxy.cpp | 2 +- interfaces/ipc/src/del_white_list_infos_call_back_stub.cpp | 2 +- interfaces/ipc/src/distributed_input_sink_proxy.cpp | 2 +- interfaces/ipc/src/distributed_input_source_proxy.cpp | 2 +- interfaces/ipc/src/get_sink_screen_infos_call_back_proxy.cpp | 2 +- interfaces/ipc/src/get_sink_screen_infos_call_back_stub.cpp | 2 +- interfaces/ipc/src/input_node_listener_proxy.cpp | 2 +- interfaces/ipc/src/input_node_listener_stub.cpp | 2 +- interfaces/ipc/src/prepare_d_input_call_back_proxy.cpp | 2 +- interfaces/ipc/src/prepare_d_input_call_back_stub.cpp | 2 +- interfaces/ipc/src/register_d_input_call_back_proxy.cpp | 2 +- interfaces/ipc/src/register_d_input_call_back_stub.cpp | 2 +- interfaces/ipc/src/sharing_dhid_listener_proxy.cpp | 2 +- interfaces/ipc/src/sharing_dhid_listener_stub.cpp | 2 +- interfaces/ipc/src/simulation_event_listener_proxy.cpp | 2 +- interfaces/ipc/src/simulation_event_listener_stub.cpp | 2 +- interfaces/ipc/src/start_d_input_call_back_proxy.cpp | 2 +- interfaces/ipc/src/start_d_input_call_back_stub.cpp | 2 +- interfaces/ipc/src/start_stop_d_inputs_call_back_proxy.cpp | 2 +- interfaces/ipc/src/start_stop_d_inputs_call_back_stub.cpp | 2 +- interfaces/ipc/src/start_stop_result_call_back_proxy.cpp | 2 +- interfaces/ipc/src/start_stop_result_call_back_stub.cpp | 2 +- interfaces/ipc/src/stop_d_input_call_back_proxy.cpp | 2 +- interfaces/ipc/src/stop_d_input_call_back_stub.cpp | 2 +- interfaces/ipc/src/unprepare_d_input_call_back_proxy.cpp | 2 +- interfaces/ipc/src/unprepare_d_input_call_back_stub.cpp | 2 +- interfaces/ipc/src/unregister_d_input_call_back_proxy.cpp | 2 +- interfaces/ipc/src/unregister_d_input_call_back_stub.cpp | 2 +- .../dinput_source_callback_unittest.cpp | 2 +- 34 files changed, 34 insertions(+), 34 deletions(-) diff --git a/frameworks/include/i_distributed_sink_input.h b/frameworks/include/i_distributed_sink_input.h index 26fdf33..733fb7b 100644 --- a/frameworks/include/i_distributed_sink_input.h +++ b/frameworks/include/i_distributed_sink_input.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Copyright (c) 2021-2023 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 diff --git a/frameworks/include/i_distributed_source_input.h b/frameworks/include/i_distributed_source_input.h index f46142c..f84f87c 100644 --- a/frameworks/include/i_distributed_source_input.h +++ b/frameworks/include/i_distributed_source_input.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Copyright (c) 2021-2023 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 diff --git a/interfaces/ipc/include/distributed_input_source_proxy.h b/interfaces/ipc/include/distributed_input_source_proxy.h index 1da7c16..a602e63 100644 --- a/interfaces/ipc/include/distributed_input_source_proxy.h +++ b/interfaces/ipc/include/distributed_input_source_proxy.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Copyright (c) 2021-2023 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 diff --git a/interfaces/ipc/src/add_white_list_infos_call_back_proxy.cpp b/interfaces/ipc/src/add_white_list_infos_call_back_proxy.cpp index 7625ee1..cc86e65 100644 --- a/interfaces/ipc/src/add_white_list_infos_call_back_proxy.cpp +++ b/interfaces/ipc/src/add_white_list_infos_call_back_proxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Copyright (c) 2021-2023 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 diff --git a/interfaces/ipc/src/add_white_list_infos_call_back_stub.cpp b/interfaces/ipc/src/add_white_list_infos_call_back_stub.cpp index e08a316..ab7ecd4 100644 --- a/interfaces/ipc/src/add_white_list_infos_call_back_stub.cpp +++ b/interfaces/ipc/src/add_white_list_infos_call_back_stub.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Copyright (c) 2021-2023 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 diff --git a/interfaces/ipc/src/del_white_list_infos_call_back_proxy.cpp b/interfaces/ipc/src/del_white_list_infos_call_back_proxy.cpp index 08cd69b..ca35a43 100644 --- a/interfaces/ipc/src/del_white_list_infos_call_back_proxy.cpp +++ b/interfaces/ipc/src/del_white_list_infos_call_back_proxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Copyright (c) 2021-2023 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 diff --git a/interfaces/ipc/src/del_white_list_infos_call_back_stub.cpp b/interfaces/ipc/src/del_white_list_infos_call_back_stub.cpp index fbaffaa..39709c7 100644 --- a/interfaces/ipc/src/del_white_list_infos_call_back_stub.cpp +++ b/interfaces/ipc/src/del_white_list_infos_call_back_stub.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Copyright (c) 2021-2023 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 diff --git a/interfaces/ipc/src/distributed_input_sink_proxy.cpp b/interfaces/ipc/src/distributed_input_sink_proxy.cpp index 8b54876..4d4cce9 100644 --- a/interfaces/ipc/src/distributed_input_sink_proxy.cpp +++ b/interfaces/ipc/src/distributed_input_sink_proxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Copyright (c) 2021-2023 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 diff --git a/interfaces/ipc/src/distributed_input_source_proxy.cpp b/interfaces/ipc/src/distributed_input_source_proxy.cpp index 357e22a..35049c4 100644 --- a/interfaces/ipc/src/distributed_input_source_proxy.cpp +++ b/interfaces/ipc/src/distributed_input_source_proxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Copyright (c) 2021-2023 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 diff --git a/interfaces/ipc/src/get_sink_screen_infos_call_back_proxy.cpp b/interfaces/ipc/src/get_sink_screen_infos_call_back_proxy.cpp index 8170be6..23ca54c 100644 --- a/interfaces/ipc/src/get_sink_screen_infos_call_back_proxy.cpp +++ b/interfaces/ipc/src/get_sink_screen_infos_call_back_proxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 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 diff --git a/interfaces/ipc/src/get_sink_screen_infos_call_back_stub.cpp b/interfaces/ipc/src/get_sink_screen_infos_call_back_stub.cpp index 4f6d4c6..4c3a1d4 100644 --- a/interfaces/ipc/src/get_sink_screen_infos_call_back_stub.cpp +++ b/interfaces/ipc/src/get_sink_screen_infos_call_back_stub.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 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 diff --git a/interfaces/ipc/src/input_node_listener_proxy.cpp b/interfaces/ipc/src/input_node_listener_proxy.cpp index cc8a4f1..49f9473 100644 --- a/interfaces/ipc/src/input_node_listener_proxy.cpp +++ b/interfaces/ipc/src/input_node_listener_proxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 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 diff --git a/interfaces/ipc/src/input_node_listener_stub.cpp b/interfaces/ipc/src/input_node_listener_stub.cpp index aedb4c3..55f0be0 100644 --- a/interfaces/ipc/src/input_node_listener_stub.cpp +++ b/interfaces/ipc/src/input_node_listener_stub.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 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 diff --git a/interfaces/ipc/src/prepare_d_input_call_back_proxy.cpp b/interfaces/ipc/src/prepare_d_input_call_back_proxy.cpp index 0dce4d2..9760429 100644 --- a/interfaces/ipc/src/prepare_d_input_call_back_proxy.cpp +++ b/interfaces/ipc/src/prepare_d_input_call_back_proxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Copyright (c) 2021-2023 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 diff --git a/interfaces/ipc/src/prepare_d_input_call_back_stub.cpp b/interfaces/ipc/src/prepare_d_input_call_back_stub.cpp index 48b7f9c..9088117 100644 --- a/interfaces/ipc/src/prepare_d_input_call_back_stub.cpp +++ b/interfaces/ipc/src/prepare_d_input_call_back_stub.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Copyright (c) 2021-2023 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 diff --git a/interfaces/ipc/src/register_d_input_call_back_proxy.cpp b/interfaces/ipc/src/register_d_input_call_back_proxy.cpp index 7713a85..ae06b85 100644 --- a/interfaces/ipc/src/register_d_input_call_back_proxy.cpp +++ b/interfaces/ipc/src/register_d_input_call_back_proxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Copyright (c) 2021-2023 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 diff --git a/interfaces/ipc/src/register_d_input_call_back_stub.cpp b/interfaces/ipc/src/register_d_input_call_back_stub.cpp index d13404f..521b843 100644 --- a/interfaces/ipc/src/register_d_input_call_back_stub.cpp +++ b/interfaces/ipc/src/register_d_input_call_back_stub.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Copyright (c) 2021-2023 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 diff --git a/interfaces/ipc/src/sharing_dhid_listener_proxy.cpp b/interfaces/ipc/src/sharing_dhid_listener_proxy.cpp index 9af1fea..0e2185a 100644 --- a/interfaces/ipc/src/sharing_dhid_listener_proxy.cpp +++ b/interfaces/ipc/src/sharing_dhid_listener_proxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 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 diff --git a/interfaces/ipc/src/sharing_dhid_listener_stub.cpp b/interfaces/ipc/src/sharing_dhid_listener_stub.cpp index 38fdd61..eb109eb 100644 --- a/interfaces/ipc/src/sharing_dhid_listener_stub.cpp +++ b/interfaces/ipc/src/sharing_dhid_listener_stub.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 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 diff --git a/interfaces/ipc/src/simulation_event_listener_proxy.cpp b/interfaces/ipc/src/simulation_event_listener_proxy.cpp index 764d138..a07b1cd 100644 --- a/interfaces/ipc/src/simulation_event_listener_proxy.cpp +++ b/interfaces/ipc/src/simulation_event_listener_proxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 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 diff --git a/interfaces/ipc/src/simulation_event_listener_stub.cpp b/interfaces/ipc/src/simulation_event_listener_stub.cpp index 03733fb..55e7765 100644 --- a/interfaces/ipc/src/simulation_event_listener_stub.cpp +++ b/interfaces/ipc/src/simulation_event_listener_stub.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 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 diff --git a/interfaces/ipc/src/start_d_input_call_back_proxy.cpp b/interfaces/ipc/src/start_d_input_call_back_proxy.cpp index 3439dc1..c0744b0 100644 --- a/interfaces/ipc/src/start_d_input_call_back_proxy.cpp +++ b/interfaces/ipc/src/start_d_input_call_back_proxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Copyright (c) 2021-2023 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 diff --git a/interfaces/ipc/src/start_d_input_call_back_stub.cpp b/interfaces/ipc/src/start_d_input_call_back_stub.cpp index 9b2ce69..5d86233 100644 --- a/interfaces/ipc/src/start_d_input_call_back_stub.cpp +++ b/interfaces/ipc/src/start_d_input_call_back_stub.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Copyright (c) 2021-2023 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 diff --git a/interfaces/ipc/src/start_stop_d_inputs_call_back_proxy.cpp b/interfaces/ipc/src/start_stop_d_inputs_call_back_proxy.cpp index 7160db6..4267a73 100644 --- a/interfaces/ipc/src/start_stop_d_inputs_call_back_proxy.cpp +++ b/interfaces/ipc/src/start_stop_d_inputs_call_back_proxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 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 diff --git a/interfaces/ipc/src/start_stop_d_inputs_call_back_stub.cpp b/interfaces/ipc/src/start_stop_d_inputs_call_back_stub.cpp index d04a0de..a848132 100644 --- a/interfaces/ipc/src/start_stop_d_inputs_call_back_stub.cpp +++ b/interfaces/ipc/src/start_stop_d_inputs_call_back_stub.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 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 diff --git a/interfaces/ipc/src/start_stop_result_call_back_proxy.cpp b/interfaces/ipc/src/start_stop_result_call_back_proxy.cpp index 97b08ee..74bbcaf 100644 --- a/interfaces/ipc/src/start_stop_result_call_back_proxy.cpp +++ b/interfaces/ipc/src/start_stop_result_call_back_proxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 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 diff --git a/interfaces/ipc/src/start_stop_result_call_back_stub.cpp b/interfaces/ipc/src/start_stop_result_call_back_stub.cpp index 817369a..5ba7197 100644 --- a/interfaces/ipc/src/start_stop_result_call_back_stub.cpp +++ b/interfaces/ipc/src/start_stop_result_call_back_stub.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 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 diff --git a/interfaces/ipc/src/stop_d_input_call_back_proxy.cpp b/interfaces/ipc/src/stop_d_input_call_back_proxy.cpp index 056340f..68c622a 100644 --- a/interfaces/ipc/src/stop_d_input_call_back_proxy.cpp +++ b/interfaces/ipc/src/stop_d_input_call_back_proxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Copyright (c) 2021-2023 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 diff --git a/interfaces/ipc/src/stop_d_input_call_back_stub.cpp b/interfaces/ipc/src/stop_d_input_call_back_stub.cpp index a08ffff..42a5d8e 100644 --- a/interfaces/ipc/src/stop_d_input_call_back_stub.cpp +++ b/interfaces/ipc/src/stop_d_input_call_back_stub.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Copyright (c) 2021-2023 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 diff --git a/interfaces/ipc/src/unprepare_d_input_call_back_proxy.cpp b/interfaces/ipc/src/unprepare_d_input_call_back_proxy.cpp index 48f04ea..2eeb16c 100644 --- a/interfaces/ipc/src/unprepare_d_input_call_back_proxy.cpp +++ b/interfaces/ipc/src/unprepare_d_input_call_back_proxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Copyright (c) 2021-2023 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 diff --git a/interfaces/ipc/src/unprepare_d_input_call_back_stub.cpp b/interfaces/ipc/src/unprepare_d_input_call_back_stub.cpp index 5e780a9..812c30d 100644 --- a/interfaces/ipc/src/unprepare_d_input_call_back_stub.cpp +++ b/interfaces/ipc/src/unprepare_d_input_call_back_stub.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Copyright (c) 2021-2023 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 diff --git a/interfaces/ipc/src/unregister_d_input_call_back_proxy.cpp b/interfaces/ipc/src/unregister_d_input_call_back_proxy.cpp index 60b7f33..11d615a 100644 --- a/interfaces/ipc/src/unregister_d_input_call_back_proxy.cpp +++ b/interfaces/ipc/src/unregister_d_input_call_back_proxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Copyright (c) 2021-2023 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 diff --git a/interfaces/ipc/src/unregister_d_input_call_back_stub.cpp b/interfaces/ipc/src/unregister_d_input_call_back_stub.cpp index 3af8622..5a43df9 100644 --- a/interfaces/ipc/src/unregister_d_input_call_back_stub.cpp +++ b/interfaces/ipc/src/unregister_d_input_call_back_stub.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Copyright (c) 2021-2023 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 diff --git a/interfaces/ipc/test/dinputsourcecallbackunittest/dinput_source_callback_unittest.cpp b/interfaces/ipc/test/dinputsourcecallbackunittest/dinput_source_callback_unittest.cpp index 160762e..100fee7 100644 --- a/interfaces/ipc/test/dinputsourcecallbackunittest/dinput_source_callback_unittest.cpp +++ b/interfaces/ipc/test/dinputsourcecallbackunittest/dinput_source_callback_unittest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 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 -- Gitee From 40962479e853d57b7f2a1ada5ef5cf6384f65eae Mon Sep 17 00:00:00 2001 From: hwzhangchuang Date: Wed, 17 May 2023 19:40:09 +0800 Subject: [PATCH 4/6] modify Signed-off-by: hwzhangchuang --- common/include/dinput_ipc_interface_code.h | 87 ++----------------- .../add_white_list_infos_call_back_proxy.cpp | 3 +- .../add_white_list_infos_call_back_stub.cpp | 5 +- .../del_white_list_infos_call_back_proxy.cpp | 3 +- .../del_white_list_infos_call_back_stub.cpp | 7 +- .../src/distributed_input_source_proxy.cpp | 3 +- .../get_sink_screen_infos_call_back_proxy.cpp | 3 +- .../get_sink_screen_infos_call_back_stub.cpp | 7 +- .../ipc/src/input_node_listener_proxy.cpp | 7 +- .../ipc/src/input_node_listener_stub.cpp | 9 +- .../src/prepare_d_input_call_back_proxy.cpp | 3 +- .../src/prepare_d_input_call_back_stub.cpp | 7 +- .../src/register_d_input_call_back_proxy.cpp | 3 +- .../src/register_d_input_call_back_stub.cpp | 7 +- .../ipc/src/sharing_dhid_listener_proxy.cpp | 5 +- .../ipc/src/sharing_dhid_listener_stub.cpp | 9 +- .../src/simulation_event_listener_proxy.cpp | 5 +- .../src/simulation_event_listener_stub.cpp | 7 +- .../ipc/src/start_d_input_call_back_proxy.cpp | 3 +- .../ipc/src/start_d_input_call_back_stub.cpp | 7 +- .../start_stop_d_inputs_call_back_proxy.cpp | 3 +- .../start_stop_d_inputs_call_back_stub.cpp | 7 +- .../src/start_stop_result_call_back_proxy.cpp | 9 +- .../src/start_stop_result_call_back_stub.cpp | 9 +- .../ipc/src/stop_d_input_call_back_proxy.cpp | 5 +- .../ipc/src/stop_d_input_call_back_stub.cpp | 7 +- .../src/unprepare_d_input_call_back_proxy.cpp | 5 +- .../src/unprepare_d_input_call_back_stub.cpp | 7 +- .../unregister_d_input_call_back_proxy.cpp | 3 +- .../src/unregister_d_input_call_back_stub.cpp | 7 +- .../dinput_source_callback_unittest.cpp | 7 +- 31 files changed, 78 insertions(+), 181 deletions(-) diff --git a/common/include/dinput_ipc_interface_code.h b/common/include/dinput_ipc_interface_code.h index d3e1ba7..be71e68 100644 --- a/common/include/dinput_ipc_interface_code.h +++ b/common/include/dinput_ipc_interface_code.h @@ -20,26 +20,6 @@ namespace OHOS { namespace DistributedHardware { -/* SAID: 4809 */ -enum class IAddWhiteListInfosCBInterfaceCode : uint32_t { - RESULT = 0 -}; - -/* SAID: 4809 */ -enum class IDelWhiteListInfosCBInterfaceCode : uint32_t { - RESULT = 0 -}; - -/* SAID: 4810 */ -enum class IDInputSinkInterfaceCode : uint32_t { - INIT = 0xf011U, - RELEASE = 0xf012U, - NOTIFY_START_DSCREEN = 0xf013U, - NOTIFY_STOP_DSCREEN = 0xf014U, - REGISTER_SHARING_DHID_LISTENER = 0xf015U, - GET_SINK_SCREEN_INFOS = 0xf016U, -}; - /* SAID: 4809 */ enum class IDInputSourceInterfaceCode : uint32_t { INIT = 0xf001U, @@ -68,66 +48,13 @@ enum class IDInputSourceInterfaceCode : uint32_t { }; /* SAID: 4810 */ -enum class IGetSinkScreenInfosCBInterfaceCode : uint32_t { - RESULT = 0 -}; - -/* SAID: 4810 */ -enum class InputNodeListenerInterfaceCode : uint32_t { - RESULT_ON = 0, - RESULT_OFF = 1 -}; - -/* SAID: 4809 */ -enum class IPrepareDInputCBInterfaceCode : uint32_t { - RESULT = 0 -}; - -/* SAID: 4809 */ -enum class IRegisterDInputCBInterfaceCode : uint32_t { - RESULT = 0 -}; - -/* SAID: 4809 */ -enum class ISharingDhIdListenerInterfaceCode : uint32_t { - SHARING = 0, - NO_SHARING = 1 -}; - -/* SAID: 4809 */ -enum class ISimulationEventListenerInterfaceCode : uint32_t { - RESULT_ON = 0 -}; - -/* SAID: 4809 */ -enum class IStartDInputCBInterfaceCode : uint32_t { - RESULT = 0 -}; - -/* SAID: 4809 */ -enum class IStartStopDInputsCBInterfaceCode : uint32_t { - RESULT_STRING = 0 -}; - -/* SAID: 4809 */ -enum class IStartStopResultCBInterfaceCode : uint32_t { - RESULT_START = 0, - RESULT_STOP = 1 -}; - -/* SAID: 4809 */ -enum class IStopDInputCBInterfaceCode : uint32_t { - RESULT = 0 -}; - -/* SAID: 4809 */ -enum class IUnprepareDInputCBInterfaceCode : uint32_t { - RESULT = 0 -}; - -/* SAID: 4809 */ -enum class IUnregisterDInputCBInterfaceCode : uint32_t { - RESULT = 0 +enum class IDInputSinkInterfaceCode : uint32_t { + INIT = 0xf011U, + RELEASE = 0xf012U, + NOTIFY_START_DSCREEN = 0xf013U, + NOTIFY_STOP_DSCREEN = 0xf014U, + REGISTER_SHARING_DHID_LISTENER = 0xf015U, + GET_SINK_SCREEN_INFOS = 0xf016U, }; } // namespace DistributedHardware } // namespace OHOS diff --git a/interfaces/ipc/src/add_white_list_infos_call_back_proxy.cpp b/interfaces/ipc/src/add_white_list_infos_call_back_proxy.cpp index cc86e65..9ec6247 100644 --- a/interfaces/ipc/src/add_white_list_infos_call_back_proxy.cpp +++ b/interfaces/ipc/src/add_white_list_infos_call_back_proxy.cpp @@ -15,7 +15,6 @@ #include "add_white_list_infos_call_back_proxy.h" -#include "dinput_ipc_interface_code.h" #include "ipc_types.h" #include "parcel.h" @@ -55,7 +54,7 @@ void AddWhiteListInfosCallbackProxy::OnResult(const std::string& deviceId, const DHLOGE("AddWhiteListInfosCallbackProxy write strJson failed"); return; } - remote->SendRequest(static_cast(IAddWhiteListInfosCBInterfaceCode::RESULT), data, reply, option); + remote->SendRequest(static_cast(IAddWhiteListInfosCallback::Message::RESULT), data, reply, option); } } // namespace DistributedInput } // namespace DistributedHardware diff --git a/interfaces/ipc/src/add_white_list_infos_call_back_stub.cpp b/interfaces/ipc/src/add_white_list_infos_call_back_stub.cpp index ab7ecd4..0a9955e 100644 --- a/interfaces/ipc/src/add_white_list_infos_call_back_stub.cpp +++ b/interfaces/ipc/src/add_white_list_infos_call_back_stub.cpp @@ -19,7 +19,6 @@ #include "constants_dinput.h" #include "dinput_errcode.h" -#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { @@ -40,9 +39,9 @@ int32_t AddWhiteListInfosCallbackStub::OnRemoteRequest( DHLOGE("AddWhiteListInfosCallbackStub read token valid failed"); return ERR_DH_INPUT_IPC_READ_TOKEN_VALID_FAIL; } - IAddWhiteListInfosCBInterfaceCode msgCode = static_cast(code); + IAddWhiteListInfosCallback::Message msgCode = static_cast(code); switch (msgCode) { - case IAddWhiteListInfosCBInterfaceCode::RESULT: { + case IAddWhiteListInfosCallback::Message::RESULT: { std::string deviceId = data.ReadString(); std::string strJsion = data.ReadString(); OnResult(deviceId, strJsion); diff --git a/interfaces/ipc/src/del_white_list_infos_call_back_proxy.cpp b/interfaces/ipc/src/del_white_list_infos_call_back_proxy.cpp index ca35a43..4b1f715 100644 --- a/interfaces/ipc/src/del_white_list_infos_call_back_proxy.cpp +++ b/interfaces/ipc/src/del_white_list_infos_call_back_proxy.cpp @@ -15,7 +15,6 @@ #include "del_white_list_infos_call_back_proxy.h" -#include "dinput_ipc_interface_code.h" #include "ipc_types.h" #include "parcel.h" @@ -51,7 +50,7 @@ void DelWhiteListInfosCallbackProxy::OnResult(const std::string& deviceId) DHLOGE("DelWhiteListInfosCallbackProxy write deviceId failed"); return; } - remote->SendRequest(static_cast(IDelWhiteListInfosCBInterfaceCode::RESULT), data, reply, option); + remote->SendRequest(static_cast(IDelWhiteListInfosCallback::Message::RESULT), data, reply, option); } } // namespace DistributedInput } // namespace DistributedHardware diff --git a/interfaces/ipc/src/del_white_list_infos_call_back_stub.cpp b/interfaces/ipc/src/del_white_list_infos_call_back_stub.cpp index 39709c7..0c2b6b5 100644 --- a/interfaces/ipc/src/del_white_list_infos_call_back_stub.cpp +++ b/interfaces/ipc/src/del_white_list_infos_call_back_stub.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 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,7 +19,6 @@ #include "constants_dinput.h" #include "dinput_errcode.h" -#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { @@ -40,9 +39,9 @@ int32_t DelWhiteListInfosCallbackStub::OnRemoteRequest( DHLOGE("DelWhiteListInfosCallbackStub read token valid failed"); return ERR_DH_INPUT_IPC_READ_TOKEN_VALID_FAIL; } - IDelWhiteListInfosCBInterfaceCode msgCode = static_cast(code); + IDelWhiteListInfosCallback::Message msgCode = static_cast(code); switch (msgCode) { - case IDelWhiteListInfosCBInterfaceCode::RESULT: { + case IDelWhiteListInfosCallback::Message::RESULT: { std::string deviceId = data.ReadString(); OnResult(deviceId); break; diff --git a/interfaces/ipc/src/distributed_input_source_proxy.cpp b/interfaces/ipc/src/distributed_input_source_proxy.cpp index 35049c4..30981af 100644 --- a/interfaces/ipc/src/distributed_input_source_proxy.cpp +++ b/interfaces/ipc/src/distributed_input_source_proxy.cpp @@ -702,8 +702,7 @@ int32_t DistributedInputSourceProxy::UnregisterSimulationEventListener(sptr remote = Remote(); if (remote == nullptr) { diff --git a/interfaces/ipc/src/get_sink_screen_infos_call_back_proxy.cpp b/interfaces/ipc/src/get_sink_screen_infos_call_back_proxy.cpp index 23ca54c..30a77ca 100644 --- a/interfaces/ipc/src/get_sink_screen_infos_call_back_proxy.cpp +++ b/interfaces/ipc/src/get_sink_screen_infos_call_back_proxy.cpp @@ -18,7 +18,6 @@ #include "ipc_types.h" #include "parcel.h" -#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { @@ -51,7 +50,7 @@ void GetSinkScreenInfosCallbackProxy::OnResult(const std::string& strJson) DHLOGE("write strJson failed"); return; } - remote->SendRequest(static_cast(IGetSinkScreenInfosCBInterfaceCode::RESULT), data, reply, option); + remote->SendRequest(static_cast(IGetSinkScreenInfosCallback::Message::RESULT), data, reply, option); } } // namespace DistributedInput } // namespace DistributedHardware diff --git a/interfaces/ipc/src/get_sink_screen_infos_call_back_stub.cpp b/interfaces/ipc/src/get_sink_screen_infos_call_back_stub.cpp index 4c3a1d4..7537ec5 100644 --- a/interfaces/ipc/src/get_sink_screen_infos_call_back_stub.cpp +++ b/interfaces/ipc/src/get_sink_screen_infos_call_back_stub.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2022 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,7 +19,6 @@ #include "constants_dinput.h" #include "dinput_errcode.h" -#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { @@ -40,9 +39,9 @@ int32_t GetSinkScreenInfosCallbackStub::OnRemoteRequest( DHLOGE("GetSinkScreenInfosCallbackStub read token valid failed"); return ERR_DH_INPUT_IPC_READ_TOKEN_VALID_FAIL; } - IGetSinkScreenInfosCBInterfaceCode msgCode = static_cast(code); + IGetSinkScreenInfosCallback::Message msgCode = static_cast(code); switch (msgCode) { - case IGetSinkScreenInfosCBInterfaceCode::RESULT: { + case IGetSinkScreenInfosCallback::Message::RESULT: { std::string strJson = data.ReadString(); OnResult(strJson); break; diff --git a/interfaces/ipc/src/input_node_listener_proxy.cpp b/interfaces/ipc/src/input_node_listener_proxy.cpp index 49f9473..75e3497 100644 --- a/interfaces/ipc/src/input_node_listener_proxy.cpp +++ b/interfaces/ipc/src/input_node_listener_proxy.cpp @@ -18,7 +18,6 @@ #include "ipc_types.h" #include "parcel.h" -#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { @@ -62,7 +61,7 @@ void InputNodeListenerProxy::OnNodeOnLine(const std::string srcDevId, const std: DHLOGE("InputNodeListenerProxy write sinkNodeDesc failed"); return; } - int32_t ret = remote->SendRequest(static_cast(InputNodeListenerInterfaceCode::RESULT_ON), data, reply, + int32_t ret = remote->SendRequest(static_cast(InputNodeListener::Message::RESULT_ON), data, reply, option); if (ret != 0) { return; @@ -96,8 +95,8 @@ void InputNodeListenerProxy::OnNodeOffLine(const std::string srcDevId, const std DHLOGE("InputNodeListenerProxy write sinkNodeId failed"); return; } - int32_t ret = - remote->SendRequest(static_cast(InputNodeListenerInterfaceCode::RESULT_OFF), data, reply, option); + int32_t ret = remote->SendRequest(static_cast(InputNodeListener::Message::RESULT_OFF), data, reply, + option); if (ret != 0) { return; } diff --git a/interfaces/ipc/src/input_node_listener_stub.cpp b/interfaces/ipc/src/input_node_listener_stub.cpp index 55f0be0..348a42b 100644 --- a/interfaces/ipc/src/input_node_listener_stub.cpp +++ b/interfaces/ipc/src/input_node_listener_stub.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2022 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,7 +19,6 @@ #include "constants_dinput.h" #include "dinput_errcode.h" -#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { @@ -36,9 +35,9 @@ int32_t InputNodeListenerStub::OnRemoteRequest( DHLOGE("InputNodeListenerStub read token valid failed"); return ERR_DH_INPUT_IPC_READ_TOKEN_VALID_FAIL; } - InputNodeListenerInterfaceCode msgCode = static_cast(code); + InputNodeListener::Message msgCode = static_cast(code); switch (msgCode) { - case InputNodeListenerInterfaceCode::RESULT_ON: { + case InputNodeListener::Message::RESULT_ON: { std::string srcDevId = data.ReadString(); std::string sinkDevId = data.ReadString(); std::string sinkNodeId = data.ReadString(); @@ -46,7 +45,7 @@ int32_t InputNodeListenerStub::OnRemoteRequest( OnNodeOnLine(srcDevId, sinkDevId, sinkNodeId, sinkNodeDesc); break; } - case InputNodeListenerInterfaceCode::RESULT_OFF: { + case InputNodeListener::Message::RESULT_OFF: { std::string srcDevId = data.ReadString(); std::string sinkDevId = data.ReadString(); std::string sinkNodeId = data.ReadString(); diff --git a/interfaces/ipc/src/prepare_d_input_call_back_proxy.cpp b/interfaces/ipc/src/prepare_d_input_call_back_proxy.cpp index 9760429..e27c1ed 100644 --- a/interfaces/ipc/src/prepare_d_input_call_back_proxy.cpp +++ b/interfaces/ipc/src/prepare_d_input_call_back_proxy.cpp @@ -18,7 +18,6 @@ #include "ipc_types.h" #include "parcel.h" -#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { @@ -54,7 +53,7 @@ void PrepareDInputCallbackProxy::OnResult(const std::string& deviceId, const int return; } int32_t ret = remote->SendRequest( - static_cast(IPrepareDInputCBInterfaceCode::RESULT), data, reply, option); + static_cast(IPrepareDInputCallback::Message::RESULT), data, reply, option); if (ret != 0) { return; } diff --git a/interfaces/ipc/src/prepare_d_input_call_back_stub.cpp b/interfaces/ipc/src/prepare_d_input_call_back_stub.cpp index 9088117..0796aa4 100644 --- a/interfaces/ipc/src/prepare_d_input_call_back_stub.cpp +++ b/interfaces/ipc/src/prepare_d_input_call_back_stub.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 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,7 +19,6 @@ #include "constants_dinput.h" #include "dinput_errcode.h" -#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { @@ -40,9 +39,9 @@ int32_t PrepareDInputCallbackStub::OnRemoteRequest( DHLOGE("PrepareDInputCallbackStub read token valid failed"); return ERR_DH_INPUT_IPC_READ_TOKEN_VALID_FAIL; } - IPrepareDInputCBInterfaceCode msgCode = static_cast(code); + IPrepareDInputCallback::Message msgCode = static_cast(code); switch (msgCode) { - case IPrepareDInputCBInterfaceCode::RESULT: { + case IPrepareDInputCallback::Message::RESULT: { std::string deviceId = data.ReadString(); int32_t status = data.ReadInt32(); OnResult(deviceId, status); diff --git a/interfaces/ipc/src/register_d_input_call_back_proxy.cpp b/interfaces/ipc/src/register_d_input_call_back_proxy.cpp index ae06b85..92cfd45 100644 --- a/interfaces/ipc/src/register_d_input_call_back_proxy.cpp +++ b/interfaces/ipc/src/register_d_input_call_back_proxy.cpp @@ -18,7 +18,6 @@ #include "ipc_types.h" #include "parcel.h" -#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { @@ -57,7 +56,7 @@ void RegisterDInputCallbackProxy::OnResult(const std::string& devId, const std:: return; } int32_t ret = remote->SendRequest( - static_cast(IRegisterDInputCBInterfaceCode::RESULT), data, reply, option); + static_cast(IRegisterDInputCallback::Message::RESULT), data, reply, option); if (ret != 0) { return; } diff --git a/interfaces/ipc/src/register_d_input_call_back_stub.cpp b/interfaces/ipc/src/register_d_input_call_back_stub.cpp index 521b843..935c6ca 100644 --- a/interfaces/ipc/src/register_d_input_call_back_stub.cpp +++ b/interfaces/ipc/src/register_d_input_call_back_stub.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 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,7 +19,6 @@ #include "constants_dinput.h" #include "dinput_errcode.h" -#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { @@ -40,9 +39,9 @@ int32_t RegisterDInputCallbackStub::OnRemoteRequest( DHLOGE("RegisterDInputCallbackStub read token valid failed"); return ERR_DH_INPUT_IPC_READ_TOKEN_VALID_FAIL; } - IRegisterDInputCBInterfaceCode msgCode = static_cast(code); + IRegisterDInputCallback::Message msgCode = static_cast(code); switch (msgCode) { - case IRegisterDInputCBInterfaceCode::RESULT: { + case IRegisterDInputCallback::Message::RESULT: { std::string devId = data.ReadString(); std::string dhId = data.ReadString(); int32_t status = data.ReadInt32(); diff --git a/interfaces/ipc/src/sharing_dhid_listener_proxy.cpp b/interfaces/ipc/src/sharing_dhid_listener_proxy.cpp index 0e2185a..cca24ce 100644 --- a/interfaces/ipc/src/sharing_dhid_listener_proxy.cpp +++ b/interfaces/ipc/src/sharing_dhid_listener_proxy.cpp @@ -19,7 +19,6 @@ #include "parcel.h" #include "dinput_errcode.h" -#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { @@ -54,7 +53,7 @@ int32_t SharingDhIdListenerProxy::OnSharing(std::string dhId) } int32_t ret = - remote->SendRequest(static_cast(ISharingDhIdListenerInterfaceCode::SHARING), data, reply, option); + remote->SendRequest(static_cast(ISharingDhIdListener::Message::SHARING), data, reply, option); if (ret == DH_SUCCESS) { result = reply.ReadInt32(); } else { @@ -85,7 +84,7 @@ int32_t SharingDhIdListenerProxy::OnNoSharing(std::string dhId) } int32_t ret = - remote->SendRequest(static_cast(ISharingDhIdListenerInterfaceCode::NO_SHARING), data, reply, option); + remote->SendRequest(static_cast(ISharingDhIdListener::Message::NO_SHARING), data, reply, option); if (ret == DH_SUCCESS) { result = reply.ReadInt32(); } else { diff --git a/interfaces/ipc/src/sharing_dhid_listener_stub.cpp b/interfaces/ipc/src/sharing_dhid_listener_stub.cpp index eb109eb..4410adb 100644 --- a/interfaces/ipc/src/sharing_dhid_listener_stub.cpp +++ b/interfaces/ipc/src/sharing_dhid_listener_stub.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2022 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,7 +19,6 @@ #include "constants_dinput.h" #include "dinput_errcode.h" -#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { @@ -36,9 +35,9 @@ int32_t SharingDhIdListenerStub::OnRemoteRequest( DHLOGE("SharingDhIdListenerStub read token valid failed"); return ERR_DH_INPUT_IPC_READ_TOKEN_VALID_FAIL; } - ISharingDhIdListenerInterfaceCode msgCode = static_cast(code); + ISharingDhIdListener::Message msgCode = static_cast(code); switch (msgCode) { - case ISharingDhIdListenerInterfaceCode::SHARING: { + case ISharingDhIdListener::Message::SHARING: { std::string dhId = data.ReadString(); int32_t ret = OnSharing(dhId); if (!reply.WriteInt32(ret)) { @@ -47,7 +46,7 @@ int32_t SharingDhIdListenerStub::OnRemoteRequest( } break; } - case ISharingDhIdListenerInterfaceCode::NO_SHARING: { + case ISharingDhIdListener::Message::NO_SHARING: { std::string dhId = data.ReadString(); int32_t ret = OnNoSharing(dhId); if (!reply.WriteInt32(ret)) { diff --git a/interfaces/ipc/src/simulation_event_listener_proxy.cpp b/interfaces/ipc/src/simulation_event_listener_proxy.cpp index a07b1cd..3c6079e 100644 --- a/interfaces/ipc/src/simulation_event_listener_proxy.cpp +++ b/interfaces/ipc/src/simulation_event_listener_proxy.cpp @@ -19,7 +19,6 @@ #include "parcel.h" #include "dinput_errcode.h" -#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { @@ -60,8 +59,8 @@ int32_t SimulationEventListenerProxy::OnSimulationEvent(uint32_t type, uint32_t DHLOGE("SimulationEventListenerProxy write value failed"); return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL; } - int32_t ret = remote->SendRequest(static_cast(ISimulationEventListenerInterfaceCode::RESULT_ON), data, - reply, option); + int32_t ret = + remote->SendRequest(static_cast(ISimulationEventListener::Message::RESULT_ON), data, reply, option); if (ret == DH_SUCCESS) { result = reply.ReadInt32(); } else { diff --git a/interfaces/ipc/src/simulation_event_listener_stub.cpp b/interfaces/ipc/src/simulation_event_listener_stub.cpp index 55e7765..34b2b70 100644 --- a/interfaces/ipc/src/simulation_event_listener_stub.cpp +++ b/interfaces/ipc/src/simulation_event_listener_stub.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2022 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,7 +19,6 @@ #include "constants_dinput.h" #include "dinput_errcode.h" -#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { @@ -36,9 +35,9 @@ int32_t SimulationEventListenerStub::OnRemoteRequest( DHLOGE("SimulationEventListenerStub read token valid failed"); return ERR_DH_INPUT_IPC_READ_TOKEN_VALID_FAIL; } - ISimulationEventListenerInterfaceCode msgCode = static_cast(code); + ISimulationEventListener::Message msgCode = static_cast(code); switch (msgCode) { - case ISimulationEventListenerInterfaceCode::RESULT_ON: { + case ISimulationEventListener::Message::RESULT_ON: { uint32_t eventType = data.ReadUint32(); uint32_t eventCode = data.ReadUint32(); int32_t eventValue = data.ReadInt32(); diff --git a/interfaces/ipc/src/start_d_input_call_back_proxy.cpp b/interfaces/ipc/src/start_d_input_call_back_proxy.cpp index c0744b0..de77a25 100644 --- a/interfaces/ipc/src/start_d_input_call_back_proxy.cpp +++ b/interfaces/ipc/src/start_d_input_call_back_proxy.cpp @@ -18,7 +18,6 @@ #include "ipc_types.h" #include "parcel.h" -#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { @@ -60,7 +59,7 @@ void StartDInputCallbackProxy::OnResult(const std::string& devId, const uint32_t return; } int32_t ret = remote->SendRequest( - static_cast(IStartDInputCBInterfaceCode::RESULT), data, reply, option); + static_cast(IStartDInputCallback::Message::RESULT), data, reply, option); if (ret != 0) { return; } diff --git a/interfaces/ipc/src/start_d_input_call_back_stub.cpp b/interfaces/ipc/src/start_d_input_call_back_stub.cpp index 5d86233..b9243b1 100644 --- a/interfaces/ipc/src/start_d_input_call_back_stub.cpp +++ b/interfaces/ipc/src/start_d_input_call_back_stub.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 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,7 +19,6 @@ #include "constants_dinput.h" #include "dinput_errcode.h" -#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { @@ -40,9 +39,9 @@ int32_t StartDInputCallbackStub::OnRemoteRequest( DHLOGE("StartDInputCallbackStub read token valid failed"); return ERR_DH_INPUT_IPC_READ_TOKEN_VALID_FAIL; } - IStartDInputCBInterfaceCode msgCode = static_cast(code); + IStartDInputCallback::Message msgCode = static_cast(code); switch (msgCode) { - case IStartDInputCBInterfaceCode::RESULT: { + case IStartDInputCallback::Message::RESULT: { std::string deviceId = data.ReadString(); uint32_t inputTypes = data.ReadUint32(); int32_t status = data.ReadInt32(); diff --git a/interfaces/ipc/src/start_stop_d_inputs_call_back_proxy.cpp b/interfaces/ipc/src/start_stop_d_inputs_call_back_proxy.cpp index 4267a73..6660f52 100644 --- a/interfaces/ipc/src/start_stop_d_inputs_call_back_proxy.cpp +++ b/interfaces/ipc/src/start_stop_d_inputs_call_back_proxy.cpp @@ -18,7 +18,6 @@ #include "ipc_types.h" #include "parcel.h" -#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { @@ -53,7 +52,7 @@ void StartStopDInputsCallbackProxy::OnResultDhids(const std::string &devId, cons DHLOGE("StartStopDInputsCallbackProxy write status valid failed"); return; } - int32_t ret = remote->SendRequest(static_cast(IStartStopDInputsCBInterfaceCode::RESULT_STRING), + int32_t ret = remote->SendRequest(static_cast(IStartStopDInputsCallback::Message::RESULT_STRING), data, reply, option); if (ret != 0) { DHLOGE("OnResultDhids error, ret = %d", ret); diff --git a/interfaces/ipc/src/start_stop_d_inputs_call_back_stub.cpp b/interfaces/ipc/src/start_stop_d_inputs_call_back_stub.cpp index a848132..748b7a6 100644 --- a/interfaces/ipc/src/start_stop_d_inputs_call_back_stub.cpp +++ b/interfaces/ipc/src/start_stop_d_inputs_call_back_stub.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2022 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,7 +19,6 @@ #include "constants_dinput.h" #include "dinput_errcode.h" -#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { @@ -36,9 +35,9 @@ int32_t StartStopDInputsCallbackStub::OnRemoteRequest( if (descriptor != IStartStopDInputsCallback::GetDescriptor()) { return ERR_DH_INPUT_IPC_INVALID_DESCRIPTOR; } - IStartStopDInputsCBInterfaceCode msgCode = static_cast(code); + IStartStopDInputsCallback::Message msgCode = static_cast(code); switch (msgCode) { - case IStartStopDInputsCBInterfaceCode::RESULT_STRING: { + case IStartStopDInputsCallback::Message::RESULT_STRING: { std::string devId = data.ReadString(); int32_t status = data.ReadInt32(); DHLOGW("OnResultDhids received."); diff --git a/interfaces/ipc/src/start_stop_result_call_back_proxy.cpp b/interfaces/ipc/src/start_stop_result_call_back_proxy.cpp index 74bbcaf..c0bb5e4 100644 --- a/interfaces/ipc/src/start_stop_result_call_back_proxy.cpp +++ b/interfaces/ipc/src/start_stop_result_call_back_proxy.cpp @@ -17,7 +17,6 @@ #include "parcel.h" #include "dinput_errcode.h" -#include "dinput_ipc_interface_code.h" #include "dinput_log.h" #include "start_stop_result_call_back_proxy.h" @@ -67,8 +66,8 @@ void StartStopResultCallbackProxy::OnStart( } } - int32_t ret = - remote->SendRequest(static_cast(IStartStopResultCBInterfaceCode::RESULT_START), data, reply, option); + int32_t ret = remote->SendRequest(static_cast(IStartStopResultCallback::Message::RESULT_START), data, + reply, option); if (ret != 0) { DHLOGE("StartStopResultCallbackProxy SendRequest errno:%d", ret); return; @@ -112,8 +111,8 @@ void StartStopResultCallbackProxy::OnStop( } } - int32_t ret = - remote->SendRequest(static_cast(IStartStopResultCBInterfaceCode::RESULT_STOP), data, reply, option); + int32_t ret = remote->SendRequest(static_cast(IStartStopResultCallback::Message::RESULT_STOP), data, + reply, option); if (ret != 0) { DHLOGE("StartStopResultCallbackProxy SendRequest errno:%d", ret); return; diff --git a/interfaces/ipc/src/start_stop_result_call_back_stub.cpp b/interfaces/ipc/src/start_stop_result_call_back_stub.cpp index 5ba7197..5c41b09 100644 --- a/interfaces/ipc/src/start_stop_result_call_back_stub.cpp +++ b/interfaces/ipc/src/start_stop_result_call_back_stub.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2022 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,7 +19,6 @@ #include "constants_dinput.h" #include "dinput_errcode.h" -#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { @@ -36,9 +35,9 @@ int32_t StartStopResultCallbackStub::OnRemoteRequest( if (descriptor != IStartStopResultCallback::GetDescriptor()) { return ERR_DH_INPUT_IPC_INVALID_DESCRIPTOR; } - IStartStopResultCBInterfaceCode msgCode = static_cast(code); + IStartStopResultCallback::Message msgCode = static_cast(code); switch (msgCode) { - case IStartStopResultCBInterfaceCode::RESULT_START: { + case IStartStopResultCallback::Message::RESULT_START: { std::string srcId = data.ReadString(); std::string sinkId = data.ReadString(); uint32_t size = data.ReadUint32(); @@ -55,7 +54,7 @@ int32_t StartStopResultCallbackStub::OnRemoteRequest( OnStart(srcId, sinkId, dhIds); break; } - case IStartStopResultCBInterfaceCode::RESULT_STOP: { + case IStartStopResultCallback::Message::RESULT_STOP: { std::string srcId = data.ReadString(); std::string sinkId = data.ReadString(); uint32_t size = data.ReadUint32(); diff --git a/interfaces/ipc/src/stop_d_input_call_back_proxy.cpp b/interfaces/ipc/src/stop_d_input_call_back_proxy.cpp index 68c622a..dd787fd 100644 --- a/interfaces/ipc/src/stop_d_input_call_back_proxy.cpp +++ b/interfaces/ipc/src/stop_d_input_call_back_proxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 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 @@ -18,7 +18,6 @@ #include "ipc_types.h" #include "parcel.h" -#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { @@ -60,7 +59,7 @@ void StopDInputCallbackProxy::OnResult(const std::string& devId, const uint32_t& return; } int32_t ret = remote->SendRequest( - static_cast(IStopDInputCBInterfaceCode::RESULT), data, reply, option); + static_cast(IStopDInputCallback::Message::RESULT), data, reply, option); if (ret != 0) { return; } diff --git a/interfaces/ipc/src/stop_d_input_call_back_stub.cpp b/interfaces/ipc/src/stop_d_input_call_back_stub.cpp index 42a5d8e..64f8d5f 100644 --- a/interfaces/ipc/src/stop_d_input_call_back_stub.cpp +++ b/interfaces/ipc/src/stop_d_input_call_back_stub.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 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,7 +19,6 @@ #include "constants_dinput.h" #include "dinput_errcode.h" -#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { @@ -40,9 +39,9 @@ int32_t StopDInputCallbackStub::OnRemoteRequest( DHLOGE("StopDInputCallbackStub read token valid failed"); return ERR_DH_INPUT_IPC_READ_TOKEN_VALID_FAIL; } - IStopDInputCBInterfaceCode msgCode = static_cast(code); + IStopDInputCallback::Message msgCode = static_cast(code); switch (msgCode) { - case IStopDInputCBInterfaceCode::RESULT: { + case IStopDInputCallback::Message::RESULT: { std::string deviceId = data.ReadString(); uint32_t inputTypes = data.ReadUint32(); int32_t status = data.ReadInt32(); diff --git a/interfaces/ipc/src/unprepare_d_input_call_back_proxy.cpp b/interfaces/ipc/src/unprepare_d_input_call_back_proxy.cpp index 2eeb16c..ede240e 100644 --- a/interfaces/ipc/src/unprepare_d_input_call_back_proxy.cpp +++ b/interfaces/ipc/src/unprepare_d_input_call_back_proxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 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 @@ -18,7 +18,6 @@ #include "ipc_types.h" #include "parcel.h" -#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { @@ -56,7 +55,7 @@ void UnprepareDInputCallbackProxy::OnResult(const std::string& deviceId, const i return; } int32_t ret = remote->SendRequest( - static_cast(IUnprepareDInputCBInterfaceCode::RESULT), data, reply, option); + static_cast(IUnprepareDInputCallback::Message::RESULT), data, reply, option); if (ret != 0) { return; } diff --git a/interfaces/ipc/src/unprepare_d_input_call_back_stub.cpp b/interfaces/ipc/src/unprepare_d_input_call_back_stub.cpp index 812c30d..f248c93 100644 --- a/interfaces/ipc/src/unprepare_d_input_call_back_stub.cpp +++ b/interfaces/ipc/src/unprepare_d_input_call_back_stub.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 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,7 +19,6 @@ #include "constants_dinput.h" #include "dinput_errcode.h" -#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { @@ -40,9 +39,9 @@ int32_t UnprepareDInputCallbackStub::OnRemoteRequest( DHLOGE("UnprepareDInputCallbackStub read token valid failed"); return ERR_DH_INPUT_IPC_READ_TOKEN_VALID_FAIL; } - IUnprepareDInputCBInterfaceCode msgCode = static_cast(code); + IUnprepareDInputCallback::Message msgCode = static_cast(code); switch (msgCode) { - case IUnprepareDInputCBInterfaceCode::RESULT: { + case IUnprepareDInputCallback::Message::RESULT: { std::string deviceId = data.ReadString(); int32_t status = data.ReadInt32(); OnResult(deviceId, status); diff --git a/interfaces/ipc/src/unregister_d_input_call_back_proxy.cpp b/interfaces/ipc/src/unregister_d_input_call_back_proxy.cpp index 11d615a..d6e9b49 100644 --- a/interfaces/ipc/src/unregister_d_input_call_back_proxy.cpp +++ b/interfaces/ipc/src/unregister_d_input_call_back_proxy.cpp @@ -18,7 +18,6 @@ #include "ipc_types.h" #include "parcel.h" -#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { @@ -60,7 +59,7 @@ void UnregisterDInputCallbackProxy::OnResult(const std::string& devId, const std return; } int32_t ret = remote->SendRequest( - static_cast(IUnregisterDInputCBInterfaceCode::RESULT), data, reply, option); + static_cast(IUnregisterDInputCallback::Message::RESULT), data, reply, option); if (ret != 0) { return; } diff --git a/interfaces/ipc/src/unregister_d_input_call_back_stub.cpp b/interfaces/ipc/src/unregister_d_input_call_back_stub.cpp index 5a43df9..6270c3c 100644 --- a/interfaces/ipc/src/unregister_d_input_call_back_stub.cpp +++ b/interfaces/ipc/src/unregister_d_input_call_back_stub.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 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,7 +19,6 @@ #include "constants_dinput.h" #include "dinput_errcode.h" -#include "dinput_ipc_interface_code.h" #include "dinput_log.h" namespace OHOS { @@ -40,9 +39,9 @@ int32_t UnregisterDInputCallbackStub::OnRemoteRequest( DHLOGE("UnregisterDInputCallbackStub read token valid failed"); return ERR_DH_INPUT_IPC_READ_TOKEN_VALID_FAIL; } - IUnregisterDInputCBInterfaceCode msgCode = static_cast(code); + IUnregisterDInputCallback::Message msgCode = static_cast(code); switch (msgCode) { - case IUnregisterDInputCBInterfaceCode::RESULT: { + case IUnregisterDInputCallback::Message::RESULT: { std::string devId = data.ReadString(); std::string dhId = data.ReadString(); int32_t status = data.ReadInt32(); diff --git a/interfaces/ipc/test/dinputsourcecallbackunittest/dinput_source_callback_unittest.cpp b/interfaces/ipc/test/dinputsourcecallbackunittest/dinput_source_callback_unittest.cpp index 100fee7..836b349 100644 --- a/interfaces/ipc/test/dinputsourcecallbackunittest/dinput_source_callback_unittest.cpp +++ b/interfaces/ipc/test/dinputsourcecallbackunittest/dinput_source_callback_unittest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2022 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,7 +17,6 @@ #include #include "dinput_errcode.h" -#include "dinput_ipc_interface_code.h" namespace OHOS { namespace DistributedHardware { @@ -353,10 +352,10 @@ HWTEST_F(DInputSourceCallBackTest, SendRequest01, testing::ext::TestSize.Level1) { sptr callBackStubPtr = new TestDInputSourceCallBackStub(); DistributedInputSourceProxy callBackProxy(callBackStubPtr); - IDInputSourceInterfaceCode code = IDInputSourceInterfaceCode::INIT; + IDistributedSourceInput::MessageCode code = IDistributedSourceInput::MessageCode::INIT; MessageParcel data; MessageParcel reply; - bool ret = callBackProxy.SendRequest(static_cast(code), data, reply); + bool ret = callBackProxy.SendRequest(code, data, reply); EXPECT_EQ(false, ret); } -- Gitee From 46f060d137a20fac5369c842ee34490e3360772f Mon Sep 17 00:00:00 2001 From: hwzhangchuang Date: Wed, 17 May 2023 19:55:57 +0800 Subject: [PATCH 5/6] modify Signed-off-by: hwzhangchuang --- interfaces/ipc/src/add_white_list_infos_call_back_stub.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interfaces/ipc/src/add_white_list_infos_call_back_stub.cpp b/interfaces/ipc/src/add_white_list_infos_call_back_stub.cpp index 0a9955e..622f166 100644 --- a/interfaces/ipc/src/add_white_list_infos_call_back_stub.cpp +++ b/interfaces/ipc/src/add_white_list_infos_call_back_stub.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 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 -- Gitee From 1c4be0fbd78ebd099388615ac8a3b1bbf432bd07 Mon Sep 17 00:00:00 2001 From: hwzhangchuang Date: Wed, 17 May 2023 20:42:02 +0800 Subject: [PATCH 6/6] modify Signed-off-by: hwzhangchuang --- .../dinput_source_callback_unittest.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/interfaces/ipc/test/dinputsourcecallbackunittest/dinput_source_callback_unittest.cpp b/interfaces/ipc/test/dinputsourcecallbackunittest/dinput_source_callback_unittest.cpp index 836b349..160762e 100644 --- a/interfaces/ipc/test/dinputsourcecallbackunittest/dinput_source_callback_unittest.cpp +++ b/interfaces/ipc/test/dinputsourcecallbackunittest/dinput_source_callback_unittest.cpp @@ -17,6 +17,7 @@ #include #include "dinput_errcode.h" +#include "dinput_ipc_interface_code.h" namespace OHOS { namespace DistributedHardware { @@ -352,10 +353,10 @@ HWTEST_F(DInputSourceCallBackTest, SendRequest01, testing::ext::TestSize.Level1) { sptr callBackStubPtr = new TestDInputSourceCallBackStub(); DistributedInputSourceProxy callBackProxy(callBackStubPtr); - IDistributedSourceInput::MessageCode code = IDistributedSourceInput::MessageCode::INIT; + IDInputSourceInterfaceCode code = IDInputSourceInterfaceCode::INIT; MessageParcel data; MessageParcel reply; - bool ret = callBackProxy.SendRequest(code, data, reply); + bool ret = callBackProxy.SendRequest(static_cast(code), data, reply); EXPECT_EQ(false, ret); } -- Gitee