mirror of
https://github.com/openharmony/distributedhardware_distributed_input.git
synced 2026-07-19 17:43:35 -04:00
Revert "
Match-id-b85c69e76c3dc4fe54a3032974160b529a25120d
This commit is contained in:
@@ -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 = static_cast<uint32_t>(absInfo.maximum + 1);
|
||||
info.sinkPhyWidth = (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 = static_cast<uint32_t>(absInfo.maximum + 1);
|
||||
info.sinkPhyHeight = (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 = static_cast<uint32_t>(iev.value);
|
||||
absInfo.absXIndex = static_cast<int32_t>(j);
|
||||
absInfo.absX = (uint32_t)iev.value;
|
||||
absInfo.absXIndex = (int32_t)j;
|
||||
}
|
||||
if (iev.code == ABS_Y || iev.code == ABS_MT_POSITION_Y) {
|
||||
absInfo.absY = static_cast<uint32_t>(iev.value);
|
||||
absInfo.absYIndex = static_cast<int32_t>(j);
|
||||
absInfo.absY = (uint32_t)iev.value;
|
||||
absInfo.absYIndex = (int32_t)j;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -38,16 +38,16 @@ enum class HiDumperFlag {
|
||||
};
|
||||
|
||||
struct NodeInfo {
|
||||
std::string devId = "";
|
||||
std::string virNodeName = "";
|
||||
std::string inputDhId = "";
|
||||
std::string deviceId_ = "";
|
||||
std::string nodeName_ = "";
|
||||
std::string dhId_ = "";
|
||||
};
|
||||
|
||||
struct SessionInfo {
|
||||
int32_t sesId = 0;
|
||||
std::string mySesName = "";
|
||||
std::string peerSesName = "";
|
||||
SessionStatus sessionState = SessionStatus::CLOSED;
|
||||
int32_t sessionId_ = 0;
|
||||
std::string mySessionName_ = "";
|
||||
std::string peerSessionName_ = "";
|
||||
SessionStatus sessionStatus_ = SessionStatus::CLOSED;
|
||||
};
|
||||
|
||||
class HiDumper {
|
||||
|
||||
+17
-17
@@ -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).devId));
|
||||
result.append(GetAnonyString((*iter).deviceId_));
|
||||
result.append("\n nodename : ");
|
||||
result.append((*iter).virNodeName);
|
||||
result.append((*iter).nodeName_);
|
||||
result.append("\n dhId : ");
|
||||
result.append(GetAnonyString((*iter).inputDhId));
|
||||
result.append(GetAnonyString((*iter).dhId_));
|
||||
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).devId.compare(deviceId) == 0 && (*iter).inputDhId.compare(dhId) == 0) {
|
||||
if ((*iter).deviceId_.compare(deviceId) == 0 && (*iter).dhId_.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.sesId));
|
||||
result.append(std::to_string(iter->second.sessionId_));
|
||||
result.append("\n mysessionname : ");
|
||||
result.append(iter->second.mySesName);
|
||||
result.append(iter->second.mySessionName_);
|
||||
result.append("\n peersessionname : ");
|
||||
result.append(iter->second.peerSesName);
|
||||
result.append(iter->second.peerSessionName_);
|
||||
|
||||
std::string sessionStatus("");
|
||||
auto item = SESSION_STATUS.find(iter->second.sessionState);
|
||||
auto item = SESSION_STATUS.find(iter->second.sessionStatus_);
|
||||
if (item == SESSION_STATUS.end()) {
|
||||
sessionStatus = "unknown state";
|
||||
} else {
|
||||
sessionStatus = SESSION_STATUS.find(iter->second.sessionState)->second;
|
||||
sessionStatus = SESSION_STATUS.find(iter->second.sessionStatus_)->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 = {
|
||||
.devId = deviceId,
|
||||
.virNodeName = nodeName,
|
||||
.inputDhId = dhId,
|
||||
.deviceId_ = deviceId,
|
||||
.nodeName_ = nodeName,
|
||||
.dhId_ = 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 = {
|
||||
.sesId = sessionId,
|
||||
.mySesName = mySessionName,
|
||||
.peerSesName = peerSessionName,
|
||||
.sessionState = sessionStatus,
|
||||
.sessionId_ = sessionId,
|
||||
.mySessionName_ = mySessionName,
|
||||
.peerSessionName_ = peerSessionName,
|
||||
.sessionStatus_ = 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].sessionState = sessionStatus;
|
||||
sessionInfos_[remoteDevId].sessionStatus_ = sessionStatus;
|
||||
}
|
||||
} // namespace DistributedInput
|
||||
} // namespace DistributedHardware
|
||||
|
||||
@@ -40,12 +40,12 @@ namespace DistributedInput {
|
||||
class DistributedInputHandler : public IHardwareHandler {
|
||||
DECLARE_SINGLE_INSTANCE_BASE(DistributedInputHandler);
|
||||
public:
|
||||
API_EXPORT int32_t Initialize() override;
|
||||
API_EXPORT virtual 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 bool IsSupportPlugin() override;
|
||||
API_EXPORT void RegisterPluginListener(std::shared_ptr<PluginListener> listener) override;
|
||||
API_EXPORT void UnRegisterPluginListener() 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 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 inputDeviceBufferSize = 32;
|
||||
InputDeviceEvent mEventBuffer[inputDeviceBufferSize] = {};
|
||||
static const int INPUT_DEVICE_BUFFER_SIZE = 32;
|
||||
InputDeviceEvent mEventBuffer[INPUT_DEVICE_BUFFER_SIZE] = {};
|
||||
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, inputDeviceBufferSize);
|
||||
size_t count = inputHub_->StartCollectInputHandler(mEventBuffer, INPUT_DEVICE_BUFFER_SIZE);
|
||||
if (count > 0) {
|
||||
DHLOGI("Count: %zu", count);
|
||||
for (size_t iCnt = 0; iCnt < count; iCnt++) {
|
||||
|
||||
@@ -28,9 +28,10 @@ namespace DistributedInput {
|
||||
class AddWhiteListInfosCallbackProxy : public IRemoteProxy<IAddWhiteListInfosCallback> {
|
||||
public:
|
||||
explicit AddWhiteListInfosCallbackProxy(const sptr<IRemoteObject> &object);
|
||||
~AddWhiteListInfosCallbackProxy() override;
|
||||
|
||||
void OnResult(const std::string& deviceId, const std::string& strJson) override;
|
||||
virtual ~AddWhiteListInfosCallbackProxy() override;
|
||||
|
||||
virtual 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();
|
||||
~AddWhiteListInfosCallbackStub() override;
|
||||
virtual ~AddWhiteListInfosCallbackStub() override;
|
||||
|
||||
int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
|
||||
|
||||
|
||||
@@ -28,9 +28,10 @@ namespace DistributedInput {
|
||||
class DelWhiteListInfosCallbackProxy : public IRemoteProxy<IDelWhiteListInfosCallback> {
|
||||
public:
|
||||
explicit DelWhiteListInfosCallbackProxy(const sptr<IRemoteObject> &object);
|
||||
~DelWhiteListInfosCallbackProxy() override;
|
||||
|
||||
void OnResult(const std::string& deviceId) override;
|
||||
virtual ~DelWhiteListInfosCallbackProxy() override;
|
||||
|
||||
virtual 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();
|
||||
~DelWhiteListInfosCallbackStub() override;
|
||||
virtual ~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;
|
||||
~RegisterDInputCb() override = default;
|
||||
void OnResult(const std::string& devId, const std::string& dhId, const int32_t& status) override;
|
||||
virtual ~RegisterDInputCb() = default;
|
||||
void OnResult(const std::string& devId, const std::string& dhId, const int32_t& status);
|
||||
};
|
||||
|
||||
class UnregisterDInputCb : public OHOS::DistributedHardware::DistributedInput::UnregisterDInputCallbackStub {
|
||||
public:
|
||||
UnregisterDInputCb() = default;
|
||||
~UnregisterDInputCb() override = default;
|
||||
void OnResult(const std::string& devId, const std::string& dhId, const int32_t& status) override;
|
||||
virtual ~UnregisterDInputCb() = default;
|
||||
void OnResult(const std::string& devId, const std::string& dhId, const int32_t& status);
|
||||
};
|
||||
|
||||
class AddWhiteListInfosCb : public OHOS::DistributedHardware::DistributedInput::AddWhiteListInfosCallbackStub {
|
||||
public:
|
||||
AddWhiteListInfosCb() = default;
|
||||
~AddWhiteListInfosCb() override = default;
|
||||
void OnResult(const std::string &deviceId, const std::string &strJson) override;
|
||||
virtual ~AddWhiteListInfosCb() = default;
|
||||
void OnResult(const std::string &deviceId, const std::string &strJson);
|
||||
};
|
||||
|
||||
class DelWhiteListInfosCb : public OHOS::DistributedHardware::DistributedInput::DelWhiteListInfosCallbackStub {
|
||||
public:
|
||||
DelWhiteListInfosCb() = default;
|
||||
~DelWhiteListInfosCb() override = default;
|
||||
void OnResult(const std::string &deviceId) override;
|
||||
virtual ~DelWhiteListInfosCb() = default;
|
||||
void OnResult(const std::string &deviceId);
|
||||
};
|
||||
|
||||
class SharingDhIdListenerCb : public OHOS::DistributedHardware::DistributedInput::SharingDhIdListenerStub {
|
||||
public:
|
||||
SharingDhIdListenerCb() = default;
|
||||
~SharingDhIdListenerCb() override = default;
|
||||
int32_t OnSharing(std::string dhId) override;
|
||||
int32_t OnNoSharing(std::string dhId) override;
|
||||
virtual ~SharingDhIdListenerCb() = default;
|
||||
int32_t OnSharing(std::string dhId);
|
||||
int32_t OnNoSharing(std::string dhId);
|
||||
};
|
||||
|
||||
class GetSinkScreenInfosCb : public OHOS::DistributedHardware::DistributedInput::GetSinkScreenInfosCallbackStub {
|
||||
public:
|
||||
GetSinkScreenInfosCb() = default;
|
||||
~GetSinkScreenInfosCb() override = default;
|
||||
void OnResult(const std::string &strJson) override;
|
||||
virtual ~GetSinkScreenInfosCb() = default;
|
||||
void OnResult(const std::string &strJson);
|
||||
};
|
||||
|
||||
class DInputClientEventHandler : public AppExecFwk::EventHandler {
|
||||
public:
|
||||
explicit DInputClientEventHandler(const std::shared_ptr<AppExecFwk::EventRunner> &runner);
|
||||
~DInputClientEventHandler() override = default;
|
||||
DInputClientEventHandler(const std::shared_ptr<AppExecFwk::EventRunner> &runner);
|
||||
~DInputClientEventHandler() {}
|
||||
|
||||
void ProcessEvent(const AppExecFwk::InnerEvent::Pointer &event) override;
|
||||
};
|
||||
|
||||
@@ -32,18 +32,18 @@ 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;
|
||||
|
||||
int32_t RegisterSharingDhIdListener(sptr<ISharingDhIdListener> sharingDhIdListener) override;
|
||||
virtual int32_t RegisterSharingDhIdListener(sptr<ISharingDhIdListener> sharingDhIdListener) override;
|
||||
|
||||
private:
|
||||
bool SendRequest(uint32_t code, MessageParcel &data, MessageParcel &reply);
|
||||
|
||||
@@ -28,9 +28,10 @@ namespace DistributedInput {
|
||||
class DistributedInputSinkStub : public IRemoteStub<IDistributedSinkInput> {
|
||||
public:
|
||||
DistributedInputSinkStub();
|
||||
~DistributedInputSinkStub() override;
|
||||
virtual ~DistributedInputSinkStub() override;
|
||||
|
||||
int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
|
||||
virtual int32_t OnRemoteRequest(
|
||||
uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
|
||||
|
||||
int32_t InitInner(MessageParcel &data, MessageParcel &reply, MessageOption &option);
|
||||
|
||||
|
||||
@@ -27,62 +27,64 @@ namespace DistributedHardware {
|
||||
namespace DistributedInput {
|
||||
class DistributedInputSourceProxy : public IRemoteProxy<IDistributedSourceInput> {
|
||||
public:
|
||||
|
||||
explicit DistributedInputSourceProxy(const sptr<IRemoteObject> &object);
|
||||
~DistributedInputSourceProxy() override;
|
||||
|
||||
int32_t Init() override;
|
||||
virtual ~DistributedInputSourceProxy() override;
|
||||
|
||||
int32_t Release() override;
|
||||
virtual int32_t Init() override;
|
||||
|
||||
int32_t RegisterDistributedHardware(const std::string& devId, const std::string& dhId,
|
||||
virtual int32_t Release() override;
|
||||
|
||||
virtual int32_t RegisterDistributedHardware(const std::string& devId, const std::string& dhId,
|
||||
const std::string& parameters, sptr<IRegisterDInputCallback> callback) override;
|
||||
|
||||
int32_t UnregisterDistributedHardware(const std::string& devId, const std::string& dhId,
|
||||
virtual int32_t UnregisterDistributedHardware(const std::string& devId, const std::string& dhId,
|
||||
sptr<IUnregisterDInputCallback> callback) override;
|
||||
|
||||
int32_t PrepareRemoteInput(const std::string &deviceId, sptr<IPrepareDInputCallback> callback) override;
|
||||
virtual int32_t PrepareRemoteInput(const std::string &deviceId, sptr<IPrepareDInputCallback> callback) override;
|
||||
|
||||
int32_t UnprepareRemoteInput(const std::string &deviceId, sptr<IUnprepareDInputCallback> callback) override;
|
||||
virtual int32_t UnprepareRemoteInput(const std::string &deviceId, sptr<IUnprepareDInputCallback> callback) override;
|
||||
|
||||
int32_t StartRemoteInput(
|
||||
virtual int32_t StartRemoteInput(
|
||||
const std::string& deviceId, const uint32_t& inputTypes, sptr<IStartDInputCallback> callback) override;
|
||||
|
||||
int32_t StopRemoteInput(
|
||||
virtual int32_t StopRemoteInput(
|
||||
const std::string& deviceId, const uint32_t& inputTypes, sptr<IStopDInputCallback> callback) override;
|
||||
|
||||
int32_t StartRemoteInput(const std::string &srcId, const std::string &sinkId, const uint32_t &inputTypes,
|
||||
virtual int32_t StartRemoteInput(const std::string &srcId, const std::string &sinkId, const uint32_t &inputTypes,
|
||||
sptr<IStartDInputCallback> callback) override;
|
||||
|
||||
int32_t StopRemoteInput(const std::string &srcId, const std::string &sinkId, const uint32_t &inputTypes,
|
||||
virtual int32_t StopRemoteInput(const std::string &srcId, const std::string &sinkId, const uint32_t &inputTypes,
|
||||
sptr<IStopDInputCallback> callback) override;
|
||||
|
||||
int32_t PrepareRemoteInput(const std::string &srcId, const std::string &sinkId,
|
||||
virtual int32_t PrepareRemoteInput(const std::string &srcId, const std::string &sinkId,
|
||||
sptr<IPrepareDInputCallback> callback) override;
|
||||
|
||||
int32_t UnprepareRemoteInput(const std::string &srcId, const std::string &sinkId,
|
||||
virtual int32_t UnprepareRemoteInput(const std::string &srcId, const std::string &sinkId,
|
||||
sptr<IUnprepareDInputCallback> callback) override;
|
||||
|
||||
int32_t StartRemoteInput(const std::string &sinkId, const std::vector<std::string> &dhIds,
|
||||
virtual int32_t StartRemoteInput(const std::string &sinkId, const std::vector<std::string> &dhIds,
|
||||
sptr<IStartStopDInputsCallback> callback) override;
|
||||
|
||||
int32_t StopRemoteInput(const std::string &sinkId, const std::vector<std::string> &dhIds,
|
||||
virtual int32_t StopRemoteInput(const std::string &sinkId, const std::vector<std::string> &dhIds,
|
||||
sptr<IStartStopDInputsCallback> callback) override;
|
||||
|
||||
int32_t StartRemoteInput(const std::string &srcId, const std::string &sinkId,
|
||||
virtual int32_t StartRemoteInput(const std::string &srcId, const std::string &sinkId,
|
||||
const std::vector<std::string> &dhIds, sptr<IStartStopDInputsCallback> callback) override;
|
||||
|
||||
int32_t StopRemoteInput(const std::string &srcId, const std::string &sinkId,
|
||||
virtual int32_t StopRemoteInput(const std::string &srcId, const std::string &sinkId,
|
||||
const std::vector<std::string> &dhIds, sptr<IStartStopDInputsCallback> callback) 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 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 SyncNodeInfoRemoteInput(const std::string &userDevId, const std::string &dhid,
|
||||
virtual int32_t SyncNodeInfoRemoteInput(const std::string &userDevId, const std::string &dhid,
|
||||
const std::string &nodeDesc) override;
|
||||
int32_t RegisterSimulationEventListener(sptr<ISimulationEventListener> listener) override;
|
||||
int32_t UnregisterSimulationEventListener(sptr<ISimulationEventListener> listener) override;
|
||||
virtual int32_t RegisterSimulationEventListener(sptr<ISimulationEventListener> listener) override;
|
||||
virtual int32_t UnregisterSimulationEventListener(sptr<ISimulationEventListener> listener) override;
|
||||
|
||||
private:
|
||||
bool SendRequest(const IDistributedSourceInput::MessageCode code, MessageParcel &data, MessageParcel &reply);
|
||||
|
||||
@@ -28,9 +28,10 @@ namespace DistributedInput {
|
||||
class DistributedInputSourceStub : public IRemoteStub<IDistributedSourceInput> {
|
||||
public:
|
||||
DistributedInputSourceStub();
|
||||
~DistributedInputSourceStub() override;
|
||||
virtual ~DistributedInputSourceStub() override;
|
||||
|
||||
int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
|
||||
virtual int32_t OnRemoteRequest(
|
||||
uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
|
||||
|
||||
private:
|
||||
int32_t HandleInitDistributedHardware(MessageParcel &reply);
|
||||
|
||||
@@ -28,9 +28,10 @@ namespace DistributedInput {
|
||||
class GetSinkScreenInfosCallbackProxy : public IRemoteProxy<IGetSinkScreenInfosCallback> {
|
||||
public:
|
||||
explicit GetSinkScreenInfosCallbackProxy(const sptr<IRemoteObject> &object);
|
||||
~GetSinkScreenInfosCallbackProxy() override;
|
||||
|
||||
void OnResult(const std::string& strJson) override;
|
||||
virtual ~GetSinkScreenInfosCallbackProxy() override;
|
||||
|
||||
virtual 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();
|
||||
~GetSinkScreenInfosCallbackStub() override;
|
||||
virtual ~GetSinkScreenInfosCallbackStub() override;
|
||||
|
||||
int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
|
||||
|
||||
|
||||
@@ -28,12 +28,13 @@ namespace DistributedInput {
|
||||
class InputNodeListenerProxy : public IRemoteProxy<InputNodeListener> {
|
||||
public:
|
||||
explicit InputNodeListenerProxy(const sptr<IRemoteObject> &object);
|
||||
~InputNodeListenerProxy() override;
|
||||
|
||||
void OnNodeOnLine(const std::string srcDevId, const std::string sinkDevId,
|
||||
virtual ~InputNodeListenerProxy() override;
|
||||
|
||||
virtual void OnNodeOnLine(const std::string srcDevId, const std::string sinkDevId,
|
||||
const std::string sinkNodeId, const std::string sinkNodeDesc) override;
|
||||
|
||||
void OnNodeOffLine(const std::string srcDevId, const std::string sinkDevId,
|
||||
virtual 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();
|
||||
~InputNodeListenerStub() override;
|
||||
virtual ~InputNodeListenerStub() override;
|
||||
|
||||
int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
|
||||
|
||||
|
||||
@@ -28,9 +28,10 @@ namespace DistributedInput {
|
||||
class PrepareDInputCallbackProxy : public IRemoteProxy<IPrepareDInputCallback> {
|
||||
public:
|
||||
explicit PrepareDInputCallbackProxy(const sptr<IRemoteObject> &object);
|
||||
~PrepareDInputCallbackProxy() override;
|
||||
|
||||
void OnResult(const std::string& deviceId, const int32_t& status) override;
|
||||
virtual ~PrepareDInputCallbackProxy() override;
|
||||
|
||||
virtual 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();
|
||||
~PrepareDInputCallbackStub() override;
|
||||
virtual ~PrepareDInputCallbackStub() override;
|
||||
|
||||
int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
|
||||
|
||||
|
||||
@@ -28,9 +28,10 @@ namespace DistributedInput {
|
||||
class RegisterDInputCallbackProxy : public IRemoteProxy<IRegisterDInputCallback> {
|
||||
public:
|
||||
explicit RegisterDInputCallbackProxy(const sptr<IRemoteObject> &object);
|
||||
~RegisterDInputCallbackProxy() override;
|
||||
|
||||
void OnResult(const std::string& devId, const std::string& dhId, const int32_t& status) override;
|
||||
virtual ~RegisterDInputCallbackProxy() override;
|
||||
|
||||
virtual 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();
|
||||
~RegisterDInputCallbackStub() override;
|
||||
virtual ~RegisterDInputCallbackStub() override;
|
||||
|
||||
int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
|
||||
|
||||
|
||||
@@ -28,10 +28,11 @@ namespace DistributedInput {
|
||||
class SharingDhIdListenerProxy : public IRemoteProxy<ISharingDhIdListener> {
|
||||
public:
|
||||
explicit SharingDhIdListenerProxy(const sptr<IRemoteObject> &object);
|
||||
~SharingDhIdListenerProxy() override;
|
||||
|
||||
int32_t OnSharing(std::string dhId) override;
|
||||
int32_t OnNoSharing(std::string dhId) override;
|
||||
virtual ~SharingDhIdListenerProxy() override;
|
||||
|
||||
virtual int32_t OnSharing(std::string dhId) override;
|
||||
virtual 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();
|
||||
~SharingDhIdListenerStub() override;
|
||||
virtual ~SharingDhIdListenerStub() override;
|
||||
|
||||
int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
|
||||
|
||||
|
||||
@@ -28,9 +28,10 @@ namespace DistributedInput {
|
||||
class SimulationEventListenerProxy : public IRemoteProxy<ISimulationEventListener> {
|
||||
public:
|
||||
explicit SimulationEventListenerProxy(const sptr<IRemoteObject> &object);
|
||||
~SimulationEventListenerProxy() override;
|
||||
|
||||
int32_t OnSimulationEvent(uint32_t type, uint32_t code, int32_t value) override;
|
||||
virtual ~SimulationEventListenerProxy() override;
|
||||
|
||||
virtual 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();
|
||||
~SimulationEventListenerStub() override;
|
||||
virtual ~SimulationEventListenerStub() override;
|
||||
|
||||
int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
|
||||
|
||||
|
||||
@@ -28,9 +28,10 @@ namespace DistributedInput {
|
||||
class StartDInputCallbackProxy : public IRemoteProxy<IStartDInputCallback> {
|
||||
public:
|
||||
explicit StartDInputCallbackProxy(const sptr<IRemoteObject> &object);
|
||||
~StartDInputCallbackProxy() override;
|
||||
|
||||
void OnResult(const std::string& devId, const uint32_t& inputTypes, const int32_t& status) override;
|
||||
virtual ~StartDInputCallbackProxy() override;
|
||||
|
||||
virtual void OnResult(const std::string& devId, const uint32_t& inputTypes, const int32_t& status) override;
|
||||
|
||||
private:
|
||||
static inline BrokerDelegator<StartDInputCallbackProxy> delegator_;
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace DistributedInput {
|
||||
class StartDInputCallbackStub : public IRemoteStub<IStartDInputCallback> {
|
||||
public:
|
||||
StartDInputCallbackStub();
|
||||
~StartDInputCallbackStub() override;
|
||||
virtual ~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);
|
||||
~StartStopDInputsCallbackProxy() override;
|
||||
virtual ~StartStopDInputsCallbackProxy() override;
|
||||
|
||||
void OnResultDhids(const std::string &devId, const int32_t &status) override;
|
||||
virtual 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();
|
||||
~StartStopDInputsCallbackStub() override;
|
||||
virtual ~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);
|
||||
~StartStopResultCallbackProxy() override;
|
||||
virtual ~StartStopResultCallbackProxy() override;
|
||||
|
||||
void OnStart(const std::string &srcId, const std::string &sinkId,
|
||||
virtual void OnStart(const std::string &srcId, const std::string &sinkId,
|
||||
std::vector<std::string> &dhIds) override;
|
||||
void OnStop(const std::string &srcId, const std::string &sinkId,
|
||||
virtual 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();
|
||||
~StartStopResultCallbackStub() override;
|
||||
virtual ~StartStopResultCallbackStub() override;
|
||||
|
||||
int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
|
||||
|
||||
|
||||
@@ -28,9 +28,10 @@ namespace DistributedInput {
|
||||
class StopDInputCallbackProxy : public IRemoteProxy<IStopDInputCallback> {
|
||||
public:
|
||||
explicit StopDInputCallbackProxy(const sptr<IRemoteObject> &object);
|
||||
~StopDInputCallbackProxy() override;
|
||||
|
||||
void OnResult(const std::string& devId, const uint32_t& inputTypes, const int32_t& status) override;
|
||||
virtual ~StopDInputCallbackProxy() override;
|
||||
|
||||
virtual 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();
|
||||
~StopDInputCallbackStub() override;
|
||||
virtual ~StopDInputCallbackStub() override;
|
||||
|
||||
int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
|
||||
|
||||
|
||||
@@ -28,9 +28,10 @@ namespace DistributedInput {
|
||||
class UnprepareDInputCallbackProxy : public IRemoteProxy<IUnprepareDInputCallback> {
|
||||
public:
|
||||
explicit UnprepareDInputCallbackProxy(const sptr<IRemoteObject> &object);
|
||||
~UnprepareDInputCallbackProxy() override;
|
||||
|
||||
void OnResult(const std::string& deviceId, const int32_t& status) override;
|
||||
virtual ~UnprepareDInputCallbackProxy() override;
|
||||
|
||||
virtual 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();
|
||||
~UnprepareDInputCallbackStub() override;
|
||||
virtual ~UnprepareDInputCallbackStub() override;
|
||||
|
||||
int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
|
||||
|
||||
|
||||
@@ -28,9 +28,10 @@ namespace DistributedInput {
|
||||
class UnregisterDInputCallbackProxy : public IRemoteProxy<IUnregisterDInputCallback> {
|
||||
public:
|
||||
explicit UnregisterDInputCallbackProxy(const sptr<IRemoteObject> &object);
|
||||
~UnregisterDInputCallbackProxy() override;
|
||||
|
||||
void OnResult(const std::string& devId, const std::string& dhId, const int32_t& status) override;
|
||||
virtual ~UnregisterDInputCallbackProxy() override;
|
||||
|
||||
virtual 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();
|
||||
~UnregisterDInputCallbackStub() override;
|
||||
virtual ~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,34 +23,34 @@ 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) = 0;
|
||||
virtual void OnResponseUnprepareRemoteInput(const std::string deviceId, bool result) = 0;
|
||||
virtual void OnResponseStartRemoteInput(const std::string deviceId, const uint32_t inputTypes, bool result,
|
||||
virtual void onResponsePrepareRemoteInput(const std::string deviceId, bool result) = 0;
|
||||
virtual void onResponseUnprepareRemoteInput(const std::string deviceId, bool result) = 0;
|
||||
virtual void onResponseStartRemoteInput(const std::string deviceId, const uint32_t inputTypes, bool result,
|
||||
const std::string& object) = 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,
|
||||
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,
|
||||
const std::string& object) = 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 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) = 0;
|
||||
virtual void OnResponseRelayUnprepareRemoteInput(int32_t sessionId, const std::string &deviceId, bool result) = 0;
|
||||
virtual void OnResponseRelayStartDhidRemoteInput(const std::string &deviceId, const std::string &object) = 0;
|
||||
virtual void OnResponseRelayStartTypeRemoteInput(const std::string &deviceId, const std::string &object) = 0;
|
||||
virtual void onResponseRelayPrepareRemoteInput(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 onResponseRelayStartDhidRemoteInput(const std::string &deviceId, const std::string &object) = 0;
|
||||
virtual void onResponseRelayStartTypeRemoteInput(const std::string &deviceId, const std::string &object) = 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:
|
||||
explicit DistributedInputSinkEventHandler(const std::shared_ptr<AppExecFwk::EventRunner> &runner);
|
||||
~DistributedInputSinkEventHandler();
|
||||
DistributedInputSinkEventHandler(const std::shared_ptr<AppExecFwk::EventRunner> &runner);
|
||||
virtual ~DistributedInputSinkEventHandler();
|
||||
|
||||
bool ProxyPostTask(const Callback &callback, int64_t delayTime);
|
||||
|
||||
|
||||
@@ -56,31 +56,31 @@ public:
|
||||
|
||||
class DInputSinkListener : public DInputSinkTransCallback {
|
||||
public:
|
||||
explicit DInputSinkListener(DistributedInputSinkManager *manager);
|
||||
DInputSinkListener(DistributedInputSinkManager *manager);
|
||||
~DInputSinkListener();
|
||||
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 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);
|
||||
|
||||
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;
|
||||
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);
|
||||
|
||||
private:
|
||||
DistributedInputSinkManager *sinkManagerObj_;
|
||||
static inline int BitIsSet(const unsigned long *array, int bit)
|
||||
static inline int bit_is_set(const unsigned long *array, int bit)
|
||||
{
|
||||
return !!(array[bit / LONG_BITS] & (1LL << (bit % LONG_BITS)));
|
||||
}
|
||||
@@ -91,8 +91,8 @@ public:
|
||||
|
||||
class ProjectWindowListener : public PublisherListenerStub {
|
||||
public:
|
||||
explicit ProjectWindowListener(DistributedInputSinkManager *manager);
|
||||
~ProjectWindowListener() override;
|
||||
ProjectWindowListener(DistributedInputSinkManager *manager);
|
||||
~ProjectWindowListener();
|
||||
void OnMessage(const DHTopic topic, const std::string& message) override;
|
||||
|
||||
private:
|
||||
@@ -112,7 +112,7 @@ public:
|
||||
class DScreenSinkSvrRecipient : public IRemoteObject::DeathRecipient {
|
||||
public:
|
||||
DScreenSinkSvrRecipient(const std::string& srcDevId, const uint64_t srcWinId);
|
||||
~DScreenSinkSvrRecipient() override;
|
||||
~DScreenSinkSvrRecipient();
|
||||
void OnRemoteDied(const wptr<IRemoteObject> &remote) override;
|
||||
|
||||
private:
|
||||
@@ -125,11 +125,11 @@ public:
|
||||
|
||||
void OnStop() 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;
|
||||
|
||||
uint32_t GetSinkScreenInfosCbackSize();
|
||||
|
||||
@@ -139,7 +139,7 @@ public:
|
||||
|
||||
uint32_t GetInputTypes();
|
||||
|
||||
void SetInputTypes(const uint32_t& inputTypes);
|
||||
void SetInputTypes(const uint32_t& inputTypess);
|
||||
|
||||
/*
|
||||
* GetEventHandler, get the ui_service manager service's handler.
|
||||
|
||||
@@ -92,7 +92,7 @@ void DistributedInputSinkManager::AddWhiteList(nlohmann::json &jsonStr)
|
||||
}
|
||||
|
||||
if (vecFilter.empty() || vecFilter[0].empty() || vecFilter[0][0].empty()) {
|
||||
DHLOGE("OnStartRemoteInput called, white list is null.");
|
||||
DHLOGE("onStartRemoteInput called, white list is null.");
|
||||
jsonStr[DINPUT_SOFTBUS_KEY_WHITE_LIST] = "";
|
||||
return;
|
||||
}
|
||||
@@ -101,10 +101,10 @@ void DistributedInputSinkManager::AddWhiteList(nlohmann::json &jsonStr)
|
||||
jsonStr[DINPUT_SOFTBUS_KEY_WHITE_LIST] = object;
|
||||
}
|
||||
|
||||
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;
|
||||
@@ -113,10 +113,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));
|
||||
|
||||
nlohmann::json jsonStr;
|
||||
jsonStr[DINPUT_SOFTBUS_KEY_CMD_TYPE] = TRANS_SINK_MSG_ONUNPREPARE;
|
||||
@@ -125,10 +125,10 @@ 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("OnRelayPrepareRemoteInput called, toSinkSessionId: %d, devId: %s", toSinkSessionId,
|
||||
DHLOGI("onRelayPrepareRemoteInput called, toSinkSessionId: %d, devId: %s", toSinkSessionId,
|
||||
GetAnonyString(deviceId).c_str());
|
||||
|
||||
nlohmann::json jsonStr;
|
||||
@@ -139,12 +139,12 @@ 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("OnRelayUnprepareRemoteInput called, toSinkSessionId: %d, devId: %s", toSinkSessionId,
|
||||
DHLOGI("onRelayUnprepareRemoteInput called, toSinkSessionId: %d, devId: %s", toSinkSessionId,
|
||||
GetAnonyString(deviceId).c_str());
|
||||
OnStopRemoteInput(toSrcSessionId, static_cast<uint32_t>(DInputDeviceType::ALL));
|
||||
onStopRemoteInput(toSrcSessionId, static_cast<uint32_t>(DInputDeviceType::ALL));
|
||||
|
||||
nlohmann::json jsonStr;
|
||||
jsonStr[DINPUT_SOFTBUS_KEY_CMD_TYPE] = TRANS_SINK_MSG_ON_RELAY_UNPREPARE;
|
||||
@@ -154,10 +154,10 @@ 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)
|
||||
{
|
||||
DHLOGI("OnStartRemoteInput called, sessionId: %d, inputTypes: %u.", sessionId, inputTypes);
|
||||
DHLOGI("onStartRemoteInput called, sessionId: %d, inputTypes: %u.", sessionId, inputTypes);
|
||||
if (sinkManagerObj_ == nullptr) {
|
||||
DHLOGE("sinkManagerObj is null.");
|
||||
return;
|
||||
@@ -187,7 +187,7 @@ void DistributedInputSinkManager::DInputSinkListener::OnStartRemoteInput(
|
||||
DistributedInputSinkTransport::GetInstance().RespStartRemoteInput(sessionId, smsg);
|
||||
|
||||
if (startRes != DH_SUCCESS) {
|
||||
DHLOGE("OnStartRemoteInput startSwitch error.");
|
||||
DHLOGE("onStartRemoteInput startSwitch error.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -211,10 +211,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());
|
||||
if (sinkManagerObj_ == nullptr) {
|
||||
DHLOGE("sinkManagerObj is null.");
|
||||
@@ -249,10 +249,10 @@ void DistributedInputSinkManager::DInputSinkListener::OnStopRemoteInput(
|
||||
DistributedInputSinkSwitch::GetInstance().RemoveSession(sessionId);
|
||||
}
|
||||
|
||||
void DistributedInputSinkManager::DInputSinkListener::OnStartRemoteInputDhid(const int32_t &sessionId,
|
||||
void DistributedInputSinkManager::DInputSinkListener::onStartRemoteInputDhid(const int32_t &sessionId,
|
||||
const std::string &strDhids)
|
||||
{
|
||||
DHLOGI("OnStartRemoteInputDhid called, : sessionId: %d", sessionId);
|
||||
DHLOGI("onStartRemoteInputDhid called, : sessionId: %d", sessionId);
|
||||
if (sinkManagerObj_ == nullptr) {
|
||||
DHLOGE("sinkManagerObj is null.");
|
||||
return;
|
||||
@@ -281,7 +281,7 @@ void DistributedInputSinkManager::DInputSinkListener::OnStartRemoteInputDhid(con
|
||||
DistributedInputSinkTransport::GetInstance().RespStartRemoteInput(sessionId, smsg);
|
||||
|
||||
if (startRes != DH_SUCCESS) {
|
||||
DHLOGE("OnStartRemoteInputDhid StartSwitch error.");
|
||||
DHLOGE("onStartRemoteInputDhid StartSwitch error.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -294,10 +294,10 @@ void DistributedInputSinkManager::DInputSinkListener::OnStartRemoteInputDhid(con
|
||||
DistributedInputCollector::GetInstance().ReportDhIdSharingState(affDhIds);
|
||||
}
|
||||
|
||||
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);
|
||||
if (sinkManagerObj_ == nullptr) {
|
||||
DHLOGE("sinkManagerObj is null.");
|
||||
return;
|
||||
@@ -313,7 +313,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);
|
||||
}
|
||||
|
||||
@@ -330,17 +330,17 @@ void DistributedInputSinkManager::DInputSinkListener::OnStopRemoteInputDhid(cons
|
||||
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);
|
||||
}
|
||||
}
|
||||
DistributedInputSinkSwitch::GetInstance().RemoveSession(sessionId);
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
DHLOGI("OnRelayStartDhidRemoteInput called, toSinkSessionId: %d", toSinkSessionId);
|
||||
DHLOGI("onRelayStartDhidRemoteInput called, toSinkSessionId: %d", toSinkSessionId);
|
||||
if (sinkManagerObj_ == nullptr) {
|
||||
DHLOGE("sinkManagerObj is null.");
|
||||
return;
|
||||
@@ -370,7 +370,7 @@ void DistributedInputSinkManager::DInputSinkListener::OnRelayStartDhidRemoteInpu
|
||||
DistributedInputSinkTransport::GetInstance().RespStartRemoteInput(toSinkSessionId, smsg);
|
||||
|
||||
if (startRes != DH_SUCCESS) {
|
||||
DHLOGE("OnRelayStartDhidRemoteInput startSwitch error.");
|
||||
DHLOGE("onRelayStartDhidRemoteInput startSwitch error.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -384,10 +384,10 @@ void DistributedInputSinkManager::DInputSinkListener::OnRelayStartDhidRemoteInpu
|
||||
DistributedInputCollector::GetInstance().ReportDhIdSharingState(affDhIds);
|
||||
}
|
||||
|
||||
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("OnRelayStopDhidRemoteInput called, toSinkSessionId: %d", toSinkSessionId);
|
||||
DHLOGI("onRelayStopDhidRemoteInput called, toSinkSessionId: %d", toSinkSessionId);
|
||||
if (sinkManagerObj_ == nullptr) {
|
||||
DHLOGE("sinkManagerObj is null.");
|
||||
return;
|
||||
@@ -403,7 +403,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);
|
||||
}
|
||||
|
||||
@@ -421,17 +421,17 @@ 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);
|
||||
}
|
||||
}
|
||||
DistributedInputSinkSwitch::GetInstance().RemoveSession(toSinkSessionId);
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
DHLOGI("OnRelayStartTypeRemoteInput called, toSinkSessionId: %d", toSinkSessionId);
|
||||
DHLOGI("onRelayStartTypeRemoteInput called, toSinkSessionId: %d", toSinkSessionId);
|
||||
if (sinkManagerObj_ == nullptr) {
|
||||
DHLOGE("sinkManagerObj is null.");
|
||||
return;
|
||||
@@ -486,7 +486,7 @@ 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)
|
||||
{
|
||||
if (sinkManagerObj_ == nullptr) {
|
||||
@@ -494,7 +494,7 @@ void DistributedInputSinkManager::DInputSinkListener::OnRelayStopTypeRemoteInput
|
||||
return;
|
||||
}
|
||||
|
||||
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() -
|
||||
@@ -587,15 +587,15 @@ void DistributedInputSinkManager::DInputSinkListener::CheckKeyState(const int32_
|
||||
SleepTimeMs();
|
||||
continue;
|
||||
}
|
||||
leftKeyVal = BitIsSet(keystate, BTN_LEFT);
|
||||
leftKeyVal = bit_is_set(keystate, BTN_LEFT);
|
||||
if (leftKeyVal != 0) {
|
||||
DistributedInputSinkTransport::GetInstance().SendKeyStateNodeMsg(sessionId, dhid, BTN_LEFT);
|
||||
}
|
||||
rightKeyVal = BitIsSet(keystate, BTN_RIGHT);
|
||||
rightKeyVal = bit_is_set(keystate, BTN_RIGHT);
|
||||
if (rightKeyVal != 0) {
|
||||
DistributedInputSinkTransport::GetInstance().SendKeyStateNodeMsg(sessionId, dhid, BTN_RIGHT);
|
||||
}
|
||||
midKeyVal = BitIsSet(keystate, BTN_MIDDLE);
|
||||
midKeyVal = bit_is_set(keystate, BTN_MIDDLE);
|
||||
if (midKeyVal != 0) {
|
||||
DistributedInputSinkTransport::GetInstance().SendKeyStateNodeMsg(sessionId, dhid, BTN_MIDDLE);
|
||||
}
|
||||
@@ -805,7 +805,7 @@ DInputServerType DistributedInputSinkManager::GetStartTransFlag()
|
||||
}
|
||||
void DistributedInputSinkManager::SetStartTransFlag(const DInputServerType flag)
|
||||
{
|
||||
DHLOGI("Set Sink isStartTrans_ %d", static_cast<int32_t>(flag));
|
||||
DHLOGI("Set Sink isStartTrans_ %d", (int32_t)flag);
|
||||
isStartTrans_ = flag;
|
||||
}
|
||||
|
||||
@@ -925,8 +925,8 @@ int32_t DistributedInputSinkManager::ProjectWindowListener::UpdateSinkScreenInfo
|
||||
sinkScreenInfo.sinkShowWidth = GetScreenWidth();
|
||||
sinkScreenInfo.sinkShowHeight = GetScreenHeight();
|
||||
LocalAbsInfo info = DInputContext::GetInstance().GetLocalTouchScreenInfo().localAbsInfo;
|
||||
sinkScreenInfo.sinkPhyWidth = static_cast<uint32_t>(info.absMtPositionXMax + 1);
|
||||
sinkScreenInfo.sinkPhyHeight = static_cast<uint32_t>(info.absMtPositionYMax + 1);
|
||||
sinkScreenInfo.sinkPhyWidth = (uint32_t)(info.absMtPositionXMax + 1);
|
||||
sinkScreenInfo.sinkPhyHeight = (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,
|
||||
|
||||
@@ -61,8 +61,8 @@ public:
|
||||
|
||||
class DInputSinkEventHandler : public AppExecFwk::EventHandler {
|
||||
public:
|
||||
explicit DInputSinkEventHandler(const std::shared_ptr<AppExecFwk::EventRunner> &runner);
|
||||
~DInputSinkEventHandler() override = default;
|
||||
DInputSinkEventHandler(const std::shared_ptr<AppExecFwk::EventRunner> &runner);
|
||||
~DInputSinkEventHandler() {}
|
||||
|
||||
void ProcessEvent(const AppExecFwk::InnerEvent::Pointer &event) override;
|
||||
void RecordEventLog(const std::shared_ptr<nlohmann::json> &events);
|
||||
|
||||
@@ -249,7 +249,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)
|
||||
@@ -261,7 +261,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)
|
||||
@@ -274,7 +274,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)
|
||||
@@ -286,7 +286,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)
|
||||
@@ -324,7 +324,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)
|
||||
@@ -343,7 +343,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)
|
||||
@@ -360,7 +360,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)
|
||||
@@ -377,7 +377,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)
|
||||
@@ -399,7 +399,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)
|
||||
@@ -421,7 +421,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)
|
||||
@@ -443,7 +443,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)
|
||||
@@ -465,7 +465,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::DInputTransbaseSinkListener::HandleSessionData(int32_t sessionId,
|
||||
|
||||
@@ -64,6 +64,9 @@ 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:
|
||||
explicit VirtualDevice(const InputDevice& event);
|
||||
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:
|
||||
explicit VirtualKeyboard(const InputDevice& event);
|
||||
~VirtualKeyboard() override;
|
||||
VirtualKeyboard(const InputDevice& event);
|
||||
~VirtualKeyboard();
|
||||
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:
|
||||
explicit VirtualMouse(const InputDevice& event);
|
||||
~VirtualMouse() override;
|
||||
VirtualMouse(const InputDevice& event);
|
||||
~VirtualMouse();
|
||||
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:
|
||||
explicit VirtualTouchpad(const InputDevice& event);
|
||||
~VirtualTouchpad() override;
|
||||
VirtualTouchpad(const InputDevice& event);
|
||||
~VirtualTouchpad();
|
||||
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() override;
|
||||
~VirtualTouchScreen();
|
||||
protected:
|
||||
const std::vector<uint32_t>& GetEventTypes() const override;
|
||||
const std::vector<uint32_t>& GetKeys() const override;
|
||||
|
||||
@@ -284,23 +284,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 inputType = 0;
|
||||
uint32_t input_types_ = 0;
|
||||
|
||||
if ((inputTypes & static_cast<uint32_t>(DInputDeviceType::MOUSE)) != 0) {
|
||||
inputType |= INPUT_DEVICE_CLASS_CURSOR;
|
||||
input_types_ |= INPUT_DEVICE_CLASS_CURSOR;
|
||||
}
|
||||
|
||||
if ((inputTypes & static_cast<uint32_t>(DInputDeviceType::KEYBOARD)) != 0) {
|
||||
inputType |= INPUT_DEVICE_CLASS_KEYBOARD;
|
||||
input_types_ |= INPUT_DEVICE_CLASS_KEYBOARD;
|
||||
}
|
||||
|
||||
if ((inputTypes & static_cast<uint32_t>(DInputDeviceType::MOUSE)) != 0) {
|
||||
inputType |= INPUT_DEVICE_CLASS_TOUCH;
|
||||
input_types_ |= INPUT_DEVICE_CLASS_TOUCH;
|
||||
}
|
||||
|
||||
std::lock_guard<std::mutex> lock(virtualDeviceMapMutex_);
|
||||
for (const auto &[id, virdevice] : virtualDeviceMap_) {
|
||||
if ((virdevice->GetDeviceType() & inputType) && (virdevice->GetNetWorkId() == networkId)) {
|
||||
if ((virdevice->GetDeviceType() & input_types_) && (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 = [this](int32_t uiSet, const std::vector<uint32_t>& list) -> bool {
|
||||
auto fun = [&](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 sysfsDeviceName[16];
|
||||
if (ioctl(fd_, UI_GET_SYSNAME(sizeof(sysfsDeviceName)), sysfsDeviceName) < 0) {
|
||||
char sysfs_device_name[16];
|
||||
if (ioctl(fd_, UI_GET_SYSNAME(sizeof(sysfs_device_name)), sysfs_device_name) < 0) {
|
||||
DHLOGE("Unable to get input device name");
|
||||
}
|
||||
DHLOGI("get input device name: %s, fd: %d", GetAnonyString(sysfsDeviceName).c_str(), fd_);
|
||||
DHLOGI("get input device name: %s, fd: %d", GetAnonyString(sysfs_device_name).c_str(), fd_);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ const std::vector<uint32_t> RELBITS {};
|
||||
|
||||
VirtualTouchpad::VirtualTouchpad(const InputDevice& event) : VirtualDevice(event)
|
||||
{
|
||||
const int absMaxWheel = 71;
|
||||
const int ABS_MAX_WHEEL = 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] = absMaxWheel;
|
||||
dev_.absmax[ABS_WHEEL] = ABS_MAX_WHEEL;
|
||||
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] = static_cast<int32_t>(phyWidth);
|
||||
dev_.absmax[ABS_X] = (int32_t)phyWidth;
|
||||
dev_.absfuzz[ABS_X] = 0;
|
||||
dev_.absflat[ABS_X] = 0;
|
||||
|
||||
dev_.absmin[ABS_Y] = 0;
|
||||
dev_.absmax[ABS_Y] = static_cast<int32_t>(phyHeight);
|
||||
dev_.absmax[ABS_Y] = (int32_t)phyHeight;
|
||||
dev_.absfuzz[ABS_Y] = 0;
|
||||
dev_.absflat[ABS_Y] = 0;
|
||||
|
||||
@@ -70,7 +70,7 @@ 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] = static_cast<int32_t>(phyHeight);
|
||||
dev_.absmax[ABS_MT_POSITION_X] = (int32_t)phyWidth;
|
||||
dev_.absfuzz[ABS_MT_POSITION_X] = 0;
|
||||
dev_.absflat[ABS_MT_POSITION_X] = 0;
|
||||
|
||||
|
||||
@@ -26,8 +26,8 @@ namespace DistributedHardware {
|
||||
namespace DistributedInput {
|
||||
class DistributedInputSourceEventHandler : public AppExecFwk::EventHandler {
|
||||
public:
|
||||
explicit DistributedInputSourceEventHandler(const std::shared_ptr<AppExecFwk::EventRunner> &runner);
|
||||
~DistributedInputSourceEventHandler() override;
|
||||
DistributedInputSourceEventHandler(const std::shared_ptr<AppExecFwk::EventRunner> &runner);
|
||||
virtual ~DistributedInputSourceEventHandler();
|
||||
|
||||
bool ProxyPostTask(const Callback &callback, int64_t delayTime);
|
||||
|
||||
|
||||
@@ -119,65 +119,65 @@ typedef struct InputDeviceId {
|
||||
|
||||
public:
|
||||
DistributedInputSourceManager(int32_t saId, bool runOnCreate);
|
||||
~DistributedInputSourceManager() override;
|
||||
~DistributedInputSourceManager();
|
||||
|
||||
void OnStart() override;
|
||||
|
||||
void OnStop() override;
|
||||
|
||||
int32_t Init() override;
|
||||
virtual int32_t Init() override;
|
||||
|
||||
int32_t Release() override;
|
||||
virtual int32_t Release() override;
|
||||
|
||||
int32_t RegisterDistributedHardware(const std::string& devId, const std::string& dhId,
|
||||
virtual int32_t RegisterDistributedHardware(const std::string& devId, const std::string& dhId,
|
||||
const std::string& parameters, sptr<IRegisterDInputCallback> callback) override;
|
||||
|
||||
int32_t UnregisterDistributedHardware(const std::string& devId, const std::string& dhId,
|
||||
virtual int32_t UnregisterDistributedHardware(const std::string& devId, const std::string& dhId,
|
||||
sptr<IUnregisterDInputCallback> callback) override;
|
||||
|
||||
int32_t PrepareRemoteInput(const std::string &deviceId, sptr<IPrepareDInputCallback> callback) override;
|
||||
virtual int32_t PrepareRemoteInput(const std::string &deviceId, sptr<IPrepareDInputCallback> callback) override;
|
||||
|
||||
int32_t UnprepareRemoteInput(const std::string &deviceId, sptr<IUnprepareDInputCallback> callback) override;
|
||||
virtual int32_t UnprepareRemoteInput(const std::string &deviceId, sptr<IUnprepareDInputCallback> callback) override;
|
||||
|
||||
int32_t StartRemoteInput(
|
||||
virtual int32_t StartRemoteInput(
|
||||
const std::string& deviceId, const uint32_t& inputTypes, sptr<IStartDInputCallback> callback) override;
|
||||
|
||||
int32_t StopRemoteInput(
|
||||
virtual int32_t StopRemoteInput(
|
||||
const std::string& deviceId, const uint32_t& inputTypes, sptr<IStopDInputCallback> callback) override;
|
||||
|
||||
int32_t StartRemoteInput(const std::string &srcId, const std::string &sinkId, const uint32_t &inputTypes,
|
||||
virtual int32_t StartRemoteInput(const std::string &srcId, const std::string &sinkId, const uint32_t &inputTypes,
|
||||
sptr<IStartDInputCallback> callback) override;
|
||||
|
||||
int32_t StopRemoteInput(const std::string &srcId, const std::string &sinkId, const uint32_t &inputTypes,
|
||||
virtual int32_t StopRemoteInput(const std::string &srcId, const std::string &sinkId, const uint32_t &inputTypes,
|
||||
sptr<IStopDInputCallback> callback) override;
|
||||
|
||||
int32_t PrepareRemoteInput(const std::string &srcId, const std::string &sinkId,
|
||||
virtual int32_t PrepareRemoteInput(const std::string &srcId, const std::string &sinkId,
|
||||
sptr<IPrepareDInputCallback> callback) override;
|
||||
|
||||
int32_t UnprepareRemoteInput(const std::string &srcId, const std::string &sinkId,
|
||||
virtual int32_t UnprepareRemoteInput(const std::string &srcId, const std::string &sinkId,
|
||||
sptr<IUnprepareDInputCallback> callback) override;
|
||||
|
||||
int32_t StartRemoteInput(const std::string &sinkId, const std::vector<std::string> &dhIds,
|
||||
virtual int32_t StartRemoteInput(const std::string &sinkId, const std::vector<std::string> &dhIds,
|
||||
sptr<IStartStopDInputsCallback> callback) override;
|
||||
|
||||
int32_t StopRemoteInput(const std::string &sinkId, const std::vector<std::string> &dhIds,
|
||||
virtual int32_t StopRemoteInput(const std::string &sinkId, const std::vector<std::string> &dhIds,
|
||||
sptr<IStartStopDInputsCallback> callback) override;
|
||||
|
||||
int32_t StartRemoteInput(const std::string &srcId, const std::string &sinkId,
|
||||
virtual int32_t StartRemoteInput(const std::string &srcId, const std::string &sinkId,
|
||||
const std::vector<std::string> &dhIds, sptr<IStartStopDInputsCallback> callback) override;
|
||||
|
||||
int32_t StopRemoteInput(const std::string &srcId, const std::string &sinkId,
|
||||
virtual int32_t StopRemoteInput(const std::string &srcId, const std::string &sinkId,
|
||||
const std::vector<std::string> &dhIds, sptr<IStartStopDInputsCallback> callback) 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 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 SyncNodeInfoRemoteInput(const std::string &userDevId, const std::string &dhId,
|
||||
virtual int32_t SyncNodeInfoRemoteInput(const std::string &userDevId, const std::string &dhId,
|
||||
const std::string &nodeDesc) override;
|
||||
int32_t RegisterSimulationEventListener(sptr<ISimulationEventListener> listener) override;
|
||||
int32_t UnregisterSimulationEventListener(sptr<ISimulationEventListener> listener) override;
|
||||
virtual int32_t RegisterSimulationEventListener(sptr<ISimulationEventListener> listener) override;
|
||||
virtual int32_t UnregisterSimulationEventListener(sptr<ISimulationEventListener> listener) override;
|
||||
bool CheckRegisterParam(const std::string &devId, const std::string &dhId,
|
||||
const std::string ¶meters, sptr<IRegisterDInputCallback> callback);
|
||||
bool CheckUnregisterParam(const std::string &devId, const std::string &dhId,
|
||||
@@ -186,37 +186,35 @@ public:
|
||||
|
||||
class DInputSourceListener : public DInputSourceTransCallback {
|
||||
public:
|
||||
explicit DInputSourceListener(DistributedInputSourceManager *manager);
|
||||
DInputSourceListener(DistributedInputSourceManager *manager);
|
||||
virtual ~DInputSourceListener();
|
||||
void OnResponseRegisterDistributedHardware(const std::string deviceId, const std::string dhId,
|
||||
bool result) override;
|
||||
void OnResponsePrepareRemoteInput(const std::string deviceId, bool result) override;
|
||||
void OnResponseUnprepareRemoteInput(const std::string deviceId, bool result) override;
|
||||
void OnResponseStartRemoteInput(const std::string deviceId, const uint32_t inputTypes, bool result,
|
||||
const std::string &object) 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,
|
||||
const std::string &object) 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) override;
|
||||
void OnResponseRelayUnprepareRemoteInput(int32_t sessionId, const std::string &deviceId, bool result) override;
|
||||
void OnResponseRelayStartDhidRemoteInput(const std::string &deviceId, const std::string &object) override;
|
||||
void OnResponseRelayStartTypeRemoteInput(const std::string &deviceId, const std::string &object) override;
|
||||
void onResponseRegisterDistributedHardware(const std::string deviceId, const std::string dhId, bool result);
|
||||
void onResponsePrepareRemoteInput(const std::string deviceId, bool result);
|
||||
void onResponseUnprepareRemoteInput(const std::string deviceId, bool result);
|
||||
void onResponseStartRemoteInput(const std::string deviceId, const uint32_t inputTypes, bool result,
|
||||
const std::string &object);
|
||||
void onResponseStopRemoteInput(const std::string deviceId, const uint32_t inputTypes, bool result);
|
||||
void onResponseStartRemoteInputDhid(const std::string deviceId, const std::string &dhids, bool result,
|
||||
const std::string &object);
|
||||
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);
|
||||
void onResponseRelayUnprepareRemoteInput(int32_t sessionId, const std::string &deviceId, bool result);
|
||||
void onResponseRelayStartDhidRemoteInput(const std::string &deviceId, const std::string &object);
|
||||
void onResponseRelayStartTypeRemoteInput(const std::string &deviceId, const std::string &object);
|
||||
|
||||
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 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 RecordEventLog(int64_t when, int32_t type, int32_t code, int32_t value, const std::string& path);
|
||||
|
||||
private:
|
||||
@@ -227,7 +225,7 @@ public:
|
||||
public:
|
||||
DInputSourceManagerEventHandler(const std::shared_ptr<AppExecFwk::EventRunner> &runner,
|
||||
DistributedInputSourceManager *manager);
|
||||
~DInputSourceManagerEventHandler() override;
|
||||
~DInputSourceManagerEventHandler();
|
||||
|
||||
void ProcessEvent(const AppExecFwk::InnerEvent::Pointer &event) override;
|
||||
private:
|
||||
@@ -259,7 +257,7 @@ public:
|
||||
class StartDScreenListener : public PublisherListenerStub {
|
||||
public:
|
||||
StartDScreenListener();
|
||||
~StartDScreenListener() override;
|
||||
~StartDScreenListener();
|
||||
void OnMessage(const DHTopic topic, const std::string& message) override;
|
||||
|
||||
private:
|
||||
@@ -270,7 +268,7 @@ public:
|
||||
class StopDScreenListener : public PublisherListenerStub {
|
||||
public:
|
||||
StopDScreenListener();
|
||||
~StopDScreenListener() override;
|
||||
~StopDScreenListener();
|
||||
void OnMessage(const DHTopic topic, const std::string& message) override;
|
||||
|
||||
private:
|
||||
@@ -279,10 +277,11 @@ public:
|
||||
|
||||
class DeviceOfflineListener : public PublisherListenerStub {
|
||||
public:
|
||||
explicit DeviceOfflineListener(DistributedInputSourceManager* srcManagerContext);
|
||||
~DeviceOfflineListener() override;
|
||||
DeviceOfflineListener(DistributedInputSourceManager* srcManagerContext);
|
||||
|
||||
void OnMessage(const DHTopic topic, const std::string& message) override;
|
||||
~DeviceOfflineListener();
|
||||
|
||||
void OnMessage(const DHTopic topic, const std::string& message);
|
||||
|
||||
private:
|
||||
void DeleteNodeInfoAndNotify(const std::string& offlineDevId);
|
||||
@@ -294,7 +293,7 @@ public:
|
||||
class DScreenSourceSvrRecipient : public IRemoteObject::DeathRecipient {
|
||||
public:
|
||||
DScreenSourceSvrRecipient(const std::string& srcDevId, const std::string& sinkDevId, const uint64_t srcWinId);
|
||||
~DScreenSourceSvrRecipient() override;
|
||||
~DScreenSourceSvrRecipient();
|
||||
void OnRemoteDied(const wptr<IRemoteObject> &remote) override;
|
||||
|
||||
private:
|
||||
|
||||
@@ -44,7 +44,7 @@ private:
|
||||
};
|
||||
sptr<RemoteCliDeathRecipient> remoteCliDeathRcv;
|
||||
sptr<IDistributedSourceInput> GetRemoteCliFromCache(const std::string &devId);
|
||||
void AddRemoteCli(const std::string &devId, sptr<IRemoteObject> remote);
|
||||
void AddRemoteCli(const std::string &devId, sptr<IRemoteObject> object);
|
||||
void DeleteRemoteCli(const std::string &devId);
|
||||
void DeleteRemoteCli(const sptr<IRemoteObject> object);
|
||||
void ProcRemoteCliDied(const sptr<IRemoteObject>& remote);
|
||||
|
||||
@@ -76,19 +76,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;
|
||||
}
|
||||
|
||||
@@ -104,20 +104,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)
|
||||
{
|
||||
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);
|
||||
DHLOGE("OnResponsePrepareRemoteInput GetCallbackEventHandler is null.");
|
||||
DHLOGE("onResponsePrepareRemoteInput GetCallbackEventHandler is null.");
|
||||
return;
|
||||
}
|
||||
std::shared_ptr<nlohmann::json> jsonArrayMsg = std::make_shared<nlohmann::json>();
|
||||
@@ -130,20 +130,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>();
|
||||
@@ -157,12 +157,12 @@ 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)
|
||||
{
|
||||
DHLOGI("OnResponseRelayPrepareRemoteInput deviceId: %s, result: %d.", GetAnonyString(deviceId).c_str(), result);
|
||||
DHLOGI("onResponseRelayPrepareRemoteInput deviceId: %s, result: %d.", GetAnonyString(deviceId).c_str(), result);
|
||||
if (sourceManagerObj_ == nullptr) {
|
||||
DHLOGE("OnResponseRelayPrepareRemoteInput sourceManagerObj is null.");
|
||||
DHLOGE("onResponseRelayPrepareRemoteInput sourceManagerObj is null.");
|
||||
return;
|
||||
}
|
||||
if (sourceManagerObj_->GetCallbackEventHandler() == nullptr) {
|
||||
@@ -180,12 +180,12 @@ 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("OnResponseRelayUnprepareRemoteInput deviceId: %s, result: %d.", GetAnonyString(deviceId).c_str(), result);
|
||||
DHLOGI("onResponseRelayUnprepareRemoteInput deviceId: %s, result: %d.", GetAnonyString(deviceId).c_str(), result);
|
||||
if (sourceManagerObj_ == nullptr) {
|
||||
DHLOGE("OnResponseRelayUnprepareRemoteInput sourceManagerObj is null.");
|
||||
DHLOGE("onResponseRelayUnprepareRemoteInput sourceManagerObj is null.");
|
||||
return;
|
||||
}
|
||||
if (sourceManagerObj_->GetCallbackEventHandler() == nullptr) {
|
||||
@@ -203,7 +203,7 @@ void DistributedInputSourceManager::DInputSourceListener::OnResponseRelayUnprepa
|
||||
sourceManagerObj_->GetCallbackEventHandler()->SendEvent(msgEvent, 0, AppExecFwk::EventQueue::Priority::IMMEDIATE);
|
||||
}
|
||||
|
||||
void DistributedInputSourceManager::DInputSourceListener::OnResponseRelayStartDhidRemoteInput(
|
||||
void DistributedInputSourceManager::DInputSourceListener::onResponseRelayStartDhidRemoteInput(
|
||||
const std::string &deviceId, const std::string &object)
|
||||
{
|
||||
DHLOGI("Device whitelist object: %s", object.c_str());
|
||||
@@ -214,7 +214,7 @@ void DistributedInputSourceManager::DInputSourceListener::OnResponseRelayStartDh
|
||||
sourceManagerObj_->RunWhiteListCallback(deviceId, object);
|
||||
}
|
||||
|
||||
void DistributedInputSourceManager::DInputSourceListener::OnResponseRelayStartTypeRemoteInput(
|
||||
void DistributedInputSourceManager::DInputSourceListener::onResponseRelayStartTypeRemoteInput(
|
||||
const std::string &deviceId, const std::string &object)
|
||||
{
|
||||
DHLOGI("Device whitelist object: %s", object.c_str());
|
||||
@@ -225,20 +225,20 @@ void DistributedInputSourceManager::DInputSourceListener::OnResponseRelayStartTy
|
||||
sourceManagerObj_->RunWhiteListCallback(deviceId, object);
|
||||
}
|
||||
|
||||
void DistributedInputSourceManager::DInputSourceListener::OnResponseStartRemoteInput(
|
||||
void DistributedInputSourceManager::DInputSourceListener::onResponseStartRemoteInput(
|
||||
const std::string deviceId, const uint32_t inputTypes, bool result, const std::string &object)
|
||||
{
|
||||
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, object);
|
||||
DHLOGE("OnResponseStartRemoteInput GetCallbackEventHandler is null.");
|
||||
DHLOGE("onResponseStartRemoteInput GetCallbackEventHandler is null.");
|
||||
return;
|
||||
}
|
||||
if (result) {
|
||||
@@ -257,18 +257,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;
|
||||
@@ -285,18 +285,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, const std::string &object)
|
||||
{
|
||||
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, object);
|
||||
return;
|
||||
@@ -317,18 +317,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;
|
||||
@@ -344,7 +344,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(),
|
||||
@@ -371,7 +371,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);
|
||||
@@ -380,7 +380,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];
|
||||
@@ -400,7 +400,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());
|
||||
@@ -423,7 +423,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());
|
||||
@@ -446,7 +446,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());
|
||||
@@ -470,7 +470,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());
|
||||
@@ -494,7 +494,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());
|
||||
@@ -518,7 +518,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());
|
||||
@@ -2560,7 +2560,7 @@ DInputServerType DistributedInputSourceManager::GetStartTransFlag()
|
||||
|
||||
void DistributedInputSourceManager::SetStartTransFlag(const DInputServerType flag)
|
||||
{
|
||||
DHLOGI("Set Source isStartTrans_ %d", static_cast<int32_t>(flag));
|
||||
DHLOGI("Set Source isStartTrans_ %d", (int32_t)flag);
|
||||
isStartTrans_ = flag;
|
||||
}
|
||||
|
||||
@@ -2791,7 +2791,7 @@ int32_t DistributedInputSourceManager::StartDScreenListener::UpdateSrcScreenInfo
|
||||
DHLOGE("virtualScreenFd is invalid");
|
||||
return ERR_DH_INPUT_SERVER_SOURCE_VIRTUAL_SCREEN_NODE_IS_INVALID;
|
||||
}
|
||||
srcScreenInfo.sourcePhyFd = static_cast<uint32_t>(virtualScreenFd);
|
||||
srcScreenInfo.sourcePhyFd = (uint32_t)virtualScreenFd;
|
||||
srcScreenInfo.sourcePhyWidth = TmpInfo.sourceWinWidth;
|
||||
srcScreenInfo.sourcePhyHeight = TmpInfo.sourceWinHeight;
|
||||
DHLOGI("StartDScreenListener UpdateSrcScreenInfo the data: devId: %s, sourceWinId: %d, sourceWinWidth: %d,"
|
||||
|
||||
@@ -806,7 +806,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]);
|
||||
}
|
||||
|
||||
void DistributedInputSourceTransport::NotifyResponseUnprepareRemoteInput(int32_t sessionId,
|
||||
@@ -822,7 +822,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(deviceId);
|
||||
}
|
||||
|
||||
@@ -839,7 +839,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],
|
||||
recMsg[DINPUT_SOFTBUS_KEY_WHITE_LIST]);
|
||||
}
|
||||
@@ -856,7 +856,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]);
|
||||
}
|
||||
|
||||
@@ -874,7 +874,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],
|
||||
recMsg[DINPUT_SOFTBUS_KEY_WHITE_LIST]);
|
||||
}
|
||||
@@ -891,7 +891,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]);
|
||||
}
|
||||
|
||||
@@ -903,7 +903,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]);
|
||||
}
|
||||
@@ -922,7 +922,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::ReceiveSrcTSrcRelayPrepare(int32_t sessionId, const nlohmann::json &recMsg)
|
||||
@@ -937,13 +937,13 @@ void DistributedInputSourceTransport::ReceiveSrcTSrcRelayPrepare(int32_t session
|
||||
|
||||
int32_t ret = OpenInputSoftbus(peerDevId);
|
||||
if (ret != DH_SUCCESS) {
|
||||
callback_->OnResponseRelayPrepareRemoteInput(sessionId, peerDevId, false);
|
||||
callback_->onResponseRelayPrepareRemoteInput(sessionId, peerDevId, false);
|
||||
return;
|
||||
}
|
||||
|
||||
ret = PrepareRemoteInput(sessionId, peerDevId);
|
||||
if (ret != DH_SUCCESS) {
|
||||
callback_->OnResponseRelayPrepareRemoteInput(sessionId, peerDevId, false);
|
||||
callback_->onResponseRelayPrepareRemoteInput(sessionId, peerDevId, false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -960,7 +960,7 @@ void DistributedInputSourceTransport::ReceiveSrcTSrcRelayUnprepare(int32_t sessi
|
||||
int32_t ret = UnprepareRemoteInput(sessionId, peerDevId);
|
||||
if (ret != DH_SUCCESS) {
|
||||
DHLOGE("Can not send message by softbus, unprepare fail.");
|
||||
callback_->OnResponseRelayUnprepareRemoteInput(sessionId, peerDevId, false);
|
||||
callback_->onResponseRelayUnprepareRemoteInput(sessionId, peerDevId, false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -979,7 +979,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]);
|
||||
}
|
||||
|
||||
@@ -997,7 +997,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]);
|
||||
|
||||
int32_t toSrcSessionId = recMsg[DINPUT_SOFTBUS_KEY_SESSION_ID];
|
||||
@@ -1020,7 +1020,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)
|
||||
@@ -1036,7 +1036,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(srcId);
|
||||
}
|
||||
|
||||
@@ -1112,7 +1112,7 @@ void DistributedInputSourceTransport::NotifyResponseRelayStartDhidRemoteInput(in
|
||||
std::string dhids = recMsg[DINPUT_SOFTBUS_KEY_VECTOR_DHID];
|
||||
NotifyOriginStartDhidResult(srcTsrcSeId, localNetworkId, sinkDevId,
|
||||
result ? DH_SUCCESS : ERR_DH_INPUT_SERVER_SOURCE_MANAGER_START_MSG_IS_BAD, dhids);
|
||||
callback_->OnResponseRelayStartDhidRemoteInput(sinkDevId, recMsg[DINPUT_SOFTBUS_KEY_WHITE_LIST]);
|
||||
callback_->onResponseRelayStartDhidRemoteInput(sinkDevId, recMsg[DINPUT_SOFTBUS_KEY_WHITE_LIST]);
|
||||
}
|
||||
|
||||
void DistributedInputSourceTransport::NotifyResponseRelayStopDhidRemoteInput(int32_t sessionId,
|
||||
@@ -1157,7 +1157,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)
|
||||
@@ -1175,7 +1175,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)
|
||||
@@ -1250,7 +1250,7 @@ void DistributedInputSourceTransport::NotifyResponseRelayStartTypeRemoteInput(in
|
||||
uint32_t inputTypes = recMsg[DINPUT_SOFTBUS_KEY_INPUT_TYPE];
|
||||
NotifyOriginStartTypeResult(srcTsrcSeId, localNetworkId, sinkDevId,
|
||||
result ? DH_SUCCESS : ERR_DH_INPUT_SERVER_SOURCE_MANAGER_START_MSG_IS_BAD, inputTypes);
|
||||
callback_->OnResponseRelayStartTypeRemoteInput(sinkDevId, recMsg[DINPUT_SOFTBUS_KEY_WHITE_LIST]);
|
||||
callback_->onResponseRelayStartTypeRemoteInput(sinkDevId, recMsg[DINPUT_SOFTBUS_KEY_WHITE_LIST]);
|
||||
}
|
||||
|
||||
void DistributedInputSourceTransport::NotifyResponseRelayStopTypeRemoteInput(int32_t sessionId,
|
||||
@@ -1295,7 +1295,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)
|
||||
@@ -1313,7 +1313,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::DInputTransbaseSourceListener::HandleSessionData(int32_t sessionId,
|
||||
|
||||
@@ -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& params) override;
|
||||
int32_t SubscribeLocalHardware(const std::string& dhId, const std::string& parameters) override;
|
||||
int32_t UnsubscribeLocalHardware(const std::string& dhId) override;
|
||||
void FinishStartSA(const std::string ¶ms, const sptr<IRemoteObject> &remoteObject);
|
||||
|
||||
|
||||
@@ -135,24 +135,24 @@ int32_t DInputContext::CalculateTransformInfo(SinkScreenInfo &sinkScreenInfo)
|
||||
return ERR_DH_INPUT_CONTEXT_CALCULATE_FAIL;
|
||||
}
|
||||
TransformInfo transformInfo;
|
||||
transformInfo.sinkWinPhyX = static_cast<uint32_t>(sinkScreenInfo.sinkWinShowX /
|
||||
static_cast<double>(sinkScreenInfo.sinkShowWidth)) * sinkScreenInfo.sinkPhyWidth;
|
||||
transformInfo.sinkWinPhyY = static_cast<uint32_t>(sinkScreenInfo.sinkWinShowY /
|
||||
static_cast<double>(sinkScreenInfo.sinkShowHeight)) * sinkScreenInfo.sinkPhyHeight;
|
||||
transformInfo.sinkProjPhyWidth = static_cast<uint32_t>((sinkScreenInfo.sinkProjShowWidth /
|
||||
static_cast<double>(sinkScreenInfo.sinkShowWidth)) * sinkScreenInfo.sinkPhyWidth);
|
||||
transformInfo.sinkProjPhyHeight = static_cast<uint32_t>((sinkScreenInfo.sinkProjShowHeight /
|
||||
static_cast<double>(sinkScreenInfo.sinkShowHeight)) * sinkScreenInfo.sinkPhyHeight);
|
||||
transformInfo.sinkWinPhyX = (uint32_t)(sinkScreenInfo.sinkWinShowX / (double)(sinkScreenInfo.sinkShowWidth)) *
|
||||
sinkScreenInfo.sinkPhyWidth;
|
||||
transformInfo.sinkWinPhyY = (uint32_t)(sinkScreenInfo.sinkWinShowY / (double)(sinkScreenInfo.sinkShowHeight)) *
|
||||
sinkScreenInfo.sinkPhyHeight;
|
||||
transformInfo.sinkProjPhyWidth = (uint32_t)((sinkScreenInfo.sinkProjShowWidth /
|
||||
(double)sinkScreenInfo.sinkShowWidth) * sinkScreenInfo.sinkPhyWidth);
|
||||
transformInfo.sinkProjPhyHeight = (uint32_t)((sinkScreenInfo.sinkProjShowHeight /
|
||||
(double)sinkScreenInfo.sinkShowHeight) * sinkScreenInfo.sinkPhyHeight);
|
||||
if (transformInfo.sinkProjPhyWidth == 0 || transformInfo.sinkProjPhyHeight == 0) {
|
||||
DHLOGE("can not calculate transform infomation");
|
||||
return ERR_DH_INPUT_CONTEXT_CALCULATE_FAIL;
|
||||
}
|
||||
|
||||
// coefficient of the sink projection area in the source touch driver
|
||||
transformInfo.coeffWidth = static_cast<double>(sinkScreenInfo.srcScreenInfo.sourcePhyWidth /
|
||||
static_cast<double>(transformInfo.sinkProjPhyWidth));
|
||||
transformInfo.coeffHeight = static_cast<double>(sinkScreenInfo.srcScreenInfo.sourcePhyHeight /
|
||||
static_cast<double>(transformInfo.sinkProjPhyHeight));
|
||||
transformInfo.coeffWidth = (double)(sinkScreenInfo.srcScreenInfo.sourcePhyWidth /
|
||||
(double)(transformInfo.sinkProjPhyWidth));
|
||||
transformInfo.coeffHeight = (double)(sinkScreenInfo.srcScreenInfo.sourcePhyHeight /
|
||||
(double)(transformInfo.sinkProjPhyHeight));
|
||||
|
||||
DHLOGI("CalculateTransformInfo sinkWinPhyX = %d, sinkWinPhyY = %d, sinkProjPhyWidth = %d, " +
|
||||
"sinkProjPhyHeight = %d, coeffWidth = %f, coeffHeight = %f", transformInfo.sinkWinPhyX,
|
||||
|
||||
Reference in New Issue
Block a user