mirror of
https://github.com/openharmony/distributedhardware_distributed_input.git
synced 2026-07-19 17:43:35 -04:00
Description:fix token valid bug
Match-id-23cc50d9e40acb73c89c208078e09a40466a5639
This commit is contained in:
@@ -116,6 +116,8 @@ namespace DistributedInput {
|
||||
constexpr int32_t ERR_DH_INPUT_SOURCE_PROXY_STOP_FAIL = -67026;
|
||||
constexpr int32_t ERR_DH_INPUT_SOURCE_PROXY_IS_START_INPUT_FAIL = -67027;
|
||||
constexpr int32_t ERR_DH_INPUT_SOURCE_STUB_ON_REMOTE_REQUEST_FAIL = -67028;
|
||||
constexpr int32_t ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL = -67029;
|
||||
constexpr int32_t ERR_DH_INPUT_IPC_READ_TOKEN_VALID_FAIL = -67030;
|
||||
|
||||
// Hidump Helper error code
|
||||
constexpr int32_t ERR_DH_INPUT_HIDUMP_INVALID_ARGS = -68000;
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
#include "add_white_list_infos_call_back_proxy.h"
|
||||
|
||||
#include "distributed_hardware_log.h"
|
||||
#include "ipc_types.h"
|
||||
#include "parcel.h"
|
||||
|
||||
@@ -40,11 +41,16 @@ void AddWhiteListInfosCallbackProxy::OnResult(const std::string& deviceId, const
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
data.WriteInterfaceToken(IAddWhiteListInfosCallback::GetDescriptor());
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
DHLOGE("AddWhiteListInfosCallbackProxy write token valid failed");
|
||||
return;
|
||||
}
|
||||
if (!data.WriteString(deviceId)) {
|
||||
DHLOGE("AddWhiteListInfosCallbackProxy write deviceId failed");
|
||||
return;
|
||||
}
|
||||
if (!data.WriteString(strJson)) {
|
||||
DHLOGE("AddWhiteListInfosCallbackProxy write strJson failed");
|
||||
return;
|
||||
}
|
||||
remote->SendRequest(static_cast<int32_t>(IAddWhiteListInfosCallback::Message::RESULT), data, reply, option);
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
#include "add_white_list_infos_call_back_stub.h"
|
||||
|
||||
#include "distributed_hardware_log.h"
|
||||
#include "string_ex.h"
|
||||
|
||||
#include "constants_dinput.h"
|
||||
@@ -34,9 +35,9 @@ AddWhiteListInfosCallbackStub::~AddWhiteListInfosCallbackStub()
|
||||
int32_t AddWhiteListInfosCallbackStub::OnRemoteRequest(
|
||||
uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option)
|
||||
{
|
||||
std::u16string descriptor = data.ReadInterfaceToken();
|
||||
if (descriptor != IAddWhiteListInfosCallback::GetDescriptor()) {
|
||||
return ERR_DH_INPUT_IPC_INVALID_DESCRIPTOR;
|
||||
if (data.ReadInterfaceToken() != GetDescriptor()) {
|
||||
DHLOGE("AddWhiteListInfosCallbackStub read token valid failed");
|
||||
return ERR_DH_INPUT_IPC_READ_TOKEN_VALID_FAIL;
|
||||
}
|
||||
IAddWhiteListInfosCallback::Message msgCode = static_cast<IAddWhiteListInfosCallback::Message>(code);
|
||||
switch (msgCode) {
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
#include "del_white_list_infos_call_back_proxy.h"
|
||||
|
||||
#include "distributed_hardware_log.h"
|
||||
#include "ipc_types.h"
|
||||
#include "parcel.h"
|
||||
|
||||
@@ -40,8 +41,12 @@ void DelWhiteListInfosCallbackProxy::OnResult(const std::string& deviceId)
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
data.WriteInterfaceToken(IDelWhiteListInfosCallback::GetDescriptor());
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
DHLOGE("DelWhiteListInfosCallbackProxy write token valid failed");
|
||||
return;
|
||||
}
|
||||
if (!data.WriteString(deviceId)) {
|
||||
DHLOGE("DelWhiteListInfosCallbackProxy write deviceId failed");
|
||||
return;
|
||||
}
|
||||
remote->SendRequest(static_cast<int32_t>(IDelWhiteListInfosCallback::Message::RESULT), data, reply, option);
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
#include "del_white_list_infos_call_back_stub.h"
|
||||
|
||||
#include "distributed_hardware_log.h"
|
||||
#include "string_ex.h"
|
||||
|
||||
#include "constants_dinput.h"
|
||||
@@ -34,9 +35,9 @@ DelWhiteListInfosCallbackStub::~DelWhiteListInfosCallbackStub()
|
||||
int32_t DelWhiteListInfosCallbackStub::OnRemoteRequest(
|
||||
uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option)
|
||||
{
|
||||
std::u16string descriptor = data.ReadInterfaceToken();
|
||||
if (descriptor != IDelWhiteListInfosCallback::GetDescriptor()) {
|
||||
return ERR_DH_INPUT_IPC_INVALID_DESCRIPTOR;
|
||||
if (data.ReadInterfaceToken() != GetDescriptor()) {
|
||||
DHLOGE("DelWhiteListInfosCallbackStub read token valid failed");
|
||||
return ERR_DH_INPUT_IPC_READ_TOKEN_VALID_FAIL;
|
||||
}
|
||||
IDelWhiteListInfosCallback::Message msgCode = static_cast<IDelWhiteListInfosCallback::Message>(code);
|
||||
switch (msgCode) {
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
|
||||
#include "distributed_input_sink_proxy.h"
|
||||
|
||||
#include "distributed_hardware_log.h"
|
||||
|
||||
#include "dinput_errcode.h"
|
||||
|
||||
namespace OHOS {
|
||||
@@ -31,6 +33,10 @@ int32_t DistributedInputSinkProxy::Init()
|
||||
{
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
DHLOGE("DistributedInputSinkProxy write token valid failed");
|
||||
return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL;
|
||||
}
|
||||
int32_t result = ERR_DH_INPUT_SINK_PROXY_INIT_FAIL;
|
||||
bool ret = SendRequest(IDistributedSinkInput::MessageCode::INIT, data, reply);
|
||||
if (ret) {
|
||||
@@ -43,6 +49,10 @@ int32_t DistributedInputSinkProxy::Release()
|
||||
{
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
DHLOGE("DistributedInputSinkProxy write token valid failed");
|
||||
return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL;
|
||||
}
|
||||
int32_t result = ERR_DH_INPUT_SINK_PROXY_RELEASE_FAIL;
|
||||
bool ret = SendRequest(IDistributedSinkInput::MessageCode::RELEASE, data, reply);
|
||||
if (ret) {
|
||||
@@ -55,11 +65,17 @@ int32_t DistributedInputSinkProxy::IsStartDistributedInput(
|
||||
const uint32_t& inputType, sptr<IStartDInputServerCallback> callback)
|
||||
{
|
||||
MessageParcel data;
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
DHLOGE("DistributedInputSinkProxy write token valid failed");
|
||||
return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL;
|
||||
}
|
||||
if (!data.WriteUint32(inputType)) {
|
||||
return static_cast<int32_t>(DInputServerType::NULL_SERVER_TYPE);
|
||||
DHLOGE("DistributedInputSinkProxy write inputType failed");
|
||||
return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL;
|
||||
}
|
||||
if (!data.WriteRemoteObject(callback->AsObject())) {
|
||||
return static_cast<int32_t>(DInputServerType::NULL_SERVER_TYPE);
|
||||
DHLOGE("DistributedInputSinkProxy write callback failed");
|
||||
return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL;
|
||||
}
|
||||
MessageParcel reply;
|
||||
int32_t result = ERR_DH_INPUT_SINK_PROXY_IS_START_INPUT_FAIL;
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
|
||||
#include "distributed_input_sink_stub.h"
|
||||
|
||||
#include "distributed_hardware_log.h"
|
||||
|
||||
#include "constants_dinput.h"
|
||||
#include "dinput_errcode.h"
|
||||
|
||||
@@ -30,11 +32,16 @@ DistributedInputSinkStub::~DistributedInputSinkStub()
|
||||
int32_t DistributedInputSinkStub::OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply,
|
||||
MessageOption &option)
|
||||
{
|
||||
if (data.ReadInterfaceToken() != GetDescriptor()) {
|
||||
DHLOGE("DistributedInputSinkStub read token valid failed");
|
||||
return ERR_DH_INPUT_IPC_READ_TOKEN_VALID_FAIL;
|
||||
}
|
||||
switch (code) {
|
||||
case static_cast<uint32_t>(IDistributedSinkInput::MessageCode::INIT): {
|
||||
int32_t ret = Init();
|
||||
if (!reply.WriteInt32(ret)) {
|
||||
return ERR_DH_INPUT_SINK_STUB_ON_REMOTE_REQUEST_FAIL;
|
||||
DHLOGE("DistributedInputSourceStub init write ret failed");
|
||||
return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -42,7 +49,8 @@ int32_t DistributedInputSinkStub::OnRemoteRequest(uint32_t code, MessageParcel &
|
||||
case static_cast<uint32_t>(IDistributedSinkInput::MessageCode::RELEASE): {
|
||||
int32_t ret = Release();
|
||||
if (!reply.WriteInt32(ret)) {
|
||||
return ERR_DH_INPUT_SINK_STUB_ON_REMOTE_REQUEST_FAIL;
|
||||
DHLOGE("DistributedInputSourceStub release write ret failed");
|
||||
return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -53,7 +61,8 @@ int32_t DistributedInputSinkStub::OnRemoteRequest(uint32_t code, MessageParcel &
|
||||
iface_cast<IStartDInputServerCallback>(data.ReadRemoteObject());
|
||||
int32_t ret = IsStartDistributedInput(inputType, callback);
|
||||
if (!reply.WriteInt32(ret)) {
|
||||
return ERR_DH_INPUT_SINK_STUB_ON_REMOTE_REQUEST_FAIL;
|
||||
DHLOGE("DistributedInputSourceStub isStartDistributedInput write ret failed");
|
||||
return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
|
||||
#include "distributed_input_source_proxy.h"
|
||||
|
||||
#include "distributed_hardware_log.h"
|
||||
|
||||
#include "dinput_errcode.h"
|
||||
|
||||
namespace OHOS {
|
||||
@@ -31,6 +33,10 @@ int32_t DistributedInputSourceProxy::Init()
|
||||
{
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
DHLOGE("DistributedInputSourceProxy write token valid failed");
|
||||
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);
|
||||
if (ret) {
|
||||
@@ -44,6 +50,10 @@ int32_t DistributedInputSourceProxy::Release()
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
int32_t result = ERR_DH_INPUT_SOURCE_PROXY_RELEASE_FAIL;
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
DHLOGE("DistributedInputSourceProxy write token valid failed");
|
||||
return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL;
|
||||
}
|
||||
bool ret = SendRequest(IDistributedSourceInput::MessageCode::RELEASE, data, reply);
|
||||
if (ret) {
|
||||
result = reply.ReadInt32();
|
||||
@@ -55,17 +65,25 @@ int32_t DistributedInputSourceProxy::RegisterDistributedHardware(const std::stri
|
||||
const std::string& parameters, sptr<IRegisterDInputCallback> callback)
|
||||
{
|
||||
MessageParcel data;
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
DHLOGE("DistributedInputSourceProxy write token valid failed");
|
||||
return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL;
|
||||
}
|
||||
if (!data.WriteString(devId)) {
|
||||
return ERR_DH_INPUT_SOURCE_PROXY_REGISTER_WRITE_MSG_FAIL;
|
||||
DHLOGE("DistributedInputSourceProxy write devId failed");
|
||||
return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL;
|
||||
}
|
||||
if (!data.WriteString(dhId)) {
|
||||
return ERR_DH_INPUT_SOURCE_PROXY_REGISTER_WRITE_MSG_FAIL;
|
||||
DHLOGE("DistributedInputSourceProxy write dhId failed");
|
||||
return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL;
|
||||
}
|
||||
if (!data.WriteString(parameters)) {
|
||||
return ERR_DH_INPUT_SOURCE_PROXY_REGISTER_WRITE_MSG_FAIL;
|
||||
DHLOGE("DistributedInputSourceProxy write parameters failed");
|
||||
return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL;
|
||||
}
|
||||
if (!data.WriteRemoteObject(callback->AsObject())) {
|
||||
return ERR_DH_INPUT_SOURCE_PROXY_REGISTER_WRITE_MSG_FAIL;
|
||||
DHLOGE("DistributedInputSourceProxy write callback failed");
|
||||
return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL;
|
||||
}
|
||||
MessageParcel reply;
|
||||
int32_t result = ERR_DH_INPUT_SOURCE_PROXY_REGISTER_FAIL;
|
||||
@@ -80,14 +98,21 @@ int32_t DistributedInputSourceProxy::UnregisterDistributedHardware(const std::st
|
||||
sptr<IUnregisterDInputCallback> callback)
|
||||
{
|
||||
MessageParcel data;
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
DHLOGE("DistributedInputSourceProxy write token valid failed");
|
||||
return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL;
|
||||
}
|
||||
if (!data.WriteString(devId)) {
|
||||
return ERR_DH_INPUT_SOURCE_PROXY_UNREGISTER_WRITE_MSG_FAIL;
|
||||
DHLOGE("DistributedInputSourceProxy write devId failed");
|
||||
return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL;
|
||||
}
|
||||
if (!data.WriteString(dhId)) {
|
||||
return ERR_DH_INPUT_SOURCE_PROXY_UNREGISTER_WRITE_MSG_FAIL;
|
||||
DHLOGE("DistributedInputSourceProxy write dhId failed");
|
||||
return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL;
|
||||
}
|
||||
if (!data.WriteRemoteObject(callback->AsObject())) {
|
||||
return ERR_DH_INPUT_SOURCE_PROXY_UNREGISTER_WRITE_MSG_FAIL;
|
||||
DHLOGE("DistributedInputSourceProxy write callback failed");
|
||||
return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL;
|
||||
}
|
||||
MessageParcel reply;
|
||||
int32_t result = ERR_DH_INPUT_SOURCE_PROXY_UNREGISTER_FAIL;
|
||||
@@ -103,14 +128,21 @@ int32_t DistributedInputSourceProxy::PrepareRemoteInput(
|
||||
sptr<IAddWhiteListInfosCallback> addWhiteListCallback)
|
||||
{
|
||||
MessageParcel data;
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
DHLOGE("DistributedInputSourceProxy write token valid failed");
|
||||
return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL;
|
||||
}
|
||||
if (!data.WriteString(deviceId)) {
|
||||
return ERR_DH_INPUT_SOURCE_PROXY_PREPARE_WRITE_MSG_FAIL;
|
||||
DHLOGE("DistributedInputSourceProxy write deviceId failed");
|
||||
return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL;
|
||||
}
|
||||
if (!data.WriteRemoteObject(callback->AsObject())) {
|
||||
return ERR_DH_INPUT_SOURCE_PROXY_PREPARE_WRITE_MSG_FAIL;
|
||||
DHLOGE("DistributedInputSourceProxy write callback failed");
|
||||
return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL;
|
||||
}
|
||||
if (!data.WriteRemoteObject(addWhiteListCallback->AsObject())) {
|
||||
return ERR_DH_INPUT_SOURCE_PROXY_PREPARE_WRITE_MSG_FAIL;
|
||||
DHLOGE("DistributedInputSourceProxy write addWhiteListCallback failed");
|
||||
return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL;
|
||||
}
|
||||
MessageParcel reply;
|
||||
int32_t result = ERR_DH_INPUT_SOURCE_PROXY_PREPARE_FAIL;
|
||||
@@ -126,14 +158,21 @@ int32_t DistributedInputSourceProxy::UnprepareRemoteInput(
|
||||
sptr<IDelWhiteListInfosCallback> delWhiteListCallback)
|
||||
{
|
||||
MessageParcel data;
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
DHLOGE("DistributedInputSourceProxy write token valid failed");
|
||||
return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL;
|
||||
}
|
||||
if (!data.WriteString(deviceId)) {
|
||||
return ERR_DH_INPUT_SOURCE_PROXY_UNPREPARE_WRITE_MSG_FAIL;
|
||||
DHLOGE("DistributedInputSourceProxy write deviceId failed");
|
||||
return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL;
|
||||
}
|
||||
if (!data.WriteRemoteObject(callback->AsObject())) {
|
||||
return ERR_DH_INPUT_SOURCE_PROXY_UNPREPARE_WRITE_MSG_FAIL;
|
||||
DHLOGE("DistributedInputSourceProxy write callback failed");
|
||||
return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL;
|
||||
}
|
||||
if (!data.WriteRemoteObject(delWhiteListCallback->AsObject())) {
|
||||
return ERR_DH_INPUT_SOURCE_PROXY_UNPREPARE_WRITE_MSG_FAIL;
|
||||
DHLOGE("DistributedInputSourceProxy write delWhiteListCallback failed");
|
||||
return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL;
|
||||
}
|
||||
MessageParcel reply;
|
||||
int32_t result = ERR_DH_INPUT_SOURCE_PROXY_UNPREPARE_FAIL;
|
||||
@@ -148,14 +187,21 @@ int32_t DistributedInputSourceProxy::StartRemoteInput(
|
||||
const std::string& deviceId, const uint32_t& inputTypes, sptr<IStartDInputCallback> callback)
|
||||
{
|
||||
MessageParcel data;
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
DHLOGE("DistributedInputSourceProxy write token valid failed");
|
||||
return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL;
|
||||
}
|
||||
if (!data.WriteString(deviceId)) {
|
||||
return ERR_DH_INPUT_SOURCE_PROXY_START_WRITE_MSG_FAIL;
|
||||
DHLOGE("DistributedInputSourceProxy write deviceId failed");
|
||||
return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL;
|
||||
}
|
||||
if (!data.WriteUint32(inputTypes)) {
|
||||
return ERR_DH_INPUT_SOURCE_PROXY_START_WRITE_MSG_FAIL;
|
||||
DHLOGE("DistributedInputSourceProxy write inputTypes failed");
|
||||
return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL;
|
||||
}
|
||||
if (!data.WriteRemoteObject(callback->AsObject())) {
|
||||
return ERR_DH_INPUT_SOURCE_PROXY_START_WRITE_MSG_FAIL;
|
||||
DHLOGE("DistributedInputSourceProxy write callback failed");
|
||||
return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL;
|
||||
}
|
||||
MessageParcel reply;
|
||||
int32_t result = ERR_DH_INPUT_SOURCE_PROXY_START_FAIL;
|
||||
@@ -170,14 +216,21 @@ int32_t DistributedInputSourceProxy::StopRemoteInput(
|
||||
const std::string& deviceId, const uint32_t& inputTypes, sptr<IStopDInputCallback> callback)
|
||||
{
|
||||
MessageParcel data;
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
DHLOGE("DistributedInputSourceProxy write token valid failed");
|
||||
return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL;
|
||||
}
|
||||
if (!data.WriteString(deviceId)) {
|
||||
return ERR_DH_INPUT_SOURCE_PROXY_STOP_WRITE_MSG_FAIL;
|
||||
DHLOGE("DistributedInputSourceProxy write deviceId failed");
|
||||
return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL;
|
||||
}
|
||||
if (!data.WriteUint32(inputTypes)) {
|
||||
return ERR_DH_INPUT_SOURCE_PROXY_STOP_WRITE_MSG_FAIL;
|
||||
DHLOGE("DistributedInputSourceProxy write inputTypes failed");
|
||||
return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL;
|
||||
}
|
||||
if (!data.WriteRemoteObject(callback->AsObject())) {
|
||||
return ERR_DH_INPUT_SOURCE_PROXY_STOP_WRITE_MSG_FAIL;
|
||||
DHLOGE("DistributedInputSourceProxy write callback failed");
|
||||
return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL;
|
||||
}
|
||||
MessageParcel reply;
|
||||
int32_t result = ERR_DH_INPUT_SOURCE_PROXY_STOP_FAIL;
|
||||
@@ -192,11 +245,17 @@ int32_t DistributedInputSourceProxy::IsStartDistributedInput(
|
||||
const uint32_t& inputType, sptr<IStartDInputServerCallback> callback)
|
||||
{
|
||||
MessageParcel data;
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
DHLOGE("DistributedInputSourceProxy write token valid failed");
|
||||
return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL;
|
||||
}
|
||||
if (!data.WriteUint32(inputType)) {
|
||||
return static_cast<int32_t>(DInputServerType::NULL_SERVER_TYPE);
|
||||
DHLOGE("DistributedInputSourceProxy write inputType failed");
|
||||
return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL;
|
||||
}
|
||||
if (!data.WriteRemoteObject(callback->AsObject())) {
|
||||
return static_cast<int32_t>(DInputServerType::NULL_SERVER_TYPE);
|
||||
DHLOGE("DistributedInputSourceProxy write callback failed");
|
||||
return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL;
|
||||
}
|
||||
MessageParcel reply;
|
||||
int32_t result = ERR_DH_INPUT_SOURCE_PROXY_IS_START_INPUT_FAIL;
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
|
||||
#include "distributed_input_source_stub.h"
|
||||
|
||||
#include "distributed_hardware_log.h"
|
||||
|
||||
#include "constants_dinput.h"
|
||||
#include "dinput_errcode.h"
|
||||
|
||||
@@ -31,7 +33,8 @@ int32_t DistributedInputSourceStub::HandleInitDistributedHardware(MessageParcel
|
||||
{
|
||||
int32_t ret = Init();
|
||||
if (!reply.WriteInt32(ret)) {
|
||||
return ERR_DH_INPUT_SOURCE_STUB_ON_REMOTE_REQUEST_FAIL;
|
||||
DHLOGE("DistributedInputSourceStub Init write ret failed");
|
||||
return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL;
|
||||
}
|
||||
return DH_SUCCESS;
|
||||
}
|
||||
@@ -40,7 +43,8 @@ int32_t DistributedInputSourceStub::HandleReleaseDistributedHardware(MessageParc
|
||||
{
|
||||
int32_t ret = Release();
|
||||
if (!reply.WriteInt32(ret)) {
|
||||
return ERR_DH_INPUT_SOURCE_STUB_ON_REMOTE_REQUEST_FAIL;
|
||||
DHLOGE("DistributedInputSourceStub release write ret failed");
|
||||
return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL;
|
||||
}
|
||||
return DH_SUCCESS;
|
||||
}
|
||||
@@ -53,7 +57,8 @@ int32_t DistributedInputSourceStub::HandleRegisterDistributedHardware(MessagePar
|
||||
sptr<IRegisterDInputCallback> callback = iface_cast<IRegisterDInputCallback>(data.ReadRemoteObject());
|
||||
int32_t ret = RegisterDistributedHardware(devId, dhId, params, callback);
|
||||
if (!reply.WriteInt32(ret)) {
|
||||
return ERR_DH_INPUT_SOURCE_STUB_ON_REMOTE_REQUEST_FAIL;
|
||||
DHLOGE("DistributedInputSourceStub registerDistributedHardware write ret failed");
|
||||
return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL;
|
||||
}
|
||||
return DH_SUCCESS;
|
||||
}
|
||||
@@ -65,7 +70,8 @@ int32_t DistributedInputSourceStub::HandleUnregisterDistributedHardware(MessageP
|
||||
sptr<IUnregisterDInputCallback> callback = iface_cast<IUnregisterDInputCallback>(data.ReadRemoteObject());
|
||||
int32_t ret = UnregisterDistributedHardware(devId, dhId, callback);
|
||||
if (!reply.WriteInt32(ret)) {
|
||||
return ERR_DH_INPUT_SOURCE_STUB_ON_REMOTE_REQUEST_FAIL;
|
||||
DHLOGE("DistributedInputSourceStub unregisterDistributedHardware write ret failed");
|
||||
return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL;
|
||||
}
|
||||
return DH_SUCCESS;
|
||||
}
|
||||
@@ -79,7 +85,8 @@ int32_t DistributedInputSourceStub::HandlePrepareRemoteInput(MessageParcel &data
|
||||
iface_cast<IAddWhiteListInfosCallback>(data.ReadRemoteObject());
|
||||
int32_t ret = PrepareRemoteInput(deviceId, callback, addCallback);
|
||||
if (!reply.WriteInt32(ret)) {
|
||||
return ERR_DH_INPUT_SOURCE_STUB_ON_REMOTE_REQUEST_FAIL;
|
||||
DHLOGE("DistributedInputSourceStub prepareRemoteInput write ret failed");
|
||||
return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL;
|
||||
}
|
||||
return DH_SUCCESS;
|
||||
}
|
||||
@@ -93,7 +100,8 @@ int32_t DistributedInputSourceStub::HandleUnprepareRemoteInput(MessageParcel &da
|
||||
iface_cast<IDelWhiteListInfosCallback>(data.ReadRemoteObject());
|
||||
int32_t ret = UnprepareRemoteInput(deviceId, callback, delCallback);
|
||||
if (!reply.WriteInt32(ret)) {
|
||||
return ERR_DH_INPUT_SOURCE_STUB_ON_REMOTE_REQUEST_FAIL;
|
||||
DHLOGE("DistributedInputSourceStub unprepareRemoteInput write ret failed");
|
||||
return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL;
|
||||
}
|
||||
return DH_SUCCESS;
|
||||
}
|
||||
@@ -105,7 +113,8 @@ int32_t DistributedInputSourceStub::HandleStartRemoteInput(MessageParcel &data,
|
||||
sptr<IStartDInputCallback> callback = iface_cast<IStartDInputCallback>(data.ReadRemoteObject());
|
||||
int32_t ret = StartRemoteInput(deviceId, inputTypes, callback);
|
||||
if (!reply.WriteInt32(ret)) {
|
||||
return ERR_DH_INPUT_SOURCE_STUB_ON_REMOTE_REQUEST_FAIL;
|
||||
DHLOGE("DistributedInputSourceStub startRemoteInput write ret failed");
|
||||
return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL;
|
||||
}
|
||||
return DH_SUCCESS;
|
||||
}
|
||||
@@ -117,7 +126,8 @@ int32_t DistributedInputSourceStub::HandleStopRemoteInput(MessageParcel &data, M
|
||||
sptr<IStopDInputCallback> callback = iface_cast<IStopDInputCallback>(data.ReadRemoteObject());
|
||||
int32_t ret = StopRemoteInput(deviceId, inputTypes, callback);
|
||||
if (!reply.WriteInt32(ret)) {
|
||||
return ERR_DH_INPUT_SOURCE_STUB_ON_REMOTE_REQUEST_FAIL;
|
||||
DHLOGE("DistributedInputSourceStub stopRemoteInput write ret failed");
|
||||
return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL;
|
||||
}
|
||||
return DH_SUCCESS;
|
||||
}
|
||||
@@ -128,7 +138,8 @@ int32_t DistributedInputSourceStub::HandleIsStartDistributedInput(MessageParcel
|
||||
sptr<IStartDInputServerCallback> callback = iface_cast<IStartDInputServerCallback>(data.ReadRemoteObject());
|
||||
int32_t ret = IsStartDistributedInput(inputType, callback);
|
||||
if (!reply.WriteInt32(ret)) {
|
||||
return ERR_DH_INPUT_SOURCE_STUB_ON_REMOTE_REQUEST_FAIL;
|
||||
DHLOGE("DistributedInputSourceStub isStartDistributedInput write ret failed");
|
||||
return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL;
|
||||
}
|
||||
return DH_SUCCESS;
|
||||
}
|
||||
@@ -136,6 +147,10 @@ int32_t DistributedInputSourceStub::HandleIsStartDistributedInput(MessageParcel
|
||||
int32_t DistributedInputSourceStub::OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply,
|
||||
MessageOption &option)
|
||||
{
|
||||
if (data.ReadInterfaceToken() != GetDescriptor()) {
|
||||
DHLOGE("DistributedInputSourceStub read token valid failed");
|
||||
return ERR_DH_INPUT_IPC_WRITE_TOKEN_VALID_FAIL;
|
||||
}
|
||||
switch (code) {
|
||||
case static_cast<uint32_t>(IDistributedSourceInput::MessageCode::INIT): {
|
||||
return HandleInitDistributedHardware(reply);
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
|
||||
#include "prepare_d_input_call_back_proxy.h"
|
||||
|
||||
#include "distributed_hardware_log.h"
|
||||
|
||||
#include "ipc_types.h"
|
||||
#include "parcel.h"
|
||||
|
||||
@@ -40,7 +42,10 @@ void PrepareDInputCallbackProxy::OnResult(const std::string& deviceId, const int
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
data.WriteInterfaceToken(IPrepareDInputCallback::GetDescriptor());
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
DHLOGE("PrepareDInputCallbackProxy write token valid failed");
|
||||
return;
|
||||
}
|
||||
if (!data.WriteString(deviceId)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
#include "prepare_d_input_call_back_stub.h"
|
||||
|
||||
#include "distributed_hardware_log.h"
|
||||
#include "string_ex.h"
|
||||
|
||||
#include "constants_dinput.h"
|
||||
@@ -34,9 +35,9 @@ PrepareDInputCallbackStub::~PrepareDInputCallbackStub()
|
||||
int32_t PrepareDInputCallbackStub::OnRemoteRequest(
|
||||
uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option)
|
||||
{
|
||||
std::u16string descriptor = data.ReadInterfaceToken();
|
||||
if (descriptor != IPrepareDInputCallback::GetDescriptor()) {
|
||||
return ERR_DH_INPUT_IPC_INVALID_DESCRIPTOR;
|
||||
if (data.ReadInterfaceToken() != GetDescriptor()) {
|
||||
DHLOGE("PrepareDInputCallbackStub read token valid failed");
|
||||
return ERR_DH_INPUT_IPC_READ_TOKEN_VALID_FAIL;
|
||||
}
|
||||
IPrepareDInputCallback::Message msgCode = static_cast<IPrepareDInputCallback::Message>(code);
|
||||
switch (msgCode) {
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
#include "register_d_input_call_back_proxy.h"
|
||||
|
||||
#include "distributed_hardware_log.h"
|
||||
#include "ipc_types.h"
|
||||
#include "parcel.h"
|
||||
|
||||
@@ -40,7 +41,10 @@ void RegisterDInputCallbackProxy::OnResult(const std::string& devId, const std::
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
data.WriteInterfaceToken(IRegisterDInputCallback::GetDescriptor());
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
DHLOGE("RegisterDInputCallbackProxy write token valid failed");
|
||||
return;
|
||||
}
|
||||
if (!data.WriteString(devId)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
#include "register_d_input_call_back_stub.h"
|
||||
|
||||
#include "distributed_hardware_log.h"
|
||||
#include "string_ex.h"
|
||||
|
||||
#include "constants_dinput.h"
|
||||
@@ -34,9 +35,9 @@ RegisterDInputCallbackStub::~RegisterDInputCallbackStub()
|
||||
int32_t RegisterDInputCallbackStub::OnRemoteRequest(
|
||||
uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option)
|
||||
{
|
||||
std::u16string descriptor = data.ReadInterfaceToken();
|
||||
if (descriptor != IRegisterDInputCallback::GetDescriptor()) {
|
||||
return ERR_DH_INPUT_IPC_INVALID_DESCRIPTOR;
|
||||
if (data.ReadInterfaceToken() != GetDescriptor()) {
|
||||
DHLOGE("RegisterDInputCallbackStub read token valid failed");
|
||||
return ERR_DH_INPUT_IPC_READ_TOKEN_VALID_FAIL;
|
||||
}
|
||||
IRegisterDInputCallback::Message msgCode = static_cast<IRegisterDInputCallback::Message>(code);
|
||||
switch (msgCode) {
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
#include "start_d_input_call_back_proxy.h"
|
||||
|
||||
#include "distributed_hardware_log.h"
|
||||
#include "ipc_types.h"
|
||||
#include "parcel.h"
|
||||
|
||||
@@ -40,14 +41,20 @@ void StartDInputCallbackProxy::OnResult(const std::string& devId, const uint32_t
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
data.WriteInterfaceToken(IStartDInputCallback::GetDescriptor());
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
DHLOGE("StartDInputCallbackProxy write token valid failed");
|
||||
return;
|
||||
}
|
||||
if (!data.WriteString(devId)) {
|
||||
DHLOGE("StartDInputCallbackProxy write devId failed");
|
||||
return;
|
||||
}
|
||||
if (!data.WriteUint32(inputTypes)) {
|
||||
DHLOGE("StartDInputCallbackProxy write inputTypes failed");
|
||||
return;
|
||||
}
|
||||
if (!data.WriteInt32(status)) {
|
||||
DHLOGE("StartDInputCallbackProxy write status failed");
|
||||
return;
|
||||
}
|
||||
int32_t ret = remote->SendRequest(
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
#include "start_d_input_call_back_stub.h"
|
||||
|
||||
#include "distributed_hardware_log.h"
|
||||
#include "string_ex.h"
|
||||
|
||||
#include "constants_dinput.h"
|
||||
@@ -34,9 +35,9 @@ StartDInputCallbackStub::~StartDInputCallbackStub()
|
||||
int32_t StartDInputCallbackStub::OnRemoteRequest(
|
||||
uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option)
|
||||
{
|
||||
std::u16string descriptor = data.ReadInterfaceToken();
|
||||
if (descriptor != IStartDInputCallback::GetDescriptor()) {
|
||||
return ERR_DH_INPUT_IPC_INVALID_DESCRIPTOR;
|
||||
if (data.ReadInterfaceToken() != GetDescriptor()) {
|
||||
DHLOGE("StartDInputCallbackStub read token valid failed");
|
||||
return ERR_DH_INPUT_IPC_READ_TOKEN_VALID_FAIL;
|
||||
}
|
||||
IStartDInputCallback::Message msgCode = static_cast<IStartDInputCallback::Message>(code);
|
||||
switch (msgCode) {
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
#include "start_d_input_server_call_back_proxy.h"
|
||||
|
||||
#include "distributed_hardware_log.h"
|
||||
#include "ipc_types.h"
|
||||
#include "parcel.h"
|
||||
|
||||
@@ -40,11 +41,16 @@ void StartDInputServerCallbackProxy::OnResult(const int32_t& status, const uint3
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
data.WriteInterfaceToken(IStartDInputServerCallback::GetDescriptor());
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
DHLOGE("StartDInputServerCallbackProxy write token valid failed");
|
||||
return;
|
||||
}
|
||||
if (!data.WriteInt32(status)) {
|
||||
DHLOGE("StartDInputServerCallbackProxy write status failed");
|
||||
return;
|
||||
}
|
||||
if (!data.WriteUint32(inputTypes)) {
|
||||
DHLOGE("StartDInputServerCallbackProxy write inputTypes failed");
|
||||
return;
|
||||
}
|
||||
int32_t ret = remote->SendRequest(
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
#include "start_d_input_server_call_back_stub.h"
|
||||
|
||||
#include "distributed_hardware_log.h"
|
||||
#include "string_ex.h"
|
||||
|
||||
#include "constants_dinput.h"
|
||||
@@ -34,9 +35,9 @@ StartDInputServerCallbackStub::~StartDInputServerCallbackStub()
|
||||
int32_t StartDInputServerCallbackStub::OnRemoteRequest(
|
||||
uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option)
|
||||
{
|
||||
std::u16string descriptor = data.ReadInterfaceToken();
|
||||
if (descriptor != IStartDInputServerCallback::GetDescriptor()) {
|
||||
return ERR_DH_INPUT_IPC_INVALID_DESCRIPTOR;
|
||||
if (data.ReadInterfaceToken() != GetDescriptor()) {
|
||||
DHLOGE("StartDInputServerCallbackStub read token valid failed");
|
||||
return ERR_DH_INPUT_IPC_READ_TOKEN_VALID_FAIL;
|
||||
}
|
||||
IStartDInputServerCallback::Message msgCode = static_cast<IStartDInputServerCallback::Message>(code);
|
||||
switch (msgCode) {
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
#include "stop_d_input_call_back_proxy.h"
|
||||
|
||||
#include "distributed_hardware_log.h"
|
||||
#include "ipc_types.h"
|
||||
#include "parcel.h"
|
||||
|
||||
@@ -40,14 +41,20 @@ void StopDInputCallbackProxy::OnResult(const std::string& devId, const uint32_t&
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
data.WriteInterfaceToken(IStopDInputCallback::GetDescriptor());
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
DHLOGE("StopDInputCallbackProxy write token valid failed");
|
||||
return;
|
||||
}
|
||||
if (!data.WriteString(devId)) {
|
||||
DHLOGE("StopDInputCallbackProxy write devId failed");
|
||||
return;
|
||||
}
|
||||
if (!data.WriteUint32(inputTypes)) {
|
||||
DHLOGE("StopDInputCallbackProxy write inputTypes failed");
|
||||
return;
|
||||
}
|
||||
if (!data.WriteInt32(status)) {
|
||||
DHLOGE("StopDInputCallbackProxy write status failed");
|
||||
return;
|
||||
}
|
||||
int32_t ret = remote->SendRequest(
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
#include "stop_d_input_call_back_stub.h"
|
||||
|
||||
#include "distributed_hardware_log.h"
|
||||
#include "string_ex.h"
|
||||
|
||||
#include "constants_dinput.h"
|
||||
@@ -34,9 +35,9 @@ StopDInputCallbackStub::~StopDInputCallbackStub()
|
||||
int32_t StopDInputCallbackStub::OnRemoteRequest(
|
||||
uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option)
|
||||
{
|
||||
std::u16string descriptor = data.ReadInterfaceToken();
|
||||
if (descriptor != IStopDInputCallback::GetDescriptor()) {
|
||||
return ERR_DH_INPUT_IPC_INVALID_DESCRIPTOR;
|
||||
if (data.ReadInterfaceToken() != GetDescriptor()) {
|
||||
DHLOGE("StopDInputCallbackStub read token valid failed");
|
||||
return ERR_DH_INPUT_IPC_READ_TOKEN_VALID_FAIL;
|
||||
}
|
||||
IStopDInputCallback::Message msgCode = static_cast<IStopDInputCallback::Message>(code);
|
||||
switch (msgCode) {
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
#include "unprepare_d_input_call_back_proxy.h"
|
||||
|
||||
#include "distributed_hardware_log.h"
|
||||
#include "ipc_types.h"
|
||||
#include "parcel.h"
|
||||
|
||||
@@ -40,11 +41,16 @@ void UnprepareDInputCallbackProxy::OnResult(const std::string& deviceId, const i
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
data.WriteInterfaceToken(IUnprepareDInputCallback::GetDescriptor());
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
DHLOGE("UnprepareDInputCallbackProxy write token valid failed");
|
||||
return;
|
||||
}
|
||||
if (!data.WriteString(deviceId)) {
|
||||
DHLOGE("UnprepareDInputCallbackProxy write deviceId failed");
|
||||
return;
|
||||
}
|
||||
if (!data.WriteInt32(status)) {
|
||||
DHLOGE("UnprepareDInputCallbackProxy write status failed");
|
||||
return;
|
||||
}
|
||||
int32_t ret = remote->SendRequest(
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
#include "unprepare_d_input_call_back_stub.h"
|
||||
|
||||
#include "distributed_hardware_log.h"
|
||||
#include "string_ex.h"
|
||||
|
||||
#include "constants_dinput.h"
|
||||
@@ -34,9 +35,9 @@ UnprepareDInputCallbackStub::~UnprepareDInputCallbackStub()
|
||||
int32_t UnprepareDInputCallbackStub::OnRemoteRequest(
|
||||
uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option)
|
||||
{
|
||||
std::u16string descriptor = data.ReadInterfaceToken();
|
||||
if (descriptor != IUnprepareDInputCallback::GetDescriptor()) {
|
||||
return ERR_DH_INPUT_IPC_INVALID_DESCRIPTOR;
|
||||
if (data.ReadInterfaceToken() != GetDescriptor()) {
|
||||
DHLOGE("UnprepareDInputCallbackStub read token valid failed");
|
||||
return ERR_DH_INPUT_IPC_READ_TOKEN_VALID_FAIL;
|
||||
}
|
||||
IUnprepareDInputCallback::Message msgCode = static_cast<IUnprepareDInputCallback::Message>(code);
|
||||
switch (msgCode) {
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
#include "unregister_d_input_call_back_proxy.h"
|
||||
|
||||
#include "distributed_hardware_log.h"
|
||||
#include "ipc_types.h"
|
||||
#include "parcel.h"
|
||||
|
||||
@@ -40,14 +41,20 @@ void UnregisterDInputCallbackProxy::OnResult(const std::string& devId, const std
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
data.WriteInterfaceToken(IUnregisterDInputCallback::GetDescriptor());
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
DHLOGE("UnregisterDInputCallbackProxy write token valid failed");
|
||||
return;
|
||||
}
|
||||
if (!data.WriteString(devId)) {
|
||||
DHLOGE("UnregisterDInputCallbackProxy write devId failed");
|
||||
return;
|
||||
}
|
||||
if (!data.WriteString(dhId)) {
|
||||
DHLOGE("UnregisterDInputCallbackProxy write dhId failed");
|
||||
return;
|
||||
}
|
||||
if (!data.WriteInt32(status)) {
|
||||
DHLOGE("UnregisterDInputCallbackProxy write status failed");
|
||||
return;
|
||||
}
|
||||
int32_t ret = remote->SendRequest(
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
#include "unregister_d_input_call_back_stub.h"
|
||||
|
||||
#include "distributed_hardware_log.h"
|
||||
#include "string_ex.h"
|
||||
|
||||
#include "constants_dinput.h"
|
||||
@@ -34,9 +35,9 @@ UnregisterDInputCallbackStub::~UnregisterDInputCallbackStub()
|
||||
int32_t UnregisterDInputCallbackStub::OnRemoteRequest(
|
||||
uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option)
|
||||
{
|
||||
std::u16string descriptor = data.ReadInterfaceToken();
|
||||
if (descriptor != IUnregisterDInputCallback::GetDescriptor()) {
|
||||
return ERR_DH_INPUT_IPC_INVALID_DESCRIPTOR;
|
||||
if (data.ReadInterfaceToken() != GetDescriptor()) {
|
||||
DHLOGE("UnRegisterDInputCallbackStub read token valid failed");
|
||||
return ERR_DH_INPUT_IPC_READ_TOKEN_VALID_FAIL;
|
||||
}
|
||||
IUnregisterDInputCallback::Message msgCode = static_cast<IUnregisterDInputCallback::Message>(code);
|
||||
switch (msgCode) {
|
||||
|
||||
Reference in New Issue
Block a user