Description:reviewbot amend

Match-id-93bf6599eace7b34dd5ca7f2ef538df320e22404
This commit is contained in:
xxxx
2022-11-17 21:35:30 +08:00
parent 75676380a9
commit 84a72c9182
62 changed files with 389 additions and 408 deletions
+6 -6
View File
@@ -629,14 +629,14 @@ int32_t InputHub::QueryLocalTouchScreenInfo(int fd)
info.localAbsInfo.absXMax = absInfo.maximum;
info.localAbsInfo.absMtPositionXMin = absInfo.minimum;
info.localAbsInfo.absMtPositionXMax = absInfo.maximum;
info.sinkPhyWidth = (uint32_t)(absInfo.maximum + 1);
info.sinkPhyWidth = static_cast<uint32_t>(absInfo.maximum + 1);
ioctl(fd, EVIOCGABS(ABS_MT_POSITION_Y), &absInfo);
info.localAbsInfo.absYMin = absInfo.minimum;
info.localAbsInfo.absYMax = absInfo.maximum;
info.localAbsInfo.absMtPositionYMin = absInfo.minimum;
info.localAbsInfo.absMtPositionYMax = absInfo.maximum;
info.sinkPhyHeight = (uint32_t)(absInfo.maximum + 1);
info.sinkPhyHeight = static_cast<uint32_t>(absInfo.maximum + 1);
ioctl(fd, EVIOCGABS(ABS_PRESSURE), &absInfo);
info.localAbsInfo.absPressureMin = absInfo.minimum;
@@ -1102,12 +1102,12 @@ void InputHub::HandleTouchScreenEvent(struct input_event readBuffer[], const siz
for (size_t j = iter.first; j <= iter.second; j++) {
struct input_event &iev = readBuffer[j];
if (iev.code == ABS_X || iev.code == ABS_MT_POSITION_X) {
absInfo.absX = (uint32_t)iev.value;
absInfo.absXIndex = (int32_t)j;
absInfo.absX = static_cast<uint32_t>(iev.value);
absInfo.absXIndex = static_cast<int32_t>(j);
}
if (iev.code == ABS_Y || iev.code == ABS_MT_POSITION_Y) {
absInfo.absY = (uint32_t)iev.value;
absInfo.absYIndex = (int32_t)j;
absInfo.absY = static_cast<uint32_t>(iev.value);
absInfo.absYIndex = static_cast<int32_t>(j);
}
}
+7 -7
View File
@@ -38,16 +38,16 @@ enum class HiDumperFlag {
};
struct NodeInfo {
std::string deviceId_ = "";
std::string nodeName_ = "";
std::string dhId_ = "";
std::string devId = "";
std::string virNodeName = "";
std::string inputDhId = "";
};
struct SessionInfo {
int32_t sessionId_ = 0;
std::string mySessionName_ = "";
std::string peerSessionName_ = "";
SessionStatus sessionStatus_ = SessionStatus::CLOSED;
int32_t sesId = 0;
std::string mySesName = "";
std::string peerSesName = "";
SessionStatus sessionState = SessionStatus::CLOSED;
};
class HiDumper {
+17 -17
View File
@@ -106,11 +106,11 @@ int32_t HiDumper::GetAllNodeInfos(std::string& result)
for (auto iter = nodeInfos_.begin(); iter != nodeInfos_.end(); iter++) {
result.append("\n{");
result.append("\n deviceid : ");
result.append(GetAnonyString((*iter).deviceId_));
result.append(GetAnonyString((*iter).devId));
result.append("\n nodename : ");
result.append((*iter).nodeName_);
result.append((*iter).virNodeName);
result.append("\n dhId : ");
result.append(GetAnonyString((*iter).dhId_));
result.append(GetAnonyString((*iter).inputDhId));
result.append("\n},");
}
return DH_SUCCESS;
@@ -121,7 +121,7 @@ void HiDumper::DeleteNodeInfo(const std::string& deviceId, const std::string& dh
DHLOGI("DeleteNodeInfo Dump.");
std::lock_guard<std::mutex> node_lock(nodeMutex_);
for (auto iter = nodeInfos_.begin(); iter != nodeInfos_.end();) {
if ((*iter).deviceId_.compare(deviceId) == 0 && (*iter).dhId_.compare(dhId) == 0) {
if ((*iter).devId.compare(deviceId) == 0 && (*iter).inputDhId.compare(dhId) == 0) {
iter = nodeInfos_.erase(iter);
} else {
iter++;
@@ -138,18 +138,18 @@ int32_t HiDumper::GetSessionInfo(std::string& result)
result.append("\n remotedevid : ");
result.append(GetAnonyString(iter->first));
result.append("\n sessionid : ");
result.append(std::to_string(iter->second.sessionId_));
result.append(std::to_string(iter->second.sesId));
result.append("\n mysessionname : ");
result.append(iter->second.mySessionName_);
result.append(iter->second.mySesName);
result.append("\n peersessionname : ");
result.append(iter->second.peerSessionName_);
result.append(iter->second.peerSesName);
std::string sessionStatus("");
auto item = SESSION_STATUS.find(iter->second.sessionStatus_);
auto item = SESSION_STATUS.find(iter->second.sessionState);
if (item == SESSION_STATUS.end()) {
sessionStatus = "unknown state";
} else {
sessionStatus = SESSION_STATUS.find(iter->second.sessionStatus_)->second;
sessionStatus = SESSION_STATUS.find(iter->second.sessionState)->second;
}
result.append("\n sessionstate : ");
result.append(sessionStatus);
@@ -187,9 +187,9 @@ void HiDumper::SaveNodeInfo(const std::string& deviceId, const std::string& node
{
std::lock_guard<std::mutex> node_lock(nodeMutex_);
NodeInfo nodeInfo = {
.deviceId_ = deviceId,
.nodeName_ = nodeName,
.dhId_ = dhId,
.devId = deviceId,
.virNodeName = nodeName,
.inputDhId = dhId,
};
nodeInfos_.push_back(nodeInfo);
}
@@ -201,10 +201,10 @@ void HiDumper::CreateSessionInfo(const std::string& remoteDevId, const int32_t&
auto iter = sessionInfos_.find(remoteDevId);
if (iter == sessionInfos_.end()) {
SessionInfo sessionInfo = {
.sessionId_ = sessionId,
.mySessionName_ = mySessionName,
.peerSessionName_ = peerSessionName,
.sessionStatus_ = sessionStatus,
.sesId = sessionId,
.mySesName = mySessionName,
.peerSesName = peerSessionName,
.sessionState = sessionStatus,
};
sessionInfos_[remoteDevId] = sessionInfo;
}
@@ -218,7 +218,7 @@ void HiDumper::SetSessionStatus(const std::string& remoteDevId, const SessionSta
DHLOGI("remote deviceid does not exist");
return;
}
sessionInfos_[remoteDevId].sessionStatus_ = sessionStatus;
sessionInfos_[remoteDevId].sessionState = sessionStatus;
}
} // namespace DistributedInput
} // namespace DistributedHardware
@@ -40,12 +40,12 @@ namespace DistributedInput {
class DistributedInputHandler : public IHardwareHandler {
DECLARE_SINGLE_INSTANCE_BASE(DistributedInputHandler);
public:
API_EXPORT virtual int32_t Initialize() override;
API_EXPORT int32_t Initialize() override;
API_EXPORT virtual std::vector<DHItem> Query() override;
API_EXPORT virtual std::map<std::string, std::string> QueryExtraInfo() override;
API_EXPORT virtual bool IsSupportPlugin() override;
API_EXPORT virtual void RegisterPluginListener(std::shared_ptr<PluginListener> listener) override;
API_EXPORT virtual void UnRegisterPluginListener() override;
API_EXPORT bool IsSupportPlugin() override;
API_EXPORT void RegisterPluginListener(std::shared_ptr<PluginListener> listener) override;
API_EXPORT void UnRegisterPluginListener() override;
API_EXPORT void FindDevicesInfoByType(const uint32_t inputTypes, std::map<int32_t, std::string> &datas);
API_EXPORT void FindDevicesInfoByDhId(std::vector<std::string> dhidsVec, std::map<int32_t, std::string> &datas);
@@ -66,8 +66,8 @@ private:
void StopInputMonitorDeviceThread();
// The event queue.
static const int INPUT_DEVICE_BUFFER_SIZE = 32;
InputDeviceEvent mEventBuffer[INPUT_DEVICE_BUFFER_SIZE] = {};
static const int inputDeviceBufferSize = 32;
InputDeviceEvent mEventBuffer[inputDeviceBufferSize] = {};
std::mutex operationMutex_;
std::unique_ptr<InputHub> inputHub_;
};
@@ -187,7 +187,7 @@ void DistributedInputHandler::StartInputMonitorDeviceThread(const std::string de
return;
}
while (isCollectingEvents_) {
size_t count = inputHub_->StartCollectInputHandler(mEventBuffer, INPUT_DEVICE_BUFFER_SIZE);
size_t count = inputHub_->StartCollectInputHandler(mEventBuffer, inputDeviceBufferSize);
if (count > 0) {
DHLOGI("Count: %zu", count);
for (size_t iCnt = 0; iCnt < count; iCnt++) {
@@ -28,10 +28,9 @@ namespace DistributedInput {
class AddWhiteListInfosCallbackProxy : public IRemoteProxy<IAddWhiteListInfosCallback> {
public:
explicit AddWhiteListInfosCallbackProxy(const sptr<IRemoteObject> &object);
~AddWhiteListInfosCallbackProxy() override;
virtual ~AddWhiteListInfosCallbackProxy() override;
virtual void OnResult(const std::string& deviceId, const std::string& strJson) override;
void OnResult(const std::string& deviceId, const std::string& strJson) override;
private:
static inline BrokerDelegator<AddWhiteListInfosCallbackProxy> delegator_;
@@ -28,7 +28,7 @@ namespace DistributedInput {
class AddWhiteListInfosCallbackStub : public IRemoteStub<IAddWhiteListInfosCallback> {
public:
AddWhiteListInfosCallbackStub();
virtual ~AddWhiteListInfosCallbackStub() override;
~AddWhiteListInfosCallbackStub() override;
int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
@@ -28,10 +28,9 @@ namespace DistributedInput {
class DelWhiteListInfosCallbackProxy : public IRemoteProxy<IDelWhiteListInfosCallback> {
public:
explicit DelWhiteListInfosCallbackProxy(const sptr<IRemoteObject> &object);
~DelWhiteListInfosCallbackProxy() override;
virtual ~DelWhiteListInfosCallbackProxy() override;
virtual void OnResult(const std::string& deviceId) override;
void OnResult(const std::string& deviceId) override;
private:
static inline BrokerDelegator<DelWhiteListInfosCallbackProxy> delegator_;
@@ -28,7 +28,7 @@ namespace DistributedInput {
class DelWhiteListInfosCallbackStub : public IRemoteStub<IDelWhiteListInfosCallback> {
public:
DelWhiteListInfosCallbackStub();
virtual ~DelWhiteListInfosCallbackStub() override;
~DelWhiteListInfosCallbackStub() override;
int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
@@ -120,50 +120,50 @@ public:
class RegisterDInputCb : public OHOS::DistributedHardware::DistributedInput::RegisterDInputCallbackStub {
public:
RegisterDInputCb() = default;
virtual ~RegisterDInputCb() = default;
void OnResult(const std::string& devId, const std::string& dhId, const int32_t& status);
~RegisterDInputCb() override = default;
void OnResult(const std::string& devId, const std::string& dhId, const int32_t& status) override;
};
class UnregisterDInputCb : public OHOS::DistributedHardware::DistributedInput::UnregisterDInputCallbackStub {
public:
UnregisterDInputCb() = default;
virtual ~UnregisterDInputCb() = default;
void OnResult(const std::string& devId, const std::string& dhId, const int32_t& status);
~UnregisterDInputCb() override = default;
void OnResult(const std::string& devId, const std::string& dhId, const int32_t& status) override;
};
class AddWhiteListInfosCb : public OHOS::DistributedHardware::DistributedInput::AddWhiteListInfosCallbackStub {
public:
AddWhiteListInfosCb() = default;
virtual ~AddWhiteListInfosCb() = default;
void OnResult(const std::string &deviceId, const std::string &strJson);
~AddWhiteListInfosCb() override = default;
void OnResult(const std::string &deviceId, const std::string &strJson) override;
};
class DelWhiteListInfosCb : public OHOS::DistributedHardware::DistributedInput::DelWhiteListInfosCallbackStub {
public:
DelWhiteListInfosCb() = default;
virtual ~DelWhiteListInfosCb() = default;
void OnResult(const std::string &deviceId);
~DelWhiteListInfosCb() override = default;
void OnResult(const std::string &deviceId) override;
};
class SharingDhIdListenerCb : public OHOS::DistributedHardware::DistributedInput::SharingDhIdListenerStub {
public:
SharingDhIdListenerCb() = default;
virtual ~SharingDhIdListenerCb() = default;
int32_t OnSharing(std::string dhId);
int32_t OnNoSharing(std::string dhId);
~SharingDhIdListenerCb() override = default;
int32_t OnSharing(std::string dhId) override;
int32_t OnNoSharing(std::string dhId) override;
};
class GetSinkScreenInfosCb : public OHOS::DistributedHardware::DistributedInput::GetSinkScreenInfosCallbackStub {
public:
GetSinkScreenInfosCb() = default;
virtual ~GetSinkScreenInfosCb() = default;
void OnResult(const std::string &strJson);
~GetSinkScreenInfosCb() override = default;
void OnResult(const std::string &strJson) override;
};
class DInputClientEventHandler : public AppExecFwk::EventHandler {
public:
DInputClientEventHandler(const std::shared_ptr<AppExecFwk::EventRunner> &runner);
~DInputClientEventHandler() {}
explicit DInputClientEventHandler(const std::shared_ptr<AppExecFwk::EventRunner> &runner);
~DInputClientEventHandler() override = default;
void ProcessEvent(const AppExecFwk::InnerEvent::Pointer &event) override;
};
@@ -31,19 +31,18 @@ class DistributedInputSinkProxy : public IRemoteProxy<IDistributedSinkInput> {
public:
explicit DistributedInputSinkProxy(const sptr<IRemoteObject> &object);
~DistributedInputSinkProxy() override;
virtual ~DistributedInputSinkProxy() override;
int32_t Init() override;
virtual int32_t Init() override;
int32_t Release() override;
virtual int32_t Release() override;
int32_t RegisterGetSinkScreenInfosCallback(sptr<IGetSinkScreenInfosCallback> callback) override;
virtual int32_t RegisterGetSinkScreenInfosCallback(sptr<IGetSinkScreenInfosCallback> callback) override;
int32_t NotifyStartDScreen(const SrcScreenInfo& srcScreenRemoteCtrlInfo) override;
int32_t NotifyStopDScreen(const std::string& srcScreenInfoKey) override;
virtual int32_t NotifyStartDScreen(const SrcScreenInfo& srcScreenRemoteCtrlInfo) override;
virtual int32_t NotifyStopDScreen(const std::string& srcScreenInfoKey) override;
virtual int32_t RegisterSharingDhIdListener(sptr<ISharingDhIdListener> sharingDhIdListener) override;
int32_t RegisterSharingDhIdListener(sptr<ISharingDhIdListener> sharingDhIdListener) override;
private:
bool SendRequest(uint32_t code, MessageParcel &data, MessageParcel &reply);
@@ -28,10 +28,9 @@ namespace DistributedInput {
class DistributedInputSinkStub : public IRemoteStub<IDistributedSinkInput> {
public:
DistributedInputSinkStub();
virtual ~DistributedInputSinkStub() override;
~DistributedInputSinkStub() override;
virtual int32_t OnRemoteRequest(
uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
int32_t InitInner(MessageParcel &data, MessageParcel &reply, MessageOption &option);
@@ -27,64 +27,62 @@ namespace DistributedHardware {
namespace DistributedInput {
class DistributedInputSourceProxy : public IRemoteProxy<IDistributedSourceInput> {
public:
explicit DistributedInputSourceProxy(const sptr<IRemoteObject> &object);
~DistributedInputSourceProxy() override;
virtual ~DistributedInputSourceProxy() override;
int32_t Init() override;
virtual int32_t Init() override;
int32_t Release() override;
virtual int32_t Release() override;
virtual int32_t RegisterDistributedHardware(const std::string& devId, const std::string& dhId,
int32_t RegisterDistributedHardware(const std::string& devId, const std::string& dhId,
const std::string& parameters, sptr<IRegisterDInputCallback> callback) override;
virtual int32_t UnregisterDistributedHardware(const std::string& devId, const std::string& dhId,
int32_t UnregisterDistributedHardware(const std::string& devId, const std::string& dhId,
sptr<IUnregisterDInputCallback> callback) override;
virtual int32_t PrepareRemoteInput(const std::string &deviceId, sptr<IPrepareDInputCallback> callback) override;
int32_t PrepareRemoteInput(const std::string &deviceId, sptr<IPrepareDInputCallback> callback) override;
virtual int32_t UnprepareRemoteInput(const std::string &deviceId, sptr<IUnprepareDInputCallback> callback) override;
int32_t UnprepareRemoteInput(const std::string &deviceId, sptr<IUnprepareDInputCallback> callback) override;
virtual int32_t StartRemoteInput(
int32_t StartRemoteInput(
const std::string& deviceId, const uint32_t& inputTypes, sptr<IStartDInputCallback> callback) override;
virtual int32_t StopRemoteInput(
int32_t StopRemoteInput(
const std::string& deviceId, const uint32_t& inputTypes, sptr<IStopDInputCallback> callback) override;
virtual int32_t StartRemoteInput(const std::string &srcId, const std::string &sinkId, const uint32_t &inputTypes,
int32_t StartRemoteInput(const std::string &srcId, const std::string &sinkId, const uint32_t &inputTypes,
sptr<IStartDInputCallback> callback) override;
virtual int32_t StopRemoteInput(const std::string &srcId, const std::string &sinkId, const uint32_t &inputTypes,
int32_t StopRemoteInput(const std::string &srcId, const std::string &sinkId, const uint32_t &inputTypes,
sptr<IStopDInputCallback> callback) override;
virtual int32_t PrepareRemoteInput(const std::string &srcId, const std::string &sinkId,
int32_t PrepareRemoteInput(const std::string &srcId, const std::string &sinkId,
sptr<IPrepareDInputCallback> callback) override;
virtual int32_t UnprepareRemoteInput(const std::string &srcId, const std::string &sinkId,
int32_t UnprepareRemoteInput(const std::string &srcId, const std::string &sinkId,
sptr<IUnprepareDInputCallback> callback) override;
virtual int32_t StartRemoteInput(const std::string &sinkId, const std::vector<std::string> &dhIds,
int32_t StartRemoteInput(const std::string &sinkId, const std::vector<std::string> &dhIds,
sptr<IStartStopDInputsCallback> callback) override;
virtual int32_t StopRemoteInput(const std::string &sinkId, const std::vector<std::string> &dhIds,
int32_t StopRemoteInput(const std::string &sinkId, const std::vector<std::string> &dhIds,
sptr<IStartStopDInputsCallback> callback) override;
virtual int32_t StartRemoteInput(const std::string &srcId, const std::string &sinkId,
int32_t StartRemoteInput(const std::string &srcId, const std::string &sinkId,
const std::vector<std::string> &dhIds, sptr<IStartStopDInputsCallback> callback) override;
virtual int32_t StopRemoteInput(const std::string &srcId, const std::string &sinkId,
int32_t StopRemoteInput(const std::string &srcId, const std::string &sinkId,
const std::vector<std::string> &dhIds, sptr<IStartStopDInputsCallback> callback) override;
virtual int32_t RegisterAddWhiteListCallback(sptr<IAddWhiteListInfosCallback> addWhiteListCallback) override;
virtual int32_t RegisterDelWhiteListCallback(sptr<IDelWhiteListInfosCallback> delWhiteListCallback) override;
virtual int32_t RegisterInputNodeListener(sptr<InputNodeListener> listener) override;
virtual int32_t UnregisterInputNodeListener(sptr<InputNodeListener> listener) override;
int32_t RegisterAddWhiteListCallback(sptr<IAddWhiteListInfosCallback> addWhiteListCallback) override;
int32_t RegisterDelWhiteListCallback(sptr<IDelWhiteListInfosCallback> delWhiteListCallback) override;
int32_t RegisterInputNodeListener(sptr<InputNodeListener> listener) override;
int32_t UnregisterInputNodeListener(sptr<InputNodeListener> listener) override;
virtual int32_t SyncNodeInfoRemoteInput(const std::string &userDevId, const std::string &dhid,
int32_t SyncNodeInfoRemoteInput(const std::string &userDevId, const std::string &dhid,
const std::string &nodeDesc) override;
virtual int32_t RegisterSimulationEventListener(sptr<ISimulationEventListener> listener) override;
virtual int32_t UnregisterSimulationEventListener(sptr<ISimulationEventListener> listener) override;
int32_t RegisterSimulationEventListener(sptr<ISimulationEventListener> listener) override;
int32_t UnregisterSimulationEventListener(sptr<ISimulationEventListener> listener) override;
private:
bool SendRequest(const IDistributedSourceInput::MessageCode code, MessageParcel &data, MessageParcel &reply);
@@ -28,10 +28,9 @@ namespace DistributedInput {
class DistributedInputSourceStub : public IRemoteStub<IDistributedSourceInput> {
public:
DistributedInputSourceStub();
virtual ~DistributedInputSourceStub() override;
~DistributedInputSourceStub() override;
virtual int32_t OnRemoteRequest(
uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
private:
int32_t HandleInitDistributedHardware(MessageParcel &reply);
@@ -28,10 +28,9 @@ namespace DistributedInput {
class GetSinkScreenInfosCallbackProxy : public IRemoteProxy<IGetSinkScreenInfosCallback> {
public:
explicit GetSinkScreenInfosCallbackProxy(const sptr<IRemoteObject> &object);
~GetSinkScreenInfosCallbackProxy() override;
virtual ~GetSinkScreenInfosCallbackProxy() override;
virtual void OnResult(const std::string& strJson) override;
void OnResult(const std::string& strJson) override;
private:
static inline BrokerDelegator<GetSinkScreenInfosCallbackProxy> delegator_;
@@ -28,7 +28,7 @@ namespace DistributedInput {
class GetSinkScreenInfosCallbackStub : public IRemoteStub<IGetSinkScreenInfosCallback> {
public:
GetSinkScreenInfosCallbackStub();
virtual ~GetSinkScreenInfosCallbackStub() override;
~GetSinkScreenInfosCallbackStub() override;
int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
@@ -28,13 +28,12 @@ namespace DistributedInput {
class InputNodeListenerProxy : public IRemoteProxy<InputNodeListener> {
public:
explicit InputNodeListenerProxy(const sptr<IRemoteObject> &object);
~InputNodeListenerProxy() override;
virtual ~InputNodeListenerProxy() override;
virtual void OnNodeOnLine(const std::string srcDevId, const std::string sinkDevId,
void OnNodeOnLine(const std::string srcDevId, const std::string sinkDevId,
const std::string sinkNodeId, const std::string sinkNodeDesc) override;
virtual void OnNodeOffLine(const std::string srcDevId, const std::string sinkDevId,
void OnNodeOffLine(const std::string srcDevId, const std::string sinkDevId,
const std::string sinkNodeId) override;
private:
@@ -28,7 +28,7 @@ namespace DistributedInput {
class InputNodeListenerStub : public IRemoteStub<InputNodeListener> {
public:
InputNodeListenerStub();
virtual ~InputNodeListenerStub() override;
~InputNodeListenerStub() override;
int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
@@ -28,10 +28,9 @@ namespace DistributedInput {
class PrepareDInputCallbackProxy : public IRemoteProxy<IPrepareDInputCallback> {
public:
explicit PrepareDInputCallbackProxy(const sptr<IRemoteObject> &object);
~PrepareDInputCallbackProxy() override;
virtual ~PrepareDInputCallbackProxy() override;
virtual void OnResult(const std::string& deviceId, const int32_t& status) override;
void OnResult(const std::string& deviceId, const int32_t& status) override;
private:
static inline BrokerDelegator<PrepareDInputCallbackProxy> delegator_;
@@ -28,7 +28,7 @@ namespace DistributedInput {
class PrepareDInputCallbackStub : public IRemoteStub<IPrepareDInputCallback> {
public:
PrepareDInputCallbackStub();
virtual ~PrepareDInputCallbackStub() override;
~PrepareDInputCallbackStub() override;
int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
@@ -28,10 +28,9 @@ namespace DistributedInput {
class RegisterDInputCallbackProxy : public IRemoteProxy<IRegisterDInputCallback> {
public:
explicit RegisterDInputCallbackProxy(const sptr<IRemoteObject> &object);
~RegisterDInputCallbackProxy() override;
virtual ~RegisterDInputCallbackProxy() override;
virtual void OnResult(const std::string& devId, const std::string& dhId, const int32_t& status) override;
void OnResult(const std::string& devId, const std::string& dhId, const int32_t& status) override;
private:
static inline BrokerDelegator<RegisterDInputCallbackProxy> delegator_;
@@ -28,7 +28,7 @@ namespace DistributedInput {
class RegisterDInputCallbackStub : public IRemoteStub<IRegisterDInputCallback> {
public:
RegisterDInputCallbackStub();
virtual ~RegisterDInputCallbackStub() override;
~RegisterDInputCallbackStub() override;
int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
@@ -28,11 +28,10 @@ namespace DistributedInput {
class SharingDhIdListenerProxy : public IRemoteProxy<ISharingDhIdListener> {
public:
explicit SharingDhIdListenerProxy(const sptr<IRemoteObject> &object);
~SharingDhIdListenerProxy() override;
virtual ~SharingDhIdListenerProxy() override;
virtual int32_t OnSharing(std::string dhId) override;
virtual int32_t OnNoSharing(std::string dhId) override;
int32_t OnSharing(std::string dhId) override;
int32_t OnNoSharing(std::string dhId) override;
private:
static inline BrokerDelegator<SharingDhIdListenerProxy> delegator_;
@@ -28,7 +28,7 @@ namespace DistributedInput {
class SharingDhIdListenerStub : public IRemoteStub<ISharingDhIdListener> {
public:
SharingDhIdListenerStub();
virtual ~SharingDhIdListenerStub() override;
~SharingDhIdListenerStub() override;
int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
@@ -28,10 +28,9 @@ namespace DistributedInput {
class SimulationEventListenerProxy : public IRemoteProxy<ISimulationEventListener> {
public:
explicit SimulationEventListenerProxy(const sptr<IRemoteObject> &object);
~SimulationEventListenerProxy() override;
virtual ~SimulationEventListenerProxy() override;
virtual int32_t OnSimulationEvent(uint32_t type, uint32_t code, int32_t value) override;
int32_t OnSimulationEvent(uint32_t type, uint32_t code, int32_t value) override;
private:
static inline BrokerDelegator<SimulationEventListenerProxy> delegator_;
@@ -28,7 +28,7 @@ namespace DistributedInput {
class SimulationEventListenerStub : public IRemoteStub<ISimulationEventListener> {
public:
SimulationEventListenerStub();
virtual ~SimulationEventListenerStub() override;
~SimulationEventListenerStub() override;
int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
@@ -28,8 +28,7 @@ namespace DistributedInput {
class StartDInputCallbackProxy : public IRemoteProxy<IStartDInputCallback> {
public:
explicit StartDInputCallbackProxy(const sptr<IRemoteObject> &object);
virtual ~StartDInputCallbackProxy() override;
~StartDInputCallbackProxy() override;
virtual void OnResult(const std::string& devId, const uint32_t& inputTypes, const int32_t& status) override;
@@ -28,7 +28,7 @@ namespace DistributedInput {
class StartDInputCallbackStub : public IRemoteStub<IStartDInputCallback> {
public:
StartDInputCallbackStub();
virtual ~StartDInputCallbackStub() override;
~StartDInputCallbackStub() override;
int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
@@ -27,9 +27,9 @@ namespace DistributedInput {
class StartStopDInputsCallbackProxy : public IRemoteProxy<IStartStopDInputsCallback> {
public:
explicit StartStopDInputsCallbackProxy(const sptr<IRemoteObject> &object);
virtual ~StartStopDInputsCallbackProxy() override;
~StartStopDInputsCallbackProxy() override;
virtual void OnResultDhids(const std::string &devId, const int32_t &status) override;
void OnResultDhids(const std::string &devId, const int32_t &status) override;
private:
static inline BrokerDelegator<StartStopDInputsCallbackProxy> delegator_;
@@ -27,7 +27,7 @@ namespace DistributedInput {
class StartStopDInputsCallbackStub : public IRemoteStub<IStartStopDInputsCallback> {
public:
StartStopDInputsCallbackStub();
virtual ~StartStopDInputsCallbackStub() override;
~StartStopDInputsCallbackStub() override;
int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
@@ -28,11 +28,11 @@ namespace DistributedInput {
class StartStopResultCallbackProxy : public IRemoteProxy<IStartStopResultCallback> {
public:
explicit StartStopResultCallbackProxy(const sptr<IRemoteObject> &object);
virtual ~StartStopResultCallbackProxy() override;
~StartStopResultCallbackProxy() override;
virtual void OnStart(const std::string &srcId, const std::string &sinkId,
void OnStart(const std::string &srcId, const std::string &sinkId,
std::vector<std::string> &dhIds) override;
virtual void OnStop(const std::string &srcId, const std::string &sinkId,
void OnStop(const std::string &srcId, const std::string &sinkId,
std::vector<std::string> &dhIds) override;
private:
@@ -28,7 +28,7 @@ namespace DistributedInput {
class StartStopResultCallbackStub : public IRemoteStub<IStartStopResultCallback> {
public:
StartStopResultCallbackStub();
virtual ~StartStopResultCallbackStub() override;
~StartStopResultCallbackStub() override;
int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
@@ -28,10 +28,9 @@ namespace DistributedInput {
class StopDInputCallbackProxy : public IRemoteProxy<IStopDInputCallback> {
public:
explicit StopDInputCallbackProxy(const sptr<IRemoteObject> &object);
~StopDInputCallbackProxy() override;
virtual ~StopDInputCallbackProxy() override;
virtual void OnResult(const std::string& devId, const uint32_t& inputTypes, const int32_t& status) override;
void OnResult(const std::string& devId, const uint32_t& inputTypes, const int32_t& status) override;
private:
static inline BrokerDelegator<StopDInputCallbackProxy> delegator_;
@@ -28,7 +28,7 @@ namespace DistributedInput {
class StopDInputCallbackStub : public IRemoteStub<IStopDInputCallback> {
public:
StopDInputCallbackStub();
virtual ~StopDInputCallbackStub() override;
~StopDInputCallbackStub() override;
int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
@@ -28,10 +28,9 @@ namespace DistributedInput {
class UnprepareDInputCallbackProxy : public IRemoteProxy<IUnprepareDInputCallback> {
public:
explicit UnprepareDInputCallbackProxy(const sptr<IRemoteObject> &object);
~UnprepareDInputCallbackProxy() override;
virtual ~UnprepareDInputCallbackProxy() override;
virtual void OnResult(const std::string& deviceId, const int32_t& status) override;
void OnResult(const std::string& deviceId, const int32_t& status) override;
private:
static inline BrokerDelegator<UnprepareDInputCallbackProxy> delegator_;
@@ -28,7 +28,7 @@ namespace DistributedInput {
class UnprepareDInputCallbackStub : public IRemoteStub<IUnprepareDInputCallback> {
public:
UnprepareDInputCallbackStub();
virtual ~UnprepareDInputCallbackStub() override;
~UnprepareDInputCallbackStub() override;
int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
@@ -28,10 +28,9 @@ namespace DistributedInput {
class UnregisterDInputCallbackProxy : public IRemoteProxy<IUnregisterDInputCallback> {
public:
explicit UnregisterDInputCallbackProxy(const sptr<IRemoteObject> &object);
~UnregisterDInputCallbackProxy() override;
virtual ~UnregisterDInputCallbackProxy() override;
virtual void OnResult(const std::string& devId, const std::string& dhId, const int32_t& status) override;
void OnResult(const std::string& devId, const std::string& dhId, const int32_t& status) override;
private:
static inline BrokerDelegator<UnregisterDInputCallbackProxy> delegator_;
@@ -28,7 +28,7 @@ namespace DistributedInput {
class UnregisterDInputCallbackStub : public IRemoteStub<IUnregisterDInputCallback> {
public:
UnregisterDInputCallbackStub();
virtual ~UnregisterDInputCallbackStub() override;
~UnregisterDInputCallbackStub() override;
int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
@@ -211,7 +211,7 @@ void DistributedInputClient::CheckWhiteListCallback()
}
}
if (!isDelWhiteListCbReg) {
sptr<DelWhiteListInfosCb> delCallback= new (std::nothrow) DelWhiteListInfosCb();
sptr<DelWhiteListInfosCb> delCallback = new (std::nothrow) DelWhiteListInfosCb();
int32_t ret =
DInputSAManager::GetInstance().dInputSourceProxy_->RegisterDelWhiteListCallback(delCallback);
if (ret == DH_SUCCESS) {
@@ -23,24 +23,24 @@ namespace DistributedHardware {
namespace DistributedInput {
class DInputSinkTransCallback {
public:
virtual void onPrepareRemoteInput(const int32_t& sessionId, const std::string &deviceId) = 0;
virtual void onUnprepareRemoteInput(const int32_t& sessionId) = 0;
virtual void onStartRemoteInput(const int32_t& sessionId, const uint32_t& inputTypes) = 0;
virtual void onStopRemoteInput(const int32_t& sessionId, const uint32_t& inputTypes) = 0;
virtual void onStartRemoteInputDhid(const int32_t &sessionId, const std::string &strDhids) = 0;
virtual void onStopRemoteInputDhid(const int32_t &sessionId, const std::string &strDhids) = 0;
virtual void OnPrepareRemoteInput(const int32_t& sessionId, const std::string &deviceId) = 0;
virtual void OnUnprepareRemoteInput(const int32_t& sessionId) = 0;
virtual void OnStartRemoteInput(const int32_t& sessionId, const uint32_t& inputTypes) = 0;
virtual void OnStopRemoteInput(const int32_t& sessionId, const uint32_t& inputTypes) = 0;
virtual void OnStartRemoteInputDhid(const int32_t &sessionId, const std::string &strDhids) = 0;
virtual void OnStopRemoteInputDhid(const int32_t &sessionId, const std::string &strDhids) = 0;
virtual void onRelayPrepareRemoteInput(const int32_t &toSrcSessionId, const int32_t &toSinkSessionId,
virtual void OnRelayPrepareRemoteInput(const int32_t &toSrcSessionId, const int32_t &toSinkSessionId,
const std::string &deviceId) = 0;
virtual void onRelayUnprepareRemoteInput(const int32_t &toSrcSessionId, const int32_t &toSinkSessionId,
virtual void OnRelayUnprepareRemoteInput(const int32_t &toSrcSessionId, const int32_t &toSinkSessionId,
const std::string &deviceId) = 0;
virtual void onRelayStartDhidRemoteInput(const int32_t &toSrcSessionId, const int32_t &toSinkSessionId,
virtual void OnRelayStartDhidRemoteInput(const int32_t &toSrcSessionId, const int32_t &toSinkSessionId,
const std::string &deviceId, const std::string &strDhids) = 0;
virtual void onRelayStopDhidRemoteInput(const int32_t &toSrcSessionId, const int32_t &toSinkSessionId,
virtual void OnRelayStopDhidRemoteInput(const int32_t &toSrcSessionId, const int32_t &toSinkSessionId,
const std::string &deviceId, const std::string &strDhids) = 0;
virtual void onRelayStartTypeRemoteInput(const int32_t &toSrcSessionId, const int32_t &toSinkSessionId,
virtual void OnRelayStartTypeRemoteInput(const int32_t &toSrcSessionId, const int32_t &toSinkSessionId,
const std::string &deviceId, uint32_t inputTypes) = 0;
virtual void onRelayStopTypeRemoteInput(const int32_t &toSrcSessionId, const int32_t &toSinkSessionId,
virtual void OnRelayStopTypeRemoteInput(const int32_t &toSrcSessionId, const int32_t &toSinkSessionId,
const std::string &deviceId, uint32_t inputTypes) = 0;
virtual ~DInputSinkTransCallback() {}
};
@@ -23,31 +23,31 @@ namespace DistributedHardware {
namespace DistributedInput {
class DInputSourceTransCallback {
public:
virtual void onResponseRegisterDistributedHardware(const std::string deviceId, const std::string dhId,
virtual void OnResponseRegisterDistributedHardware(const std::string deviceId, const std::string dhId,
bool result) = 0;
virtual void onResponsePrepareRemoteInput(const std::string deviceId, bool result, const std::string &object) = 0;
virtual void onResponseUnprepareRemoteInput(const std::string deviceId, bool result) = 0;
virtual void onResponseStartRemoteInput(const std::string deviceId, const uint32_t inputTypes, bool result) = 0;
virtual void onResponseStopRemoteInput(const std::string deviceId, const uint32_t inputTypes, bool result) = 0;
virtual void onResponseStartRemoteInputDhid(const std::string deviceId, const std::string &dhids, bool result) = 0;
virtual void onResponseStopRemoteInputDhid(const std::string deviceId, const std::string &dhids, bool result) = 0;
virtual void onResponseKeyState(const std::string deviceId, const std::string &dhid, const uint32_t type,
virtual void OnResponsePrepareRemoteInput(const std::string deviceId, bool result, const std::string &object) = 0;
virtual void OnResponseUnprepareRemoteInput(const std::string deviceId, bool result) = 0;
virtual void OnResponseStartRemoteInput(const std::string deviceId, const uint32_t inputTypes, bool result) = 0;
virtual void OnResponseStopRemoteInput(const std::string deviceId, const uint32_t inputTypes, bool result) = 0;
virtual void OnResponseStartRemoteInputDhid(const std::string deviceId, const std::string &dhids, bool result) = 0;
virtual void OnResponseStopRemoteInputDhid(const std::string deviceId, const std::string &dhids, bool result) = 0;
virtual void OnResponseKeyState(const std::string deviceId, const std::string &dhid, const uint32_t type,
const uint32_t code, const uint32_t value) = 0;
virtual void onReceivedEventRemoteInput(const std::string deviceId, const std::string &object) = 0;
virtual void OnReceivedEventRemoteInput(const std::string deviceId, const std::string &object) = 0;
virtual void onResponseRelayPrepareRemoteInput(int32_t sessionId, const std::string &deviceId, bool result,
virtual void OnResponseRelayPrepareRemoteInput(int32_t sessionId, const std::string &deviceId, bool result,
const std::string &object) = 0;
virtual void onResponseRelayUnprepareRemoteInput(int32_t sessionId, const std::string &deviceId, bool result) = 0;
virtual void OnResponseRelayUnprepareRemoteInput(int32_t sessionId, const std::string &deviceId, bool result) = 0;
virtual void onReceiveRelayPrepareResult(int32_t status, const std::string &srcId, const std::string &sinkId) = 0;
virtual void onReceiveRelayUnprepareResult(int32_t status, const std::string &srcId, const std::string &sinkId) = 0;
virtual void onReceiveRelayStartDhidResult(int32_t status, const std::string &srcId, const std::string &sinkId,
virtual void OnReceiveRelayPrepareResult(int32_t status, const std::string &srcId, const std::string &sinkId) = 0;
virtual void OnReceiveRelayUnprepareResult(int32_t status, const std::string &srcId, const std::string &sinkId) = 0;
virtual void OnReceiveRelayStartDhidResult(int32_t status, const std::string &srcId, const std::string &sinkId,
const std::string &dhids) = 0;
virtual void onReceiveRelayStopDhidResult(int32_t status, const std::string &srcId, const std::string &sinkId,
virtual void OnReceiveRelayStopDhidResult(int32_t status, const std::string &srcId, const std::string &sinkId,
const std::string &dhids) = 0;
virtual void onReceiveRelayStartTypeResult(int32_t status, const std::string &srcId, const std::string &sinkId,
virtual void OnReceiveRelayStartTypeResult(int32_t status, const std::string &srcId, const std::string &sinkId,
uint32_t inputTypes) = 0;
virtual void onReceiveRelayStopTypeResult(int32_t status, const std::string &srcId, const std::string &sinkId,
virtual void OnReceiveRelayStopTypeResult(int32_t status, const std::string &srcId, const std::string &sinkId,
uint32_t inputTypes) = 0;
};
} // namespace DistributedInput
@@ -26,8 +26,8 @@ namespace DistributedHardware {
namespace DistributedInput {
class DistributedInputSinkEventHandler : public AppExecFwk::EventHandler {
public:
DistributedInputSinkEventHandler(const std::shared_ptr<AppExecFwk::EventRunner> &runner);
virtual ~DistributedInputSinkEventHandler();
explicit DistributedInputSinkEventHandler(const std::shared_ptr<AppExecFwk::EventRunner> &runner);
~DistributedInputSinkEventHandler() override;
bool ProxyPostTask(const Callback &callback, int64_t delayTime);
@@ -49,35 +49,35 @@ class DistributedInputSinkManager : public SystemAbility, public DistributedInpu
public:
DistributedInputSinkManager(int32_t saId, bool runOnCreate);
~DistributedInputSinkManager();
~DistributedInputSinkManager() override;
class DInputSinkListener : public DInputSinkTransCallback {
public:
DInputSinkListener(DistributedInputSinkManager *manager);
~DInputSinkListener();
void onPrepareRemoteInput(const int32_t& sessionId, const std::string &deviceId);
void onUnprepareRemoteInput(const int32_t& sessionId);
void onStartRemoteInput(const int32_t& sessionId, const uint32_t& inputTypes);
void onStopRemoteInput(const int32_t& sessionId, const uint32_t& inputTypes);
void onStartRemoteInputDhid(const int32_t &sessionId, const std::string &strDhids);
void onStopRemoteInputDhid(const int32_t &sessionId, const std::string &strDhids);
explicit DInputSinkListener(DistributedInputSinkManager *manager);
~DInputSinkListener() override;
void OnPrepareRemoteInput(const int32_t& sessionId, const std::string &deviceId) override;
void OnUnprepareRemoteInput(const int32_t& sessionId) override;
void OnStartRemoteInput(const int32_t& sessionId, const uint32_t& inputTypes) override;
void OnStopRemoteInput(const int32_t& sessionId, const uint32_t& inputTypes) override;
void OnStartRemoteInputDhid(const int32_t &sessionId, const std::string &strDhids) override;
void OnStopRemoteInputDhid(const int32_t &sessionId, const std::string &strDhids) override;
void onRelayPrepareRemoteInput(const int32_t &toSrcSessionId, const int32_t &toSinkSessionId,
const std::string &deviceId);
void onRelayUnprepareRemoteInput(const int32_t &toSrcSessionId, const int32_t &toSinkSessionId,
const std::string &deviceId);
void onRelayStartDhidRemoteInput(const int32_t &toSrcSessionId, const int32_t &toSinkSessionId,
const std::string &deviceId, const std::string &strDhids);
void onRelayStopDhidRemoteInput(const int32_t &toSrcSessionId, const int32_t &toSinkSessionId,
const std::string &deviceId, const std::string &strDhids);
void onRelayStartTypeRemoteInput(const int32_t &toSrcSessionId, const int32_t &toSinkSessionId,
const std::string &deviceId, uint32_t inputTypes);
void onRelayStopTypeRemoteInput(const int32_t &toSrcSessionId, const int32_t &toSinkSessionId,
const std::string &deviceId, uint32_t inputTypes);
void OnRelayPrepareRemoteInput(const int32_t &toSrcSessionId, const int32_t &toSinkSessionId,
const std::string &deviceId) override;
void OnRelayUnprepareRemoteInput(const int32_t &toSrcSessionId, const int32_t &toSinkSessionId,
const std::string &deviceId) override;
void OnRelayStartDhidRemoteInput(const int32_t &toSrcSessionId, const int32_t &toSinkSessionId,
const std::string &deviceId, const std::string &strDhids) override;
void OnRelayStopDhidRemoteInput(const int32_t &toSrcSessionId, const int32_t &toSinkSessionId,
const std::string &deviceId, const std::string &strDhids) override;
void OnRelayStartTypeRemoteInput(const int32_t &toSrcSessionId, const int32_t &toSinkSessionId,
const std::string &deviceId, uint32_t inputTypes) override;
void OnRelayStopTypeRemoteInput(const int32_t &toSrcSessionId, const int32_t &toSinkSessionId,
const std::string &deviceId, uint32_t inputTypes) override;
private:
DistributedInputSinkManager *sinkManagerObj_;
static inline int bit_is_set(const unsigned long *array, int bit)
static inline int BitIsSet(const unsigned long *array, int bit)
{
return !!(array[bit / LONG_BITS] & (1LL << (bit % LONG_BITS)));
}
@@ -88,8 +88,8 @@ public:
class ProjectWindowListener : public PublisherListenerStub {
public:
ProjectWindowListener(DistributedInputSinkManager *manager);
~ProjectWindowListener();
explicit ProjectWindowListener(DistributedInputSinkManager *manager);
~ProjectWindowListener() override;
void OnMessage(const DHTopic topic, const std::string& message) override;
private:
@@ -109,7 +109,7 @@ public:
class DScreenSinkSvrRecipient : public IRemoteObject::DeathRecipient {
public:
DScreenSinkSvrRecipient(const std::string& srcDevId, const uint64_t srcWinId);
~DScreenSinkSvrRecipient();
~DScreenSinkSvrRecipient() override;
void OnRemoteDied(const wptr<IRemoteObject> &remote) override;
private:
@@ -122,11 +122,11 @@ public:
void OnStop() override;
virtual int32_t Init() override;
int32_t Init() override;
virtual int32_t Release() override;
int32_t Release() override;
virtual int32_t RegisterGetSinkScreenInfosCallback(sptr<IGetSinkScreenInfosCallback> callback) override;
int32_t RegisterGetSinkScreenInfosCallback(sptr<IGetSinkScreenInfosCallback> callback) override;
uint32_t GetSinkScreenInfosCbackSize();
@@ -136,7 +136,7 @@ public:
uint32_t GetInputTypes();
void SetInputTypes(const uint32_t& inputTypess);
void SetInputTypes(const uint32_t& inputTypes);
/*
* GetEventHandler, get the ui_service manager service's handler.
@@ -74,10 +74,10 @@ DistributedInputSinkManager::DInputSinkListener::~DInputSinkListener()
DHLOGI("DInputSinkListener destory.");
}
void DistributedInputSinkManager::DInputSinkListener::onPrepareRemoteInput(
void DistributedInputSinkManager::DInputSinkListener::OnPrepareRemoteInput(
const int32_t& sessionId, const std::string &deviceId)
{
DHLOGI("onPrepareRemoteInput called, sessionId: %d, devId: %s", sessionId, GetAnonyString(deviceId).c_str());
DHLOGI("OnPrepareRemoteInput called, sessionId: %d, devId: %s", sessionId, GetAnonyString(deviceId).c_str());
nlohmann::json jsonStr;
jsonStr[DINPUT_SOFTBUS_KEY_CMD_TYPE] = TRANS_SINK_MSG_ONPREPARE;
@@ -104,7 +104,7 @@ void DistributedInputSinkManager::DInputSinkListener::onPrepareRemoteInput(
DHLOGE("query local network id from softbus failed");
}
if (vecFilter.empty() || vecFilter[0].empty() || vecFilter[0][0].empty()) {
DHLOGE("onPrepareRemoteInput called, white list is null.");
DHLOGE("OnPrepareRemoteInput called, white list is null.");
jsonStr[DINPUT_SOFTBUS_KEY_RESP_VALUE] = true;
jsonStr[DINPUT_SOFTBUS_KEY_WHITE_LIST] = "";
smsg = jsonStr.dump();
@@ -119,10 +119,10 @@ void DistributedInputSinkManager::DInputSinkListener::onPrepareRemoteInput(
DistributedInputSinkTransport::GetInstance().RespPrepareRemoteInput(sessionId, smsg);
}
void DistributedInputSinkManager::DInputSinkListener::onUnprepareRemoteInput(const int32_t& sessionId)
void DistributedInputSinkManager::DInputSinkListener::OnUnprepareRemoteInput(const int32_t& sessionId)
{
DHLOGI("onUnprepareRemoteInput called, sessionId: %d", sessionId);
onStopRemoteInput(sessionId, static_cast<uint32_t>(DInputDeviceType::ALL));
DHLOGI("OnUnprepareRemoteInput called, sessionId: %d", sessionId);
OnStopRemoteInput(sessionId, static_cast<uint32_t>(DInputDeviceType::ALL));
DistributedInputSinkSwitch::GetInstance().RemoveSession(sessionId);
nlohmann::json jsonStr;
@@ -132,7 +132,7 @@ void DistributedInputSinkManager::DInputSinkListener::onUnprepareRemoteInput(con
DistributedInputSinkTransport::GetInstance().RespUnprepareRemoteInput(sessionId, smsg);
}
void DistributedInputSinkManager::DInputSinkListener::onRelayPrepareRemoteInput(const int32_t &toSrcSessionId,
void DistributedInputSinkManager::DInputSinkListener::OnRelayPrepareRemoteInput(const int32_t &toSrcSessionId,
const int32_t &toSinkSessionId, const std::string &deviceId)
{
DHLOGI("toSinkSessionId: %s, devId: %s", GetAnonyInt32(toSinkSessionId).c_str(), GetAnonyString(deviceId).c_str());
@@ -178,7 +178,7 @@ void DistributedInputSinkManager::DInputSinkListener::onRelayPrepareRemoteInput(
DistributedInputSinkTransport::GetInstance().RespPrepareRemoteInput(toSinkSessionId, smsg);
}
void DistributedInputSinkManager::DInputSinkListener::onRelayUnprepareRemoteInput(const int32_t &toSrcSessionId,
void DistributedInputSinkManager::DInputSinkListener::OnRelayUnprepareRemoteInput(const int32_t &toSrcSessionId,
const int32_t &toSinkSessionId, const std::string &deviceId)
{
DHLOGI("toSinkSessionId: %d, devId: %s", toSinkSessionId, GetAnonyString(deviceId).c_str());
@@ -194,11 +194,11 @@ void DistributedInputSinkManager::DInputSinkListener::onRelayUnprepareRemoteInpu
DistributedInputSinkTransport::GetInstance().RespUnprepareRemoteInput(toSinkSessionId, smsg);
}
void DistributedInputSinkManager::DInputSinkListener::onStartRemoteInput(
void DistributedInputSinkManager::DInputSinkListener::OnStartRemoteInput(
const int32_t& sessionId, const uint32_t& inputTypes)
{
int32_t curSessionId = DistributedInputSinkSwitch::GetInstance().GetSwitchOpenedSession();
DHLOGI("onStartRemoteInput called, cursessionId: %d, new sessionId: %d", curSessionId, sessionId);
DHLOGI("OnStartRemoteInput called, cursessionId: %d, new sessionId: %d", curSessionId, sessionId);
// set new session
int32_t startRes = DistributedInputSinkSwitch::GetInstance().StartSwitch(sessionId);
@@ -235,10 +235,10 @@ void DistributedInputSinkManager::DInputSinkListener::onStartRemoteInput(
}
}
void DistributedInputSinkManager::DInputSinkListener::onStopRemoteInput(
void DistributedInputSinkManager::DInputSinkListener::OnStopRemoteInput(
const int32_t& sessionId, const uint32_t& inputTypes)
{
DHLOGI("onStopRemoteInput called, sessionId: %d, inputTypes: %d, curInputTypes: %d",
DHLOGI("OnStopRemoteInput called, sessionId: %d, inputTypes: %d, curInputTypes: %d",
sessionId, inputTypes, sinkManagerObj_->GetInputTypes());
sinkManagerObj_->SetInputTypes(sinkManagerObj_->GetInputTypes() -
@@ -268,11 +268,11 @@ void DistributedInputSinkManager::DInputSinkListener::onStopRemoteInput(
}
}
void DistributedInputSinkManager::DInputSinkListener::onStartRemoteInputDhid(const int32_t &sessionId,
void DistributedInputSinkManager::DInputSinkListener::OnStartRemoteInputDhid(const int32_t &sessionId,
const std::string &strDhids)
{
int32_t curSessionId = DistributedInputSinkSwitch::GetInstance().GetSwitchOpenedSession();
DHLOGE("onStartRemoteInputDhid called, cursessionId: %d, new sessionId: %d",
DHLOGE("OnStartRemoteInputDhid called, cursessionId: %d, new sessionId: %d",
curSessionId, sessionId);
// set new session
int32_t startRes = DistributedInputSinkSwitch::GetInstance().StartSwitch(sessionId);
@@ -285,12 +285,12 @@ void DistributedInputSinkManager::DInputSinkListener::onStartRemoteInputDhid(con
DistributedInputSinkTransport::GetInstance().RespStartRemoteInput(sessionId, smsgSta);
if (startRes != DH_SUCCESS) {
DHLOGE("onStartRemoteInputDhid StartSwitch error.");
DHLOGE("OnStartRemoteInputDhid StartSwitch error.");
return;
}
if (curSessionId == ERR_DH_INPUT_SERVER_SINK_GET_OPEN_SESSION_FAIL) {
DHLOGW("onStartRemoteInputDhid called, this is the only session.");
DHLOGW("OnStartRemoteInputDhid called, this is the only session.");
}
std::thread(&DistributedInputSinkManager::DInputSinkListener::CheckKeyState, this, sessionId, strDhids).detach();
@@ -304,10 +304,10 @@ void DistributedInputSinkManager::DInputSinkListener::onStartRemoteInputDhid(con
}
}
void DistributedInputSinkManager::DInputSinkListener::onStopRemoteInputDhid(const int32_t &sessionId,
void DistributedInputSinkManager::DInputSinkListener::OnStopRemoteInputDhid(const int32_t &sessionId,
const std::string &strDhids)
{
DHLOGI("onStopRemoteInputDhid called, sessionId: %d", sessionId);
DHLOGI("OnStopRemoteInputDhid called, sessionId: %d", sessionId);
std::vector<std::string> stopIndeedDhIds;
std::vector<std::string> stopOnCmdDhIds;
StringSplit(strDhids, INPUT_STRING_SPLIT_POINT, stopOnCmdDhIds);
@@ -318,7 +318,7 @@ void DistributedInputSinkManager::DInputSinkListener::onStopRemoteInputDhid(cons
DistributedInputCollector::GetInstance().ReportDhIdSharingState(stopIndeedOnes);
if (DistributedInputCollector::GetInstance().IsAllDevicesStoped()) {
DHLOGE("onStopRemoteInputDhid called, all dhid stop sharing, sessionId: %d is closed.", sessionId);
DHLOGE("OnStopRemoteInputDhid called, all dhid stop sharing, sessionId: %d is closed.", sessionId);
DistributedInputSinkSwitch::GetInstance().StopSwitch(sessionId);
}
@@ -341,7 +341,7 @@ void DistributedInputSinkManager::DInputSinkListener::onStopRemoteInputDhid(cons
}
}
void DistributedInputSinkManager::DInputSinkListener::onRelayStartDhidRemoteInput(const int32_t &toSrcSessionId,
void DistributedInputSinkManager::DInputSinkListener::OnRelayStartDhidRemoteInput(const int32_t &toSrcSessionId,
const int32_t &toSinkSessionId, const std::string &deviceId, const std::string &strDhids)
{
int32_t curSessionId = DistributedInputSinkSwitch::GetInstance().GetSwitchOpenedSession();
@@ -379,7 +379,7 @@ void DistributedInputSinkManager::DInputSinkListener::onRelayStartDhidRemoteInpu
}
}
void DistributedInputSinkManager::DInputSinkListener::onRelayStopDhidRemoteInput(const int32_t &toSrcSessionId,
void DistributedInputSinkManager::DInputSinkListener::OnRelayStopDhidRemoteInput(const int32_t &toSrcSessionId,
const int32_t &toSinkSessionId, const std::string &deviceId, const std::string &strDhids)
{
DHLOGI("toSinkSessionId: %d", toSinkSessionId);
@@ -393,7 +393,7 @@ void DistributedInputSinkManager::DInputSinkListener::onRelayStopDhidRemoteInput
DistributedInputCollector::GetInstance().ReportDhIdSharingState(stopIndeedOnes);
if (DistributedInputCollector::GetInstance().IsAllDevicesStoped()) {
DHLOGE("onStopRemoteInputDhid called, all dhid stop sharing, sessionId: %d is closed.", toSinkSessionId);
DHLOGE("OnStopRemoteInputDhid called, all dhid stop sharing, sessionId: %d is closed.", toSinkSessionId);
DistributedInputSinkSwitch::GetInstance().StopSwitch(toSinkSessionId);
}
@@ -411,13 +411,13 @@ void DistributedInputSinkManager::DInputSinkListener::onRelayStopDhidRemoteInput
sinkManagerObj_->SetInputTypes(static_cast<uint32_t>(DInputDeviceType::NONE));
if (DistributedInputSinkSwitch::GetInstance().GetSwitchOpenedSession() ==
ERR_DH_INPUT_SERVER_SINK_GET_OPEN_SESSION_FAIL) {
DHLOGI("onStartRemoteInput called, all session is stop.");
DHLOGI("OnStartRemoteInput called, all session is stop.");
sinkManagerObj_->SetStartTransFlag(DInputServerType::NULL_SERVER_TYPE);
}
}
}
void DistributedInputSinkManager::DInputSinkListener::onRelayStartTypeRemoteInput(const int32_t &toSrcSessionId,
void DistributedInputSinkManager::DInputSinkListener::OnRelayStartTypeRemoteInput(const int32_t &toSrcSessionId,
const int32_t &toSinkSessionId, const std::string &deviceId, uint32_t inputTypes)
{
int32_t curSessionId = DistributedInputSinkSwitch::GetInstance().GetSwitchOpenedSession();
@@ -461,10 +461,10 @@ void DistributedInputSinkManager::DInputSinkListener::onRelayStartTypeRemoteInpu
}
}
void DistributedInputSinkManager::DInputSinkListener::onRelayStopTypeRemoteInput(const int32_t &toSrcSessionId,
void DistributedInputSinkManager::DInputSinkListener::OnRelayStopTypeRemoteInput(const int32_t &toSrcSessionId,
const int32_t &toSinkSessionId, const std::string &deviceId, uint32_t inputTypes)
{
DHLOGI("onStopRemoteInput called, sessionId: %d, inputTypes: %d, curInputTypes: %d",
DHLOGI("OnStopRemoteInput called, sessionId: %d, inputTypes: %d, curInputTypes: %d",
toSinkSessionId, inputTypes, sinkManagerObj_->GetInputTypes());
sinkManagerObj_->SetInputTypes(sinkManagerObj_->GetInputTypes() -
@@ -556,15 +556,15 @@ void DistributedInputSinkManager::DInputSinkListener::CheckKeyState(const int32_
SleepTimeMs();
continue;
}
leftKeyVal = bit_is_set(keystate, BTN_LEFT);
leftKeyVal = BitIsSet(keystate, BTN_LEFT);
if (leftKeyVal != 0) {
DistributedInputSinkTransport::GetInstance().SendKeyStateNodeMsg(sessionId, dhid, BTN_LEFT);
}
rightKeyVal = bit_is_set(keystate, BTN_RIGHT);
rightKeyVal = BitIsSet(keystate, BTN_RIGHT);
if (rightKeyVal != 0) {
DistributedInputSinkTransport::GetInstance().SendKeyStateNodeMsg(sessionId, dhid, BTN_RIGHT);
}
midKeyVal = bit_is_set(keystate, BTN_MIDDLE);
midKeyVal = BitIsSet(keystate, BTN_MIDDLE);
if (midKeyVal != 0) {
DistributedInputSinkTransport::GetInstance().SendKeyStateNodeMsg(sessionId, dhid, BTN_MIDDLE);
}
@@ -774,7 +774,7 @@ DInputServerType DistributedInputSinkManager::GetStartTransFlag()
}
void DistributedInputSinkManager::SetStartTransFlag(const DInputServerType flag)
{
DHLOGI("Set Sink isStartTrans_ %d", (int32_t)flag);
DHLOGI("Set Sink isStartTrans_ %d", static_cast<int32_t>(flag));
isStartTrans_ = flag;
}
@@ -894,8 +894,8 @@ int32_t DistributedInputSinkManager::ProjectWindowListener::UpdateSinkScreenInfo
sinkScreenInfo.sinkShowWidth = GetScreenWidth();
sinkScreenInfo.sinkShowHeight = GetScreenHeight();
LocalAbsInfo info = DInputContext::GetInstance().GetLocalTouchScreenInfo().localAbsInfo;
sinkScreenInfo.sinkPhyWidth = (uint32_t)(info.absMtPositionXMax + 1);
sinkScreenInfo.sinkPhyHeight = (uint32_t)(info.absMtPositionYMax + 1);
sinkScreenInfo.sinkPhyWidth = static_cast<uint32_t>(info.absMtPositionXMax + 1);
sinkScreenInfo.sinkPhyHeight = static_cast<uint32_t>(info.absMtPositionYMax + 1);
DHLOGI("sinkShowWinId: %d, sinkProjShowWidth: %d, sinkProjShowHeight: %d, sinkWinShowX: %d, sinkWinShowY: %d,"
"sinkShowWidth: %d, sinkShowHeight: %d, sinkPhyWidth: %d, sinkPhyHeight: %d", sinkScreenInfo.sinkShowWinId,
sinkScreenInfo.sinkProjShowWidth, sinkScreenInfo.sinkProjShowHeight, sinkScreenInfo.sinkWinShowX,
@@ -54,8 +54,8 @@ public:
class DInputSinkEventHandler : public AppExecFwk::EventHandler {
public:
DInputSinkEventHandler(const std::shared_ptr<AppExecFwk::EventRunner> &runner);
~DInputSinkEventHandler() {}
explicit DInputSinkEventHandler(const std::shared_ptr<AppExecFwk::EventRunner> &runner);
~DInputSinkEventHandler() override = default;
void ProcessEvent(const AppExecFwk::InnerEvent::Pointer &event) override;
void RecordEventLog(const std::shared_ptr<nlohmann::json> &events);
@@ -411,7 +411,7 @@ void DistributedInputSinkTransport::NotifyPrepareRemoteInput(int32_t sessionId,
std::string deviceId = recMsg[DINPUT_SOFTBUS_KEY_DEVICE_ID];
DHLOGI("OnBytesReceived cmdType is TRANS_SOURCE_MSG_PREPARE deviceId:%s.",
GetAnonyString(deviceId).c_str());
callback_->onPrepareRemoteInput(sessionId, deviceId);
callback_->OnPrepareRemoteInput(sessionId, deviceId);
}
void DistributedInputSinkTransport::NotifyUnprepareRemoteInput(int32_t sessionId, const nlohmann::json &recMsg)
@@ -423,7 +423,7 @@ void DistributedInputSinkTransport::NotifyUnprepareRemoteInput(int32_t sessionId
std::string deviceId = recMsg[DINPUT_SOFTBUS_KEY_DEVICE_ID];
DHLOGI("OnBytesReceived cmdType TRANS_SOURCE_MSG_UNPREPARE deviceId:%s.",
GetAnonyString(deviceId).c_str());
callback_->onUnprepareRemoteInput(sessionId);
callback_->OnUnprepareRemoteInput(sessionId);
}
void DistributedInputSinkTransport::NotifyStartRemoteInput(int32_t sessionId, const nlohmann::json &recMsg)
@@ -436,7 +436,7 @@ void DistributedInputSinkTransport::NotifyStartRemoteInput(int32_t sessionId, co
uint32_t inputTypes = recMsg[DINPUT_SOFTBUS_KEY_INPUT_TYPE];
DHLOGI("OnBytesRecei,ved cmdType is TRANS_SOURCE_MSG_START_TYPE deviceId:%s inputTypes:%d .",
GetAnonyString(deviceId).c_str(), inputTypes);
callback_->onStartRemoteInput(sessionId, inputTypes);
callback_->OnStartRemoteInput(sessionId, inputTypes);
}
void DistributedInputSinkTransport::NotifyStopRemoteInput(int32_t sessionId, const nlohmann::json &recMsg)
@@ -448,7 +448,7 @@ void DistributedInputSinkTransport::NotifyStopRemoteInput(int32_t sessionId, con
std::string deviceId = recMsg[DINPUT_SOFTBUS_KEY_DEVICE_ID];
uint32_t inputTypes = recMsg[DINPUT_SOFTBUS_KEY_INPUT_TYPE];
DHLOGI("OnBytesReceived cmdType is TRANS_SOURCE_MSG_STOP_TYPE deviceId:%s.", GetAnonyString(deviceId).c_str());
callback_->onStopRemoteInput(sessionId, inputTypes);
callback_->OnStopRemoteInput(sessionId, inputTypes);
}
void DistributedInputSinkTransport::NotifyLatency(int32_t sessionId, const nlohmann::json &recMsg)
@@ -486,7 +486,7 @@ void DistributedInputSinkTransport::NotifyStartRemoteInputDhid(int32_t sessionId
std::string strTmp = recMsg[DINPUT_SOFTBUS_KEY_VECTOR_DHID];
DHLOGI("OnBytesReceived cmdType is TRANS_SOURCE_MSG_START_DHID deviceId:%s .",
GetAnonyString(deviceId).c_str());
callback_->onStartRemoteInputDhid(sessionId, strTmp);
callback_->OnStartRemoteInputDhid(sessionId, strTmp);
}
void DistributedInputSinkTransport::NotifyStopRemoteInputDhid(int32_t sessionId, const nlohmann::json &recMsg)
@@ -505,7 +505,7 @@ void DistributedInputSinkTransport::NotifyStopRemoteInputDhid(int32_t sessionId,
std::string strTmp = recMsg[DINPUT_SOFTBUS_KEY_VECTOR_DHID];
DHLOGE("OnBytesReceived cmdType is TRANS_SOURCE_MSG_STOP_DHID deviceId:%s.",
GetAnonyString(deviceId).c_str());
callback_->onStopRemoteInputDhid(sessionId, strTmp);
callback_->OnStopRemoteInputDhid(sessionId, strTmp);
}
void DistributedInputSinkTransport::NotifyRelayPrepareRemoteInput(int32_t sessionId, const nlohmann::json &recMsg)
@@ -522,7 +522,7 @@ void DistributedInputSinkTransport::NotifyRelayPrepareRemoteInput(int32_t sessio
int32_t toSrcSessionId = recMsg[DINPUT_SOFTBUS_KEY_SESSION_ID];
DHLOGI("OnBytesReceived cmdType is TRANS_SOURCE_MSG_PREPARE_FOR_REL deviceId:%s.",
GetAnonyString(deviceId).c_str());
callback_->onRelayPrepareRemoteInput(toSrcSessionId, sessionId, deviceId);
callback_->OnRelayPrepareRemoteInput(toSrcSessionId, sessionId, deviceId);
}
void DistributedInputSinkTransport::NotifyRelayUnprepareRemoteInput(int32_t sessionId, const nlohmann::json &recMsg)
@@ -539,7 +539,7 @@ void DistributedInputSinkTransport::NotifyRelayUnprepareRemoteInput(int32_t sess
int32_t toSrcSessionId = recMsg[DINPUT_SOFTBUS_KEY_SESSION_ID];
DHLOGI("OnBytesReceived cmdType is TRANS_SOURCE_MSG_UNPREPARE_FOR_REL deviceId:%s.",
GetAnonyString(deviceId).c_str());
callback_->onRelayUnprepareRemoteInput(toSrcSessionId, sessionId, deviceId);
callback_->OnRelayUnprepareRemoteInput(toSrcSessionId, sessionId, deviceId);
}
void DistributedInputSinkTransport::NotifyRelayStartDhidRemoteInput(int32_t sessionId, const nlohmann::json &recMsg)
@@ -561,7 +561,7 @@ void DistributedInputSinkTransport::NotifyRelayStartDhidRemoteInput(int32_t sess
std::string dhids = recMsg[DINPUT_SOFTBUS_KEY_VECTOR_DHID];
DHLOGI("OnBytesReceived cmdType is TRANS_SOURCE_MSG_START_DHID_FOR_REL deviceId:%s.",
GetAnonyString(deviceId).c_str());
callback_->onRelayStartDhidRemoteInput(toSrcSessionId, sessionId, deviceId, dhids);
callback_->OnRelayStartDhidRemoteInput(toSrcSessionId, sessionId, deviceId, dhids);
}
void DistributedInputSinkTransport::NotifyRelayStopDhidRemoteInput(int32_t sessionId, const nlohmann::json &recMsg)
@@ -583,7 +583,7 @@ void DistributedInputSinkTransport::NotifyRelayStopDhidRemoteInput(int32_t sessi
std::string dhids = recMsg[DINPUT_SOFTBUS_KEY_VECTOR_DHID];
DHLOGI("OnBytesReceived cmdType is TRANS_SOURCE_MSG_STOP_DHID_FOR_REL deviceId:%s.",
GetAnonyString(deviceId).c_str());
callback_->onRelayStopDhidRemoteInput(toSrcSessionId, sessionId, deviceId, dhids);
callback_->OnRelayStopDhidRemoteInput(toSrcSessionId, sessionId, deviceId, dhids);
}
void DistributedInputSinkTransport::NotifyRelayStartTypeRemoteInput(int32_t sessionId, const nlohmann::json &recMsg)
@@ -605,7 +605,7 @@ void DistributedInputSinkTransport::NotifyRelayStartTypeRemoteInput(int32_t sess
uint32_t inputTypes = recMsg[DINPUT_SOFTBUS_KEY_INPUT_TYPE];
DHLOGI("OnBytesReceived cmdType is TRANS_SOURCE_MSG_START_TYPE_FOR_REL deviceId:%s.",
GetAnonyString(deviceId).c_str());
callback_->onRelayStartTypeRemoteInput(toSrcSessionId, sessionId, deviceId, inputTypes);
callback_->OnRelayStartTypeRemoteInput(toSrcSessionId, sessionId, deviceId, inputTypes);
}
void DistributedInputSinkTransport::NotifyRelayStopTypeRemoteInput(int32_t sessionId, const nlohmann::json &recMsg)
@@ -627,7 +627,7 @@ void DistributedInputSinkTransport::NotifyRelayStopTypeRemoteInput(int32_t sessi
uint32_t inputTypes = recMsg[DINPUT_SOFTBUS_KEY_INPUT_TYPE];
DHLOGI("OnBytesReceived cmdType is TRANS_SOURCE_MSG_STOP_TYPE_FOR_REL deviceId:%s.",
GetAnonyString(deviceId).c_str());
callback_->onRelayStopTypeRemoteInput(toSrcSessionId, sessionId, deviceId, inputTypes);
callback_->OnRelayStopTypeRemoteInput(toSrcSessionId, sessionId, deviceId, inputTypes);
}
void DistributedInputSinkTransport::HandleSessionData(int32_t sessionId, const std::string& message)
@@ -64,9 +64,6 @@ private:
std::mutex inputNodeManagerMutex_;
std::set<sptr<InputNodeListener>> inputNodeListeners_;
std::mutex inputNodeListenersMutex_;
// The event queue.
static const int EVENT_BUFFER_SIZE = 16;
};
} // namespace DistributedInput
} // namespace DistributedHardware
@@ -34,7 +34,7 @@ namespace DistributedHardware {
namespace DistributedInput {
class VirtualDevice {
public:
VirtualDevice(const InputDevice& event);
explicit VirtualDevice(const InputDevice& event);
virtual ~VirtualDevice();
bool DoIoctl(int32_t fd, int32_t request, const uint32_t value);
bool CreateKey();
@@ -23,8 +23,8 @@ namespace DistributedHardware {
namespace DistributedInput {
class VirtualKeyboard : public VirtualDevice {
public:
VirtualKeyboard(const InputDevice& event);
~VirtualKeyboard();
explicit VirtualKeyboard(const InputDevice& event);
~VirtualKeyboard() override;
protected:
const std::vector<uint32_t>& GetEventTypes() const override;
const std::vector<uint32_t>& GetKeys() const override;
@@ -23,8 +23,8 @@ namespace DistributedHardware {
namespace DistributedInput {
class VirtualMouse : public VirtualDevice {
public:
VirtualMouse(const InputDevice& event);
~VirtualMouse();
explicit VirtualMouse(const InputDevice& event);
~VirtualMouse() override;
protected:
const std::vector<uint32_t>& GetEventTypes() const override;
const std::vector<uint32_t>& GetKeys() const override;
@@ -23,8 +23,8 @@ namespace DistributedHardware {
namespace DistributedInput {
class VirtualTouchpad : public VirtualDevice {
public:
VirtualTouchpad(const InputDevice& event);
~VirtualTouchpad();
explicit VirtualTouchpad(const InputDevice& event);
~VirtualTouchpad() override;
protected:
const std::vector<uint32_t>& GetEventTypes() const override;
const std::vector<uint32_t>& GetKeys() const override;
@@ -25,7 +25,7 @@ namespace DistributedInput {
class VirtualTouchScreen : public VirtualDevice {
public:
VirtualTouchScreen(const InputDevice& event, LocalAbsInfo& absInfo, uint32_t phyWidth, uint32_t phyHeight);
~VirtualTouchScreen();
~VirtualTouchScreen() override;
protected:
const std::vector<uint32_t>& GetEventTypes() const override;
const std::vector<uint32_t>& GetKeys() const override;
@@ -276,23 +276,23 @@ int32_t DistributedInputNodeManager::GetDeviceInfo(std::string &deviceId)
void DistributedInputNodeManager::GetDevicesInfoByType(const std::string &networkId, uint32_t inputTypes,
std::map<int32_t, std::string> &datas)
{
uint32_t input_types_ = 0;
uint32_t inputType = 0;
if ((inputTypes & static_cast<uint32_t>(DInputDeviceType::MOUSE)) != 0) {
input_types_ |= INPUT_DEVICE_CLASS_CURSOR;
inputType |= INPUT_DEVICE_CLASS_CURSOR;
}
if ((inputTypes & static_cast<uint32_t>(DInputDeviceType::KEYBOARD)) != 0) {
input_types_ |= INPUT_DEVICE_CLASS_KEYBOARD;
inputType |= INPUT_DEVICE_CLASS_KEYBOARD;
}
if ((inputTypes & static_cast<uint32_t>(DInputDeviceType::MOUSE)) != 0) {
input_types_ |= INPUT_DEVICE_CLASS_TOUCH;
inputType |= INPUT_DEVICE_CLASS_TOUCH;
}
std::lock_guard<std::mutex> lock(virtualDeviceMapMutex_);
for (const auto &[id, virdevice] : virtualDeviceMap_) {
if ((virdevice->GetDeviceType() & input_types_) && (virdevice->GetNetWorkId() == networkId)) {
if ((virdevice->GetDeviceType() & inputType) && (virdevice->GetNetWorkId() == networkId)) {
datas.insert(std::pair<int32_t, std::string>(virdevice->GetDeviceFd(), id));
}
}
@@ -57,7 +57,7 @@ bool VirtualDevice::DoIoctl(int32_t fd, int32_t request, const uint32_t value)
bool VirtualDevice::CreateKey()
{
auto fun = [&](int32_t uiSet, const std::vector<uint32_t>& list) -> bool {
auto fun = [this](int32_t uiSet, const std::vector<uint32_t>& list) -> bool {
for (uint32_t evt_type : list) {
if (!DoIoctl(fd_, uiSet, evt_type)) {
DHLOGE("Error setting event type: %u", evt_type);
@@ -139,11 +139,11 @@ bool VirtualDevice::SetUp(const std::string& devId, const std::string& dhId)
}
DHLOGI("create fd %d", fd_);
char sysfs_device_name[16];
if (ioctl(fd_, UI_GET_SYSNAME(sizeof(sysfs_device_name)), sysfs_device_name) < 0) {
char sysfsDeviceName[16] = {0};
if (ioctl(fd_, UI_GET_SYSNAME(sizeof(sysfsDeviceName)), sysfsDeviceName) < 0) {
DHLOGE("Unable to get input device name");
}
DHLOGI("get input device name: %s, fd: %d", GetAnonyString(sysfs_device_name).c_str(), fd_);
DHLOGI("get input device name: %s, fd: %d", GetAnonyString(sysfsDeviceName).c_str(), fd_);
return true;
}
@@ -34,7 +34,7 @@ const std::vector<uint32_t> RELBITS {};
VirtualTouchpad::VirtualTouchpad(const InputDevice& event) : VirtualDevice(event)
{
const int ABS_MAX_WHEEL = 71;
const int absMaxWheel = 71;
dev_.absmin[ABS_X] = 0;
dev_.absmax[ABS_X] = 1;
@@ -47,7 +47,7 @@ VirtualTouchpad::VirtualTouchpad(const InputDevice& event) : VirtualDevice(event
dev_.absflat[ABS_Y] = 0;
dev_.absmin[ABS_WHEEL] = 0;
dev_.absmax[ABS_WHEEL] = ABS_MAX_WHEEL;
dev_.absmax[ABS_WHEEL] = absMaxWheel;
dev_.absfuzz[ABS_WHEEL] = 0;
dev_.absflat[ABS_WHEEL] = 0;
@@ -40,12 +40,12 @@ VirtualTouchScreen::VirtualTouchScreen(const InputDevice& event, LocalAbsInfo& a
uint32_t phyHeight) : VirtualDevice(event)
{
dev_.absmin[ABS_X] = 0;
dev_.absmax[ABS_X] = (int32_t)phyWidth;
dev_.absmax[ABS_X] = static_cast<int32_t>(phyWidth);
dev_.absfuzz[ABS_X] = 0;
dev_.absflat[ABS_X] = 0;
dev_.absmin[ABS_Y] = 0;
dev_.absmax[ABS_Y] = (int32_t)phyHeight;
dev_.absmax[ABS_Y] = static_cast<int32_t>(phyHeight);
dev_.absfuzz[ABS_Y] = 0;
dev_.absflat[ABS_Y] = 0;
@@ -70,12 +70,12 @@ VirtualTouchScreen::VirtualTouchScreen(const InputDevice& event, LocalAbsInfo& a
dev_.absflat[ABS_MT_ORIENTATION] = 0;
dev_.absmin[ABS_MT_POSITION_X] = 0;
dev_.absmax[ABS_MT_POSITION_X] = (int32_t)phyWidth;
dev_.absmax[ABS_MT_POSITION_X] = static_cast<int32_t>(phyWidth);
dev_.absfuzz[ABS_MT_POSITION_X] = 0;
dev_.absflat[ABS_MT_POSITION_X] = 0;
dev_.absmin[ABS_MT_POSITION_Y] = 0;
dev_.absmax[ABS_MT_POSITION_Y] = (int32_t)phyHeight;
dev_.absmax[ABS_MT_POSITION_Y] = static_cast<int32_t>(phyHeight);
dev_.absfuzz[ABS_MT_POSITION_Y] = 0;
dev_.absflat[ABS_MT_POSITION_Y] = 0;
@@ -26,8 +26,8 @@ namespace DistributedHardware {
namespace DistributedInput {
class DistributedInputSourceEventHandler : public AppExecFwk::EventHandler {
public:
DistributedInputSourceEventHandler(const std::shared_ptr<AppExecFwk::EventRunner> &runner);
virtual ~DistributedInputSourceEventHandler();
explicit DistributedInputSourceEventHandler(const std::shared_ptr<AppExecFwk::EventRunner> &runner);
~DistributedInputSourceEventHandler() override;
bool ProxyPostTask(const Callback &callback, int64_t delayTime);
@@ -118,65 +118,65 @@ typedef struct InputDeviceId {
public:
DistributedInputSourceManager(int32_t saId, bool runOnCreate);
~DistributedInputSourceManager();
~DistributedInputSourceManager() override;
void OnStart() override;
void OnStop() override;
virtual int32_t Init() override;
int32_t Init() override;
virtual int32_t Release() override;
int32_t Release() override;
virtual int32_t RegisterDistributedHardware(const std::string& devId, const std::string& dhId,
int32_t RegisterDistributedHardware(const std::string& devId, const std::string& dhId,
const std::string& parameters, sptr<IRegisterDInputCallback> callback) override;
virtual int32_t UnregisterDistributedHardware(const std::string& devId, const std::string& dhId,
int32_t UnregisterDistributedHardware(const std::string& devId, const std::string& dhId,
sptr<IUnregisterDInputCallback> callback) override;
virtual int32_t PrepareRemoteInput(const std::string &deviceId, sptr<IPrepareDInputCallback> callback) override;
int32_t PrepareRemoteInput(const std::string &deviceId, sptr<IPrepareDInputCallback> callback) override;
virtual int32_t UnprepareRemoteInput(const std::string &deviceId, sptr<IUnprepareDInputCallback> callback) override;
int32_t UnprepareRemoteInput(const std::string &deviceId, sptr<IUnprepareDInputCallback> callback) override;
virtual int32_t StartRemoteInput(
int32_t StartRemoteInput(
const std::string& deviceId, const uint32_t& inputTypes, sptr<IStartDInputCallback> callback) override;
virtual int32_t StopRemoteInput(
int32_t StopRemoteInput(
const std::string& deviceId, const uint32_t& inputTypes, sptr<IStopDInputCallback> callback) override;
virtual int32_t StartRemoteInput(const std::string &srcId, const std::string &sinkId, const uint32_t &inputTypes,
int32_t StartRemoteInput(const std::string &srcId, const std::string &sinkId, const uint32_t &inputTypes,
sptr<IStartDInputCallback> callback) override;
virtual int32_t StopRemoteInput(const std::string &srcId, const std::string &sinkId, const uint32_t &inputTypes,
int32_t StopRemoteInput(const std::string &srcId, const std::string &sinkId, const uint32_t &inputTypes,
sptr<IStopDInputCallback> callback) override;
virtual int32_t PrepareRemoteInput(const std::string &srcId, const std::string &sinkId,
int32_t PrepareRemoteInput(const std::string &srcId, const std::string &sinkId,
sptr<IPrepareDInputCallback> callback) override;
virtual int32_t UnprepareRemoteInput(const std::string &srcId, const std::string &sinkId,
int32_t UnprepareRemoteInput(const std::string &srcId, const std::string &sinkId,
sptr<IUnprepareDInputCallback> callback) override;
virtual int32_t StartRemoteInput(const std::string &sinkId, const std::vector<std::string> &dhIds,
int32_t StartRemoteInput(const std::string &sinkId, const std::vector<std::string> &dhIds,
sptr<IStartStopDInputsCallback> callback) override;
virtual int32_t StopRemoteInput(const std::string &sinkId, const std::vector<std::string> &dhIds,
int32_t StopRemoteInput(const std::string &sinkId, const std::vector<std::string> &dhIds,
sptr<IStartStopDInputsCallback> callback) override;
virtual int32_t StartRemoteInput(const std::string &srcId, const std::string &sinkId,
int32_t StartRemoteInput(const std::string &srcId, const std::string &sinkId,
const std::vector<std::string> &dhIds, sptr<IStartStopDInputsCallback> callback) override;
virtual int32_t StopRemoteInput(const std::string &srcId, const std::string &sinkId,
int32_t StopRemoteInput(const std::string &srcId, const std::string &sinkId,
const std::vector<std::string> &dhIds, sptr<IStartStopDInputsCallback> callback) override;
virtual int32_t RegisterAddWhiteListCallback(sptr<IAddWhiteListInfosCallback> addWhiteListCallback) override;
virtual int32_t RegisterDelWhiteListCallback(sptr<IDelWhiteListInfosCallback> delWhiteListCallback) override;
virtual int32_t RegisterInputNodeListener(sptr<InputNodeListener> listener) override;
virtual int32_t UnregisterInputNodeListener(sptr<InputNodeListener> listener) override;
int32_t RegisterAddWhiteListCallback(sptr<IAddWhiteListInfosCallback> addWhiteListCallback) override;
int32_t RegisterDelWhiteListCallback(sptr<IDelWhiteListInfosCallback> delWhiteListCallback) override;
int32_t RegisterInputNodeListener(sptr<InputNodeListener> listener) override;
int32_t UnregisterInputNodeListener(sptr<InputNodeListener> listener) override;
virtual int32_t SyncNodeInfoRemoteInput(const std::string &userDevId, const std::string &dhId,
int32_t SyncNodeInfoRemoteInput(const std::string &userDevId, const std::string &dhId,
const std::string &nodeDesc) override;
virtual int32_t RegisterSimulationEventListener(sptr<ISimulationEventListener> listener) override;
virtual int32_t UnregisterSimulationEventListener(sptr<ISimulationEventListener> listener) override;
int32_t RegisterSimulationEventListener(sptr<ISimulationEventListener> listener) override;
int32_t UnregisterSimulationEventListener(sptr<ISimulationEventListener> listener) override;
bool CheckRegisterParam(const std::string &devId, const std::string &dhId,
const std::string &parameters, sptr<IRegisterDInputCallback> callback);
bool CheckUnregisterParam(const std::string &devId, const std::string &dhId,
@@ -187,30 +187,32 @@ public:
public:
DInputSourceListener(DistributedInputSourceManager *manager);
virtual ~DInputSourceListener();
void onResponseRegisterDistributedHardware(const std::string deviceId, const std::string dhId, bool result);
void onResponsePrepareRemoteInput(const std::string deviceId, bool result, const std::string &object);
void onResponseUnprepareRemoteInput(const std::string deviceId, bool result);
void onResponseStartRemoteInput(const std::string deviceId, const uint32_t inputTypes, bool result);
void onResponseStopRemoteInput(const std::string deviceId, const uint32_t inputTypes, bool result);
void onResponseStartRemoteInputDhid(const std::string deviceId, const std::string &dhids, bool result);
void onResponseStopRemoteInputDhid(const std::string deviceId, const std::string &dhids, bool result);
void onResponseKeyState(const std::string deviceId, const std::string &dhid, const uint32_t type,
const uint32_t code, const uint32_t value);
void onReceivedEventRemoteInput(const std::string deviceId, const std::string &event);
void onResponseRelayPrepareRemoteInput(int32_t sessionId, const std::string &deviceId, bool result,
const std::string &object);
void onResponseRelayUnprepareRemoteInput(int32_t sessionId, const std::string &deviceId, bool result);
void OnResponseRegisterDistributedHardware(const std::string deviceId, const std::string dhId,
bool result) override;
void OnResponsePrepareRemoteInput(const std::string deviceId, bool result, const std::string &object) override;
void OnResponseUnprepareRemoteInput(const std::string deviceId, bool result) override;
void OnResponseStartRemoteInput(const std::string deviceId, const uint32_t inputTypes, bool result) override;
void OnResponseStopRemoteInput(const std::string deviceId, const uint32_t inputTypes, bool result) override;
void OnResponseStartRemoteInputDhid(const std::string deviceId, const std::string &dhids, bool result) override;
void OnResponseStopRemoteInputDhid(const std::string deviceId, const std::string &dhids, bool result) override;
void OnResponseKeyState(const std::string deviceId, const std::string &dhid, const uint32_t type,
const uint32_t code, const uint32_t value) override;
void OnReceivedEventRemoteInput(const std::string deviceId, const std::string &event) override;
void OnResponseRelayPrepareRemoteInput(int32_t sessionId, const std::string &deviceId, bool result,
const std::string &object) override;
void OnResponseRelayUnprepareRemoteInput(int32_t sessionId, const std::string &deviceId, bool result) override;
void onReceiveRelayPrepareResult(int32_t status, const std::string &srcId, const std::string &sinkId);
void onReceiveRelayUnprepareResult(int32_t status, const std::string &srcId, const std::string &sinkId);
void onReceiveRelayStartDhidResult(int32_t status, const std::string &srcId, const std::string &sinkId,
const std::string &dhids);
void onReceiveRelayStopDhidResult(int32_t status, const std::string &srcId, const std::string &sinkId,
const std::string &dhids);
void onReceiveRelayStartTypeResult(int32_t status, const std::string &srcId, const std::string &sinkId,
uint32_t inputTypes);
void onReceiveRelayStopTypeResult(int32_t status, const std::string &srcId, const std::string &sinkId,
uint32_t inputTypes);
void OnReceiveRelayPrepareResult(int32_t status, const std::string &srcId, const std::string &sinkId) override;
void OnReceiveRelayUnprepareResult(int32_t status, const std::string &srcId,
const std::string &sinkId) override;
void OnReceiveRelayStartDhidResult(int32_t status, const std::string &srcId, const std::string &sinkId,
const std::string &dhids) override;
void OnReceiveRelayStopDhidResult(int32_t status, const std::string &srcId, const std::string &sinkId,
const std::string &dhids) override;
void OnReceiveRelayStartTypeResult(int32_t status, const std::string &srcId, const std::string &sinkId,
uint32_t inputTypes) override;
void OnReceiveRelayStopTypeResult(int32_t status, const std::string &srcId, const std::string &sinkId,
uint32_t inputTypes) override;
void RecordEventLog(int64_t when, int32_t type, int32_t code, int32_t value, const std::string& path);
private:
@@ -221,7 +223,7 @@ public:
public:
DInputSourceManagerEventHandler(const std::shared_ptr<AppExecFwk::EventRunner> &runner,
DistributedInputSourceManager *manager);
~DInputSourceManagerEventHandler();
~DInputSourceManagerEventHandler() override;
void ProcessEvent(const AppExecFwk::InnerEvent::Pointer &event) override;
private:
@@ -253,18 +255,18 @@ public:
class StartDScreenListener : public PublisherListenerStub {
public:
StartDScreenListener();
~StartDScreenListener();
~StartDScreenListener() override;
void OnMessage(const DHTopic topic, const std::string& message) override;
private:
int32_t ParseMessage(const std::string& message, std::string& sinkDevId, SrcScreenInfo& srcScreenInfo);
int32_t UpdateSrcScreenInfoCache(const SrcScreenInfo& TmpInfo);
int32_t UpdateSrcScreenInfoCache(const SrcScreenInfo& tmpInfo);
};
class StopDScreenListener : public PublisherListenerStub {
public:
StopDScreenListener();
~StopDScreenListener();
~StopDScreenListener() override;
void OnMessage(const DHTopic topic, const std::string& message) override;
private:
@@ -273,11 +275,10 @@ public:
class DeviceOfflineListener : public PublisherListenerStub {
public:
DeviceOfflineListener(DistributedInputSourceManager* srcManagerContext);
explicit DeviceOfflineListener(DistributedInputSourceManager* srcManagerContext);
~DeviceOfflineListener() override;
~DeviceOfflineListener();
void OnMessage(const DHTopic topic, const std::string& message);
void OnMessage(const DHTopic topic, const std::string& message) override;
private:
void DeleteNodeInfoAndNotify(const std::string& offlineDevId);
@@ -289,7 +290,7 @@ public:
class DScreenSourceSvrRecipient : public IRemoteObject::DeathRecipient {
public:
DScreenSourceSvrRecipient(const std::string& srcDevId, const std::string& sinkDevId, const uint64_t srcWinId);
~DScreenSourceSvrRecipient();
~DScreenSourceSvrRecipient() override;
void OnRemoteDied(const wptr<IRemoteObject> &remote) override;
private:
@@ -46,7 +46,7 @@ private:
sptr<IDistributedSourceInput> GetRemoteCliFromCache(const std::string &devId);
void AddRemoteCli(const std::string &devId, sptr<IRemoteObject> object);
void DeleteRemoteCli(const std::string &devId);
void DeleteRemoteCli(const sptr<IRemoteObject> object);
void DeleteRemoteCli(const sptr<IRemoteObject> remote);
void ProcRemoteCliDied(const sptr<IRemoteObject>& remote);
private:
@@ -77,19 +77,19 @@ DistributedInputSourceManager::DInputSourceListener::~DInputSourceListener()
DHLOGI("DInputSourceListener destory.");
}
void DistributedInputSourceManager::DInputSourceListener::onResponseRegisterDistributedHardware(
void DistributedInputSourceManager::DInputSourceListener::OnResponseRegisterDistributedHardware(
const std::string deviceId, const std::string dhId, bool result)
{
DHLOGI("onResponseRegisterDistributedHardware called, deviceId: %s, "
DHLOGI("OnResponseRegisterDistributedHardware called, deviceId: %s, "
"result: %s.", GetAnonyString(deviceId).c_str(), result ? "success" : "failed");
if (sourceManagerObj_ == nullptr) {
DHLOGE("onResponseRegisterDistributedHardware sourceManagerObj_ is null.");
DHLOGE("OnResponseRegisterDistributedHardware sourceManagerObj_ is null.");
return;
}
if (sourceManagerObj_->GetCallbackEventHandler() == nullptr) {
sourceManagerObj_->RunRegisterCallback(deviceId, dhId,
ERR_DH_INPUT_SERVER_SOURCE_MANAGERGET_CALLBACK_HANDLER_FAIL);
DHLOGE("onResponseRegisterDistributedHardware GetCallbackEventHandler is null.");
DHLOGE("OnResponseRegisterDistributedHardware GetCallbackEventHandler is null.");
return;
}
@@ -105,20 +105,20 @@ void DistributedInputSourceManager::DInputSourceListener::onResponseRegisterDist
sourceManagerObj_->GetCallbackEventHandler()->SendEvent(msgEvent, 0, AppExecFwk::EventQueue::Priority::IMMEDIATE);
}
void DistributedInputSourceManager::DInputSourceListener::onResponsePrepareRemoteInput(const std::string deviceId,
void DistributedInputSourceManager::DInputSourceListener::OnResponsePrepareRemoteInput(const std::string deviceId,
bool result, const std::string &object)
{
DHLOGI("onResponsePrepareRemoteInput called, deviceId: %s, result: %s.",
DHLOGI("OnResponsePrepareRemoteInput called, deviceId: %s, result: %s.",
GetAnonyString(deviceId).c_str(), result ? "success" : "failed");
if (sourceManagerObj_ == nullptr) {
DHLOGE("onResponsePrepareRemoteInput sourceManagerObj_ is null.");
DHLOGE("OnResponsePrepareRemoteInput sourceManagerObj_ is null.");
return;
}
if (sourceManagerObj_->GetCallbackEventHandler() == nullptr) {
sourceManagerObj_->RunPrepareCallback(deviceId,
ERR_DH_INPUT_SERVER_SOURCE_MANAGERGET_CALLBACK_HANDLER_FAIL, object);
DHLOGE("onResponsePrepareRemoteInput GetCallbackEventHandler is null.");
DHLOGE("OnResponsePrepareRemoteInput GetCallbackEventHandler is null.");
return;
}
std::shared_ptr<nlohmann::json> jsonArrayMsg = std::make_shared<nlohmann::json>();
@@ -133,20 +133,20 @@ void DistributedInputSourceManager::DInputSourceListener::onResponsePrepareRemot
sourceManagerObj_->GetCallbackEventHandler()->SendEvent(msgEvent, 0, AppExecFwk::EventQueue::Priority::IMMEDIATE);
}
void DistributedInputSourceManager::DInputSourceListener::onResponseUnprepareRemoteInput(
void DistributedInputSourceManager::DInputSourceListener::OnResponseUnprepareRemoteInput(
const std::string deviceId, bool result)
{
DHLOGI("onResponseUnprepareRemoteInput called, deviceId: %s, "
DHLOGI("OnResponseUnprepareRemoteInput called, deviceId: %s, "
"result: %s.", GetAnonyString(deviceId).c_str(), result ? "success" : "failed");
if (sourceManagerObj_ == nullptr) {
DHLOGE("onResponseUnprepareRemoteInput sourceManagerObj_ is null.");
DHLOGE("OnResponseUnprepareRemoteInput sourceManagerObj_ is null.");
return;
}
if (sourceManagerObj_->GetCallbackEventHandler() == nullptr) {
sourceManagerObj_->RunUnprepareCallback(deviceId,
ERR_DH_INPUT_SERVER_SOURCE_MANAGERGET_CALLBACK_HANDLER_FAIL);
DHLOGE("onResponseUnprepareRemoteInput GetCallbackEventHandler is null.");
DHLOGE("OnResponseUnprepareRemoteInput GetCallbackEventHandler is null.");
return;
}
std::shared_ptr<nlohmann::json> jsonArrayMsg = std::make_shared<nlohmann::json>();
@@ -160,7 +160,7 @@ void DistributedInputSourceManager::DInputSourceListener::onResponseUnprepareRem
sourceManagerObj_->GetCallbackEventHandler()->SendEvent(msgEvent, 0, AppExecFwk::EventQueue::Priority::IMMEDIATE);
}
void DistributedInputSourceManager::DInputSourceListener::onResponseRelayPrepareRemoteInput(int32_t toSrcSessionId,
void DistributedInputSourceManager::DInputSourceListener::OnResponseRelayPrepareRemoteInput(int32_t toSrcSessionId,
const std::string &deviceId, bool result, const std::string &object)
{
DHLOGI("deviceId: %s, result: %d.", GetAnonyString(deviceId).c_str(), result);
@@ -184,7 +184,7 @@ void DistributedInputSourceManager::DInputSourceListener::onResponseRelayPrepare
sourceManagerObj_->GetCallbackEventHandler()->SendEvent(msgEvent, 0, AppExecFwk::EventQueue::Priority::IMMEDIATE);
}
void DistributedInputSourceManager::DInputSourceListener::onResponseRelayUnprepareRemoteInput(int32_t toSrcSessionId,
void DistributedInputSourceManager::DInputSourceListener::OnResponseRelayUnprepareRemoteInput(int32_t toSrcSessionId,
const std::string &deviceId, bool result)
{
DHLOGI("deviceId: %s, result: %d.", GetAnonyString(deviceId).c_str(), result);
@@ -207,20 +207,20 @@ void DistributedInputSourceManager::DInputSourceListener::onResponseRelayUnprepa
sourceManagerObj_->GetCallbackEventHandler()->SendEvent(msgEvent, 0, AppExecFwk::EventQueue::Priority::IMMEDIATE);
}
void DistributedInputSourceManager::DInputSourceListener::onResponseStartRemoteInput(
void DistributedInputSourceManager::DInputSourceListener::OnResponseStartRemoteInput(
const std::string deviceId, const uint32_t inputTypes, bool result)
{
DHLOGI("onResponseStartRemoteInput called, deviceId: %s, inputTypes: %d, result: %s.",
DHLOGI("OnResponseStartRemoteInput called, deviceId: %s, inputTypes: %d, result: %s.",
GetAnonyString(deviceId).c_str(), inputTypes, result ? "success" : "failed");
if (sourceManagerObj_ == nullptr) {
DHLOGE("onResponseStartRemoteInput sourceManagerObj_ is null.");
DHLOGE("OnResponseStartRemoteInput sourceManagerObj_ is null.");
return;
}
if (sourceManagerObj_->GetCallbackEventHandler() == nullptr) {
sourceManagerObj_->RunStartCallback(deviceId, inputTypes,
ERR_DH_INPUT_SERVER_SOURCE_MANAGERGET_CALLBACK_HANDLER_FAIL);
DHLOGE("onResponseStartRemoteInput GetCallbackEventHandler is null.");
DHLOGE("OnResponseStartRemoteInput GetCallbackEventHandler is null.");
return;
}
if (result) {
@@ -238,18 +238,18 @@ void DistributedInputSourceManager::DInputSourceListener::onResponseStartRemoteI
sourceManagerObj_->GetCallbackEventHandler()->SendEvent(msgEvent, 0, AppExecFwk::EventQueue::Priority::IMMEDIATE);
}
void DistributedInputSourceManager::DInputSourceListener::onResponseStopRemoteInput(
void DistributedInputSourceManager::DInputSourceListener::OnResponseStopRemoteInput(
const std::string deviceId, const uint32_t inputTypes, bool result)
{
DHLOGI("onResponseStopRemoteInput called, deviceId: %s, inputTypes: %d, result: %s.",
DHLOGI("OnResponseStopRemoteInput called, deviceId: %s, inputTypes: %d, result: %s.",
GetAnonyString(deviceId).c_str(), inputTypes, result ? "true" : "failed");
if (sourceManagerObj_ == nullptr) {
DHLOGE("onResponseStopRemoteInput sourceManagerObj_ is null.");
DHLOGE("OnResponseStopRemoteInput sourceManagerObj_ is null.");
return;
}
if (sourceManagerObj_->GetCallbackEventHandler() == nullptr) {
DHLOGE("onResponseStopRemoteInput GetCallbackEventHandler is null.");
DHLOGE("OnResponseStopRemoteInput GetCallbackEventHandler is null.");
sourceManagerObj_->RunStopCallback(deviceId, inputTypes,
ERR_DH_INPUT_SERVER_SOURCE_MANAGERGET_CALLBACK_HANDLER_FAIL);
return;
@@ -266,18 +266,18 @@ void DistributedInputSourceManager::DInputSourceListener::onResponseStopRemoteIn
sourceManagerObj_->GetCallbackEventHandler()->SendEvent(msgEvent, 0, AppExecFwk::EventQueue::Priority::IMMEDIATE);
}
void DistributedInputSourceManager::DInputSourceListener::onResponseStartRemoteInputDhid(
void DistributedInputSourceManager::DInputSourceListener::OnResponseStartRemoteInputDhid(
const std::string deviceId, const std::string &dhids, bool result)
{
DHLOGI("onResponseStartRemoteInputDhid called, deviceId: %s, result: %s.",
DHLOGI("OnResponseStartRemoteInputDhid called, deviceId: %s, result: %s.",
GetAnonyString(deviceId).c_str(), result ? "success" : "failed");
if (sourceManagerObj_ == nullptr) {
DHLOGE("onResponseStartRemoteInputDhid sourceManagerObj_ is null.");
DHLOGE("OnResponseStartRemoteInputDhid sourceManagerObj_ is null.");
return;
}
if (sourceManagerObj_->GetCallbackEventHandler() == nullptr) {
DHLOGE("onResponseStartRemoteInputDhid GetCallbackEventHandler is null.");
DHLOGE("OnResponseStartRemoteInputDhid GetCallbackEventHandler is null.");
sourceManagerObj_->RunStartDhidCallback(deviceId, dhids,
ERR_DH_INPUT_SERVER_SOURCE_MANAGERGET_CALLBACK_HANDLER_FAIL);
return;
@@ -297,18 +297,18 @@ void DistributedInputSourceManager::DInputSourceListener::onResponseStartRemoteI
sourceManagerObj_->GetCallbackEventHandler()->SendEvent(msgEvent, 0, AppExecFwk::EventQueue::Priority::IMMEDIATE);
}
void DistributedInputSourceManager::DInputSourceListener::onResponseStopRemoteInputDhid(
void DistributedInputSourceManager::DInputSourceListener::OnResponseStopRemoteInputDhid(
const std::string deviceId, const std::string &dhids, bool result)
{
DHLOGI("onResponseStopRemoteInputDhid called, deviceId: %s, result: %s.",
DHLOGI("OnResponseStopRemoteInputDhid called, deviceId: %s, result: %s.",
GetAnonyString(deviceId).c_str(), result ? "success" : "failed");
if (sourceManagerObj_ == nullptr) {
DHLOGE("onResponseStopRemoteInputDhid sourceManagerObj_ is null.");
DHLOGE("OnResponseStopRemoteInputDhid sourceManagerObj_ is null.");
return;
}
if (sourceManagerObj_->GetCallbackEventHandler() == nullptr) {
DHLOGE("onResponseStopRemoteInputDhid GetCallbackEventHandler is null.");
DHLOGE("OnResponseStopRemoteInputDhid GetCallbackEventHandler is null.");
sourceManagerObj_->RunStopDhidCallback(deviceId, dhids,
ERR_DH_INPUT_SERVER_SOURCE_MANAGERGET_CALLBACK_HANDLER_FAIL);
return;
@@ -324,7 +324,7 @@ void DistributedInputSourceManager::DInputSourceListener::onResponseStopRemoteIn
sourceManagerObj_->GetCallbackEventHandler()->SendEvent(msgEvent, 0, AppExecFwk::EventQueue::Priority::IMMEDIATE);
}
void DistributedInputSourceManager::DInputSourceListener::onResponseKeyState(const std::string deviceId,
void DistributedInputSourceManager::DInputSourceListener::OnResponseKeyState(const std::string deviceId,
const std::string &dhid, const uint32_t type, const uint32_t code, const uint32_t value)
{
DHLOGI("onResponseMouseDown called, deviceId: %s, dhid: %s.", GetAnonyString(deviceId).c_str(),
@@ -351,7 +351,7 @@ void DistributedInputSourceManager::DInputSourceListener::onResponseKeyState(con
sourceManagerObj_->GetCallbackEventHandler()->SendEvent(msgEvent, 0, AppExecFwk::EventQueue::Priority::IMMEDIATE);
}
void DistributedInputSourceManager::DInputSourceListener::onReceivedEventRemoteInput(
void DistributedInputSourceManager::DInputSourceListener::OnReceivedEventRemoteInput(
const std::string deviceId, const std::string &event)
{
nlohmann::json inputData = nlohmann::json::parse(event, nullptr, false);
@@ -360,7 +360,7 @@ void DistributedInputSourceManager::DInputSourceListener::onReceivedEventRemoteI
return;
}
size_t jsonSize = inputData.size();
DHLOGI("onReceivedEventRemoteInput called, deviceId: %s, json size:%d.",
DHLOGI("OnReceivedEventRemoteInput called, deviceId: %s, json size:%d.",
GetAnonyString(deviceId).c_str(), jsonSize);
RawEvent mEventBuffer[jsonSize];
@@ -380,7 +380,7 @@ void DistributedInputSourceManager::DInputSourceListener::onReceivedEventRemoteI
DistributedInputInject::GetInstance().RegisterDistributedEvent(mEventBuffer, jsonSize);
}
void DistributedInputSourceManager::DInputSourceListener::onReceiveRelayPrepareResult(int32_t status,
void DistributedInputSourceManager::DInputSourceListener::OnReceiveRelayPrepareResult(int32_t status,
const std::string &srcId, const std::string &sinkId)
{
DHLOGI("status:%d, srcId: %s, sinkId: %s.", status, GetAnonyString(srcId).c_str(), GetAnonyString(sinkId).c_str());
@@ -403,7 +403,7 @@ void DistributedInputSourceManager::DInputSourceListener::onReceiveRelayPrepareR
sourceManagerObj_->GetCallbackEventHandler()->SendEvent(msgEvent, 0, AppExecFwk::EventQueue::Priority::IMMEDIATE);
}
void DistributedInputSourceManager::DInputSourceListener::onReceiveRelayUnprepareResult(int32_t status,
void DistributedInputSourceManager::DInputSourceListener::OnReceiveRelayUnprepareResult(int32_t status,
const std::string &srcId, const std::string &sinkId)
{
DHLOGI("status:%d, srcId: %s, sinkId: %s.", status, GetAnonyString(srcId).c_str(), GetAnonyString(sinkId).c_str());
@@ -426,7 +426,7 @@ void DistributedInputSourceManager::DInputSourceListener::onReceiveRelayUnprepar
sourceManagerObj_->GetCallbackEventHandler()->SendEvent(msgEvent, 0, AppExecFwk::EventQueue::Priority::IMMEDIATE);
}
void DistributedInputSourceManager::DInputSourceListener::onReceiveRelayStartDhidResult(int32_t status,
void DistributedInputSourceManager::DInputSourceListener::OnReceiveRelayStartDhidResult(int32_t status,
const std::string &srcId, const std::string &sinkId, const std::string &dhids)
{
DHLOGI("status:%d, srcId: %s, sinkId: %s.", status, GetAnonyString(srcId).c_str(), GetAnonyString(sinkId).c_str());
@@ -450,7 +450,7 @@ void DistributedInputSourceManager::DInputSourceListener::onReceiveRelayStartDhi
sourceManagerObj_->GetCallbackEventHandler()->SendEvent(msgEvent, 0, AppExecFwk::EventQueue::Priority::IMMEDIATE);
}
void DistributedInputSourceManager::DInputSourceListener::onReceiveRelayStopDhidResult(int32_t status,
void DistributedInputSourceManager::DInputSourceListener::OnReceiveRelayStopDhidResult(int32_t status,
const std::string &srcId, const std::string &sinkId, const std::string &dhids)
{
DHLOGI("status:%d, srcId: %s, sinkId: %s.", status, GetAnonyString(srcId).c_str(), GetAnonyString(sinkId).c_str());
@@ -474,7 +474,7 @@ void DistributedInputSourceManager::DInputSourceListener::onReceiveRelayStopDhid
sourceManagerObj_->GetCallbackEventHandler()->SendEvent(msgEvent, 0, AppExecFwk::EventQueue::Priority::IMMEDIATE);
}
void DistributedInputSourceManager::DInputSourceListener::onReceiveRelayStartTypeResult(int32_t status,
void DistributedInputSourceManager::DInputSourceListener::OnReceiveRelayStartTypeResult(int32_t status,
const std::string &srcId, const std::string &sinkId, uint32_t inputTypes)
{
DHLOGI("status:%d, srcId: %s, sinkId: %s.", status, GetAnonyString(srcId).c_str(), GetAnonyString(sinkId).c_str());
@@ -498,7 +498,7 @@ void DistributedInputSourceManager::DInputSourceListener::onReceiveRelayStartTyp
sourceManagerObj_->GetCallbackEventHandler()->SendEvent(msgEvent, 0, AppExecFwk::EventQueue::Priority::IMMEDIATE);
}
void DistributedInputSourceManager::DInputSourceListener::onReceiveRelayStopTypeResult(int32_t status,
void DistributedInputSourceManager::DInputSourceListener::OnReceiveRelayStopTypeResult(int32_t status,
const std::string &srcId, const std::string &sinkId, uint32_t inputTypes)
{
DHLOGI("status:%d, srcId: %s, sinkId: %s.", status, GetAnonyString(srcId).c_str(), GetAnonyString(sinkId).c_str());
@@ -2465,7 +2465,7 @@ DInputServerType DistributedInputSourceManager::GetStartTransFlag()
void DistributedInputSourceManager::SetStartTransFlag(const DInputServerType flag)
{
DHLOGI("Set Source isStartTrans_ %d", (int32_t)flag);
DHLOGI("Set Source isStartTrans_ %d", static_cast<int32_t>(flag));
isStartTrans_ = flag;
}
@@ -2678,17 +2678,17 @@ int32_t DistributedInputSourceManager::StartDScreenListener::ParseMessage(const
return DH_SUCCESS;
}
int32_t DistributedInputSourceManager::StartDScreenListener::UpdateSrcScreenInfoCache(const SrcScreenInfo& TmpInfo)
int32_t DistributedInputSourceManager::StartDScreenListener::UpdateSrcScreenInfoCache(const SrcScreenInfo& tmpInfo)
{
std::string srcDevId = GetLocalNetworkId();
std::string srcScreenInfoKey = DInputContext::GetInstance().GetScreenInfoKey(srcDevId, TmpInfo.sourceWinId);
std::string srcScreenInfoKey = DInputContext::GetInstance().GetScreenInfoKey(srcDevId, tmpInfo.sourceWinId);
SrcScreenInfo srcScreenInfo = DInputContext::GetInstance().GetSrcScreenInfo(srcScreenInfoKey);
srcScreenInfo.devId = srcDevId;
srcScreenInfo.sessionId = DistributedInputSourceTransport::GetInstance().GetCurrentSessionId();
srcScreenInfo.uuid = GetUUIDBySoftBus(srcDevId);
srcScreenInfo.sourceWinId = TmpInfo.sourceWinId;
srcScreenInfo.sourceWinWidth = TmpInfo.sourceWinWidth;
srcScreenInfo.sourceWinHeight = TmpInfo.sourceWinHeight;
srcScreenInfo.sourceWinId = tmpInfo.sourceWinId;
srcScreenInfo.sourceWinWidth = tmpInfo.sourceWinWidth;
srcScreenInfo.sourceWinHeight = tmpInfo.sourceWinHeight;
srcScreenInfo.sourcePhyId = DistributedInputInject::GetInstance().GenerateVirtualTouchScreenDHId(
srcScreenInfo.sourceWinId, srcScreenInfo.sourceWinWidth, srcScreenInfo.sourceWinHeight);
int32_t virtualScreenFd = DistributedInputInject::GetInstance().GetVirtualTouchScreenFd();
@@ -2696,9 +2696,9 @@ int32_t DistributedInputSourceManager::StartDScreenListener::UpdateSrcScreenInfo
DHLOGE("virtualScreenFd is invalid");
return ERR_DH_INPUT_SERVER_SOURCE_VIRTUAL_SCREEN_NODE_IS_INVALID;
}
srcScreenInfo.sourcePhyFd = (uint32_t)virtualScreenFd;
srcScreenInfo.sourcePhyWidth = TmpInfo.sourceWinWidth;
srcScreenInfo.sourcePhyHeight = TmpInfo.sourceWinHeight;
srcScreenInfo.sourcePhyFd = static_cast<uint32_t>(virtualScreenFd);
srcScreenInfo.sourcePhyWidth = tmpInfo.sourceWinWidth;
srcScreenInfo.sourcePhyHeight = tmpInfo.sourceWinHeight;
DHLOGI("StartDScreenListener UpdateSrcScreenInfo the data: devId: %s, sourceWinId: %d, sourceWinWidth: %d,"
"sourceWinHeight: %d, sourcePhyId: %s, sourcePhyFd: %d, sourcePhyWidth: %d, sourcePhyHeight: %d",
GetAnonyString(srcScreenInfo.devId).c_str(), srcScreenInfo.sourceWinId, srcScreenInfo.sourceWinWidth,
@@ -1119,7 +1119,7 @@ void DistributedInputSourceTransport::NotifyResponsePrepareRemoteInput(int32_t s
DHLOGE("OnBytesReceived cmdType is TRANS_SINK_MSG_ONPREPARE, deviceId is error.");
return;
}
callback_->onResponsePrepareRemoteInput(deviceId, recMsg[DINPUT_SOFTBUS_KEY_RESP_VALUE],
callback_->OnResponsePrepareRemoteInput(deviceId, recMsg[DINPUT_SOFTBUS_KEY_RESP_VALUE],
recMsg[DINPUT_SOFTBUS_KEY_WHITE_LIST]);
}
@@ -1136,7 +1136,7 @@ void DistributedInputSourceTransport::NotifyResponseUnprepareRemoteInput(int32_t
DHLOGE("OnBytesReceived cmdType is TRANS_SINK_MSG_ONUNPREPARE, deviceId is error.");
return;
}
callback_->onResponseUnprepareRemoteInput(deviceId, recMsg[DINPUT_SOFTBUS_KEY_RESP_VALUE]);
callback_->OnResponseUnprepareRemoteInput(deviceId, recMsg[DINPUT_SOFTBUS_KEY_RESP_VALUE]);
CloseInputSoftbus(sessionId);
}
@@ -1152,7 +1152,7 @@ void DistributedInputSourceTransport::NotifyResponseStartRemoteInput(int32_t ses
DHLOGE("OnBytesReceived cmdType is TRANS_SINK_MSG_ONSTART, deviceId is error.");
return;
}
callback_->onResponseStartRemoteInput(
callback_->OnResponseStartRemoteInput(
deviceId, recMsg[DINPUT_SOFTBUS_KEY_INPUT_TYPE], recMsg[DINPUT_SOFTBUS_KEY_RESP_VALUE]);
}
@@ -1168,7 +1168,7 @@ void DistributedInputSourceTransport::NotifyResponseStopRemoteInput(int32_t sess
DHLOGE("OnBytesReceived cmdType TRANS_SINK_MSG_ONSTOP, deviceId is error.");
return;
}
callback_->onResponseStopRemoteInput(
callback_->OnResponseStopRemoteInput(
deviceId, recMsg[DINPUT_SOFTBUS_KEY_INPUT_TYPE], recMsg[DINPUT_SOFTBUS_KEY_RESP_VALUE]);
}
@@ -1185,7 +1185,7 @@ void DistributedInputSourceTransport::NotifyResponseStartRemoteInputDhid(int32_t
DHLOGE("OnBytesReceived cmdType is TRANS_SINK_MSG_DHID_ONSTART, deviceId is error.");
return;
}
callback_->onResponseStartRemoteInputDhid(
callback_->OnResponseStartRemoteInputDhid(
deviceId, recMsg[DINPUT_SOFTBUS_KEY_VECTOR_DHID], recMsg[DINPUT_SOFTBUS_KEY_RESP_VALUE]);
}
@@ -1201,7 +1201,7 @@ void DistributedInputSourceTransport::NotifyResponseStopRemoteInputDhid(int32_t
DHLOGE("OnBytesReceived cmdType is TRANS_SINK_MSG_DHID_ONSTOP, deviceId is error.");
return;
}
callback_->onResponseStopRemoteInputDhid(
callback_->OnResponseStopRemoteInputDhid(
deviceId, recMsg[DINPUT_SOFTBUS_KEY_VECTOR_DHID], recMsg[DINPUT_SOFTBUS_KEY_RESP_VALUE]);
}
@@ -1213,7 +1213,7 @@ void DistributedInputSourceTransport::NotifyResponseKeyState(int32_t sessionId,
DHLOGE("OnBytesReceived cmdType is TRANS_SINK_MSG_KEY_STATE, deviceId is error.");
return;
}
callback_->onResponseKeyState(deviceId, recMsg[DINPUT_SOFTBUS_KEY_KEYSTATE_DHID],
callback_->OnResponseKeyState(deviceId, recMsg[DINPUT_SOFTBUS_KEY_KEYSTATE_DHID],
recMsg[DINPUT_SOFTBUS_KEY_KEYSTATE_TYPE], recMsg[DINPUT_SOFTBUS_KEY_KEYSTATE_CODE],
recMsg[DINPUT_SOFTBUS_KEY_KEYSTATE_VALUE]);
}
@@ -1232,7 +1232,7 @@ void DistributedInputSourceTransport::NotifyReceivedEventRemoteInput(int32_t ses
return;
}
std::string inputDataStr = recMsg[DINPUT_SOFTBUS_KEY_INPUT_DATA];
callback_->onReceivedEventRemoteInput(deviceId, inputDataStr);
callback_->OnReceivedEventRemoteInput(deviceId, inputDataStr);
}
void DistributedInputSourceTransport::CalculateLatency(int32_t sessionId, const nlohmann::json &recMsg)
@@ -1262,13 +1262,13 @@ void DistributedInputSourceTransport::ReceiveSrcTSrcRelayPrepare(int32_t session
// continue notify to A_sink_trans
int32_t ret = OpenInputSoftbus(deviceId);
if (ret != DH_SUCCESS) {
callback_->onResponseRelayPrepareRemoteInput(sessionId, deviceId, false, "");
callback_->OnResponseRelayPrepareRemoteInput(sessionId, deviceId, false, "");
return;
}
ret = PrepareRemoteInput(sessionId, deviceId);
if (ret != DH_SUCCESS) {
callback_->onResponseRelayPrepareRemoteInput(sessionId, deviceId, false, "");
callback_->OnResponseRelayPrepareRemoteInput(sessionId, deviceId, false, "");
return;
}
}
@@ -1285,7 +1285,7 @@ void DistributedInputSourceTransport::ReceiveSrcTSrcRelayUnprepare(int32_t sessi
int32_t ret = UnprepareRemoteInput(sessionId, deviceId);
if (ret != DH_SUCCESS) {
DHLOGE("Can not send message by softbus, unprepare fail.");
callback_->onResponseRelayUnprepareRemoteInput(sessionId, deviceId, false);
callback_->OnResponseRelayUnprepareRemoteInput(sessionId, deviceId, false);
return;
}
}
@@ -1305,7 +1305,7 @@ void DistributedInputSourceTransport::NotifyResponseRelayPrepareRemoteInput(int3
DHLOGE("OnBytesReceived cmdType is TRANS_SINK_MSG_ON_RELAY_PREPARE, sinkDevId is error.");
return;
}
callback_->onResponseRelayPrepareRemoteInput(recMsg[DINPUT_SOFTBUS_KEY_SESSION_ID], sinkDevId,
callback_->OnResponseRelayPrepareRemoteInput(recMsg[DINPUT_SOFTBUS_KEY_SESSION_ID], sinkDevId,
recMsg[DINPUT_SOFTBUS_KEY_RESP_VALUE], recMsg[DINPUT_SOFTBUS_KEY_WHITE_LIST]);
}
@@ -1323,7 +1323,7 @@ void DistributedInputSourceTransport::NotifyResponseRelayUnprepareRemoteInput(in
DHLOGE("OnBytesReceived cmdType is TRANS_SINK_MSG_ON_RELAY_UNPREPARE, sinkDevId is error.");
return;
}
callback_->onResponseRelayUnprepareRemoteInput(recMsg[DINPUT_SOFTBUS_KEY_SESSION_ID], sinkDevId,
callback_->OnResponseRelayUnprepareRemoteInput(recMsg[DINPUT_SOFTBUS_KEY_SESSION_ID], sinkDevId,
recMsg[DINPUT_SOFTBUS_KEY_RESP_VALUE]);
CloseInputSoftbus(sessionId);
}
@@ -1341,7 +1341,7 @@ void DistributedInputSourceTransport::ReceiveRelayPrepareResult(int32_t sessionI
std::string srcId = recMsg[DINPUT_SOFTBUS_KEY_SRC_DEV_ID];
std::string sinkId = recMsg[DINPUT_SOFTBUS_KEY_SINK_DEV_ID];
int32_t status = recMsg[DINPUT_SOFTBUS_KEY_RESP_VALUE];
callback_->onReceiveRelayPrepareResult(status, srcId, sinkId);
callback_->OnReceiveRelayPrepareResult(status, srcId, sinkId);
}
void DistributedInputSourceTransport::ReceiveRelayUnprepareResult(int32_t sessionId, const nlohmann::json &recMsg)
@@ -1357,7 +1357,7 @@ void DistributedInputSourceTransport::ReceiveRelayUnprepareResult(int32_t sessio
std::string srcId = recMsg[DINPUT_SOFTBUS_KEY_SRC_DEV_ID];
std::string sinkId = recMsg[DINPUT_SOFTBUS_KEY_SINK_DEV_ID];
int32_t status = recMsg[DINPUT_SOFTBUS_KEY_RESP_VALUE];
callback_->onReceiveRelayUnprepareResult(status, srcId, sinkId);
callback_->OnReceiveRelayUnprepareResult(status, srcId, sinkId);
CloseInputSoftbus(sessionId);
}
@@ -1476,7 +1476,7 @@ void DistributedInputSourceTransport::ReceiveRelayStartDhidResult(int32_t sessio
std::string sinkId = recMsg[DINPUT_SOFTBUS_KEY_SINK_DEV_ID];
int32_t status = recMsg[DINPUT_SOFTBUS_KEY_RESP_VALUE];
std::string dhids = recMsg[DINPUT_SOFTBUS_KEY_VECTOR_DHID];
callback_->onReceiveRelayStartDhidResult(status, srcId, sinkId, dhids);
callback_->OnReceiveRelayStartDhidResult(status, srcId, sinkId, dhids);
}
void DistributedInputSourceTransport::ReceiveRelayStopDhidResult(int32_t sessionId, const nlohmann::json &recMsg)
@@ -1494,7 +1494,7 @@ void DistributedInputSourceTransport::ReceiveRelayStopDhidResult(int32_t session
std::string sinkId = recMsg[DINPUT_SOFTBUS_KEY_SINK_DEV_ID];
int32_t status = recMsg[DINPUT_SOFTBUS_KEY_RESP_VALUE];
std::string dhids = recMsg[DINPUT_SOFTBUS_KEY_VECTOR_DHID];
callback_->onReceiveRelayStopDhidResult(status, srcId, sinkId, dhids);
callback_->OnReceiveRelayStopDhidResult(status, srcId, sinkId, dhids);
}
void DistributedInputSourceTransport::ReceiveSrcTSrcRelayStartType(int32_t sessionId, const nlohmann::json &recMsg)
@@ -1612,7 +1612,7 @@ void DistributedInputSourceTransport::ReceiveRelayStartTypeResult(int32_t sessio
std::string sinkId = recMsg[DINPUT_SOFTBUS_KEY_SINK_DEV_ID];
int32_t status = recMsg[DINPUT_SOFTBUS_KEY_RESP_VALUE];
uint32_t inputTypes = recMsg[DINPUT_SOFTBUS_KEY_INPUT_TYPE];
callback_->onReceiveRelayStartTypeResult(status, srcId, sinkId, inputTypes);
callback_->OnReceiveRelayStartTypeResult(status, srcId, sinkId, inputTypes);
}
void DistributedInputSourceTransport::ReceiveRelayStopTypeResult(int32_t sessionId, const nlohmann::json &recMsg)
@@ -1630,7 +1630,7 @@ void DistributedInputSourceTransport::ReceiveRelayStopTypeResult(int32_t session
std::string sinkId = recMsg[DINPUT_SOFTBUS_KEY_SINK_DEV_ID];
int32_t status = recMsg[DINPUT_SOFTBUS_KEY_RESP_VALUE];
uint32_t inputTypes = recMsg[DINPUT_SOFTBUS_KEY_INPUT_TYPE];
callback_->onReceiveRelayStopTypeResult(status, srcId, sinkId, inputTypes);
callback_->OnReceiveRelayStopTypeResult(status, srcId, sinkId, inputTypes);
}
void DistributedInputSourceTransport::HandleSessionData(int32_t sessionId, const std::string& message)
@@ -36,7 +36,7 @@ DECLARE_SINGLE_INSTANCE_BASE(DistributedInputSinkHandler);
public:
int32_t InitSink(const std::string& params) override;
int32_t ReleaseSink() override;
int32_t SubscribeLocalHardware(const std::string& dhId, const std::string& parameters) override;
int32_t SubscribeLocalHardware(const std::string& dhId, const std::string& params) override;
int32_t UnsubscribeLocalHardware(const std::string& dhId) override;
void FinishStartSA(const std::string &params, const sptr<IRemoteObject> &remoteObject);