mirror of
https://github.com/openharmony/distributedhardware_distributed_input.git
synced 2026-07-20 01:53:34 -04:00
Description:fix codex
Match-id-6a4a8fa72f542d1c27642dc7fee6fcf30e7d46dc
This commit is contained in:
@@ -176,7 +176,8 @@ namespace DistributedInput {
|
||||
* Input device Info retrieved from the kernel.
|
||||
*/
|
||||
struct InputDevice {
|
||||
inline InputDevice() : bus(0), vendor(0), product(0), version(0) {}
|
||||
inline InputDevice() : name(""), location(""), uniqueId(""), bus(0), vendor(0), product(0),
|
||||
version(0), descriptor(""), nonce(0), classes(0) {}
|
||||
std::string name;
|
||||
std::string location;
|
||||
std::string uniqueId;
|
||||
|
||||
@@ -44,7 +44,7 @@ const uint32_t ERROR_MSG_MAX_LEN = 256;
|
||||
|
||||
InputHub::InputHub() : epollFd_(0), iNotifyFd_(0), inputWd_(0), needToScanDevices_(true), nextDeviceId_(1),
|
||||
mPendingEventItems{0x00}, pendingEventCount_(0), pendingEventIndex_(0), pendingINotify_(false),
|
||||
deviceChanged_(false), isStartCollectEvent_(false), isStartCollectHandler_(false)
|
||||
deviceChanged_(false), inputTypes_(0), isStartCollectEvent_(false), isStartCollectHandler_(false)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
@@ -699,7 +699,7 @@ int32_t InputHub::ReadNotifyLocked()
|
||||
struct inotify_event *event;
|
||||
|
||||
DHLOGI("readNotify nfd: %d\n", iNotifyFd_);
|
||||
res = read(iNotifyFd_, event_buf, sizeof(event_buf));
|
||||
res = (size_t)read(iNotifyFd_, event_buf, sizeof(event_buf));
|
||||
if (res < sizeof(*event)) {
|
||||
if (errno == EINTR)
|
||||
return DH_SUCCESS;
|
||||
|
||||
@@ -61,7 +61,7 @@ private:
|
||||
|
||||
// The event queue.
|
||||
static const int INPUT_DEVICR_BUFFER_SIZE = 32;
|
||||
InputDeviceEvent mEventBuffer[INPUT_DEVICR_BUFFER_SIZE];
|
||||
InputDeviceEvent mEventBuffer[INPUT_DEVICR_BUFFER_SIZE] = {};
|
||||
std::mutex operationMutex_;
|
||||
std::unique_ptr<InputHub> inputHub_;
|
||||
};
|
||||
|
||||
@@ -169,7 +169,7 @@ public:
|
||||
bool GetDeviceMapAllDevSwitchOff();
|
||||
int32_t RemoveInputNode(const std::string& devId, const std::string& dhId);
|
||||
int32_t DeleteDevice(const std::string& devId, const std::string& dhId);
|
||||
void SetInputTypesMap(const std::string deviceId, int32_t value);
|
||||
void SetInputTypesMap(const std::string deviceId, uint32_t value);
|
||||
uint32_t GetInputTypesMap(const std::string deviceId);
|
||||
uint32_t GetAllInputTypesMap();
|
||||
|
||||
|
||||
@@ -203,7 +203,7 @@ void DistributedInputSourceManager::DInputSourceListener::onReceivedEventRemoteI
|
||||
const std::string deviceId, const std::string &event)
|
||||
{
|
||||
nlohmann::json inputData = nlohmann::json::parse(event);
|
||||
int jsonSize = inputData.size();
|
||||
size_t jsonSize = inputData.size();
|
||||
DHLOGI("onReceivedEventRemoteInput called, deviceId: %s, json size:%d.",
|
||||
GetAnonyString(deviceId).c_str(), jsonSize);
|
||||
|
||||
@@ -1048,7 +1048,7 @@ uint32_t DistributedInputSourceManager::GetAllInputTypesMap()
|
||||
return rInputTypes;
|
||||
}
|
||||
|
||||
void DistributedInputSourceManager::SetInputTypesMap(const std::string deviceId, int32_t value)
|
||||
void DistributedInputSourceManager::SetInputTypesMap(const std::string deviceId, uint32_t value)
|
||||
{
|
||||
if (value == INPUT_TYPE_NULL) {
|
||||
std::map<std::string, uint32_t>::iterator key = InputTypesMap_.find(deviceId);
|
||||
|
||||
Reference in New Issue
Block a user