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); }