mirror of
https://github.com/openharmony/distributedhardware_distributed_input.git
synced 2026-07-19 17:43:35 -04:00
@@ -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
|
||||
|
||||
@@ -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<uint32_t>(IAddWhiteListInfosCBInterfaceCode::RESULT), data, reply, option);
|
||||
remote->SendRequest(static_cast<uint32_t>(IAddWhiteListInfosCallback::Message::RESULT), data, reply, option);
|
||||
}
|
||||
} // namespace DistributedInput
|
||||
} // namespace DistributedHardware
|
||||
|
||||
@@ -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<IAddWhiteListInfosCBInterfaceCode>(code);
|
||||
IAddWhiteListInfosCallback::Message msgCode = static_cast<IAddWhiteListInfosCallback::Message>(code);
|
||||
switch (msgCode) {
|
||||
case IAddWhiteListInfosCBInterfaceCode::RESULT: {
|
||||
case IAddWhiteListInfosCallback::Message::RESULT: {
|
||||
std::string deviceId = data.ReadString();
|
||||
std::string strJsion = data.ReadString();
|
||||
OnResult(deviceId, strJsion);
|
||||
|
||||
@@ -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<uint32_t>(IDelWhiteListInfosCBInterfaceCode::RESULT), data, reply, option);
|
||||
remote->SendRequest(static_cast<uint32_t>(IDelWhiteListInfosCallback::Message::RESULT), data, reply, option);
|
||||
}
|
||||
} // namespace DistributedInput
|
||||
} // namespace DistributedHardware
|
||||
|
||||
@@ -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<IDelWhiteListInfosCBInterfaceCode>(code);
|
||||
IDelWhiteListInfosCallback::Message msgCode = static_cast<IDelWhiteListInfosCallback::Message>(code);
|
||||
switch (msgCode) {
|
||||
case IDelWhiteListInfosCBInterfaceCode::RESULT: {
|
||||
case IDelWhiteListInfosCallback::Message::RESULT: {
|
||||
std::string deviceId = data.ReadString();
|
||||
OnResult(deviceId);
|
||||
break;
|
||||
|
||||
@@ -702,8 +702,7 @@ int32_t DistributedInputSourceProxy::UnregisterSimulationEventListener(sptr<ISim
|
||||
return result;
|
||||
}
|
||||
|
||||
bool DistributedInputSourceProxy::SendRequest(const uint32_t code, MessageParcel &data,
|
||||
MessageParcel &reply)
|
||||
bool DistributedInputSourceProxy::SendRequest(const uint32_t code, MessageParcel &data, MessageParcel &reply)
|
||||
{
|
||||
sptr<IRemoteObject> remote = Remote();
|
||||
if (remote == nullptr) {
|
||||
|
||||
@@ -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<uint32_t>(IGetSinkScreenInfosCBInterfaceCode::RESULT), data, reply, option);
|
||||
remote->SendRequest(static_cast<uint32_t>(IGetSinkScreenInfosCallback::Message::RESULT), data, reply, option);
|
||||
}
|
||||
} // namespace DistributedInput
|
||||
} // namespace DistributedHardware
|
||||
|
||||
@@ -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<IGetSinkScreenInfosCBInterfaceCode>(code);
|
||||
IGetSinkScreenInfosCallback::Message msgCode = static_cast<IGetSinkScreenInfosCallback::Message>(code);
|
||||
switch (msgCode) {
|
||||
case IGetSinkScreenInfosCBInterfaceCode::RESULT: {
|
||||
case IGetSinkScreenInfosCallback::Message::RESULT: {
|
||||
std::string strJson = data.ReadString();
|
||||
OnResult(strJson);
|
||||
break;
|
||||
|
||||
@@ -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<uint32_t>(InputNodeListenerInterfaceCode::RESULT_ON), data, reply,
|
||||
int32_t ret = remote->SendRequest(static_cast<uint32_t>(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<uint32_t>(InputNodeListenerInterfaceCode::RESULT_OFF), data, reply, option);
|
||||
int32_t ret = remote->SendRequest(static_cast<uint32_t>(InputNodeListener::Message::RESULT_OFF), data, reply,
|
||||
option);
|
||||
if (ret != 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -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<InputNodeListenerInterfaceCode>(code);
|
||||
InputNodeListener::Message msgCode = static_cast<InputNodeListener::Message>(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();
|
||||
|
||||
@@ -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<uint32_t>(IPrepareDInputCBInterfaceCode::RESULT), data, reply, option);
|
||||
static_cast<uint32_t>(IPrepareDInputCallback::Message::RESULT), data, reply, option);
|
||||
if (ret != 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -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<IPrepareDInputCBInterfaceCode>(code);
|
||||
IPrepareDInputCallback::Message msgCode = static_cast<IPrepareDInputCallback::Message>(code);
|
||||
switch (msgCode) {
|
||||
case IPrepareDInputCBInterfaceCode::RESULT: {
|
||||
case IPrepareDInputCallback::Message::RESULT: {
|
||||
std::string deviceId = data.ReadString();
|
||||
int32_t status = data.ReadInt32();
|
||||
OnResult(deviceId, status);
|
||||
|
||||
@@ -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<uint32_t>(IRegisterDInputCBInterfaceCode::RESULT), data, reply, option);
|
||||
static_cast<uint32_t>(IRegisterDInputCallback::Message::RESULT), data, reply, option);
|
||||
if (ret != 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -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<IRegisterDInputCBInterfaceCode>(code);
|
||||
IRegisterDInputCallback::Message msgCode = static_cast<IRegisterDInputCallback::Message>(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();
|
||||
|
||||
@@ -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<uint32_t>(ISharingDhIdListenerInterfaceCode::SHARING), data, reply, option);
|
||||
remote->SendRequest(static_cast<uint32_t>(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<uint32_t>(ISharingDhIdListenerInterfaceCode::NO_SHARING), data, reply, option);
|
||||
remote->SendRequest(static_cast<uint32_t>(ISharingDhIdListener::Message::NO_SHARING), data, reply, option);
|
||||
if (ret == DH_SUCCESS) {
|
||||
result = reply.ReadInt32();
|
||||
} else {
|
||||
|
||||
@@ -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<ISharingDhIdListenerInterfaceCode>(code);
|
||||
ISharingDhIdListener::Message msgCode = static_cast<ISharingDhIdListener::Message>(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)) {
|
||||
|
||||
@@ -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<uint32_t>(ISimulationEventListenerInterfaceCode::RESULT_ON), data,
|
||||
reply, option);
|
||||
int32_t ret =
|
||||
remote->SendRequest(static_cast<uint32_t>(ISimulationEventListener::Message::RESULT_ON), data, reply, option);
|
||||
if (ret == DH_SUCCESS) {
|
||||
result = reply.ReadInt32();
|
||||
} else {
|
||||
|
||||
@@ -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<ISimulationEventListenerInterfaceCode>(code);
|
||||
ISimulationEventListener::Message msgCode = static_cast<ISimulationEventListener::Message>(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();
|
||||
|
||||
@@ -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<uint32_t>(IStartDInputCBInterfaceCode::RESULT), data, reply, option);
|
||||
static_cast<uint32_t>(IStartDInputCallback::Message::RESULT), data, reply, option);
|
||||
if (ret != 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -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<IStartDInputCBInterfaceCode>(code);
|
||||
IStartDInputCallback::Message msgCode = static_cast<IStartDInputCallback::Message>(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();
|
||||
|
||||
@@ -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<uint32_t>(IStartStopDInputsCBInterfaceCode::RESULT_STRING),
|
||||
int32_t ret = remote->SendRequest(static_cast<uint32_t>(IStartStopDInputsCallback::Message::RESULT_STRING),
|
||||
data, reply, option);
|
||||
if (ret != 0) {
|
||||
DHLOGE("OnResultDhids error, ret = %d", ret);
|
||||
|
||||
@@ -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<IStartStopDInputsCBInterfaceCode>(code);
|
||||
IStartStopDInputsCallback::Message msgCode = static_cast<IStartStopDInputsCallback::Message>(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.");
|
||||
|
||||
@@ -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<uint32_t>(IStartStopResultCBInterfaceCode::RESULT_START), data, reply, option);
|
||||
int32_t ret = remote->SendRequest(static_cast<uint32_t>(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<uint32_t>(IStartStopResultCBInterfaceCode::RESULT_STOP), data, reply, option);
|
||||
int32_t ret = remote->SendRequest(static_cast<uint32_t>(IStartStopResultCallback::Message::RESULT_STOP), data,
|
||||
reply, option);
|
||||
if (ret != 0) {
|
||||
DHLOGE("StartStopResultCallbackProxy SendRequest errno:%d", ret);
|
||||
return;
|
||||
|
||||
@@ -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<IStartStopResultCBInterfaceCode>(code);
|
||||
IStartStopResultCallback::Message msgCode = static_cast<IStartStopResultCallback::Message>(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();
|
||||
|
||||
@@ -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<uint32_t>(IStopDInputCBInterfaceCode::RESULT), data, reply, option);
|
||||
static_cast<int32_t>(IStopDInputCallback::Message::RESULT), data, reply, option);
|
||||
if (ret != 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -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<IStopDInputCBInterfaceCode>(code);
|
||||
IStopDInputCallback::Message msgCode = static_cast<IStopDInputCallback::Message>(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();
|
||||
|
||||
@@ -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<uint32_t>(IUnprepareDInputCBInterfaceCode::RESULT), data, reply, option);
|
||||
static_cast<int32_t>(IUnprepareDInputCallback::Message::RESULT), data, reply, option);
|
||||
if (ret != 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -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<IUnprepareDInputCBInterfaceCode>(code);
|
||||
IUnprepareDInputCallback::Message msgCode = static_cast<IUnprepareDInputCallback::Message>(code);
|
||||
switch (msgCode) {
|
||||
case IUnprepareDInputCBInterfaceCode::RESULT: {
|
||||
case IUnprepareDInputCallback::Message::RESULT: {
|
||||
std::string deviceId = data.ReadString();
|
||||
int32_t status = data.ReadInt32();
|
||||
OnResult(deviceId, status);
|
||||
|
||||
@@ -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<uint32_t>(IUnregisterDInputCBInterfaceCode::RESULT), data, reply, option);
|
||||
static_cast<uint32_t>(IUnregisterDInputCallback::Message::RESULT), data, reply, option);
|
||||
if (ret != 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -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<IUnregisterDInputCBInterfaceCode>(code);
|
||||
IUnregisterDInputCallback::Message msgCode = static_cast<IUnregisterDInputCallback::Message>(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();
|
||||
|
||||
+3
-4
@@ -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 <memory>
|
||||
#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<IRemoteObject> 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<uint32_t>(code), data, reply);
|
||||
bool ret = callBackProxy.SendRequest(code, data, reply);
|
||||
EXPECT_EQ(false, ret);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user