Description:fix codex

Match-id-b3fc75f33a03b426e2f4cd129ddf9adc722bd5b8
This commit is contained in:
xxxx
2022-06-14 14:36:31 +08:00
parent 64b7f7877f
commit ab441f0cb7
7 changed files with 18 additions and 13 deletions
+5 -5
View File
@@ -66,22 +66,22 @@ namespace DistributedInput {
/**
* Input Type NULL.
*/
constexpr int32_t INPUT_TYPE_NULL = 0;
constexpr uint32_t INPUT_TYPE_NULL = 0;
/**
* Input Type MOUSE.
*/
constexpr int32_t INPUT_TYPE_MOUSE = 1;
constexpr uint32_t INPUT_TYPE_MOUSE = 1;
/**
* Input Type KEYBOARD.
*/
constexpr int32_t INPUT_TYPE_KEYBOARD = 2;
constexpr uint32_t INPUT_TYPE_KEYBOARD = 2;
/**
* Input Type TOUCH.
*/
constexpr int32_t INPUT_TYPE_TOUCH = 4;
constexpr uint32_t INPUT_TYPE_TOUCH = 4;
/**
* Maximum number of signalled FDs to handle at a time.
@@ -91,7 +91,7 @@ namespace DistributedInput {
/**
* Input Type ALL.
*/
constexpr int32_t INPUT_TYPE_ALL = INPUT_TYPE_MOUSE | INPUT_TYPE_KEYBOARD | INPUT_TYPE_TOUCH;
constexpr uint32_t INPUT_TYPE_ALL = INPUT_TYPE_MOUSE | INPUT_TYPE_KEYBOARD | INPUT_TYPE_TOUCH;
constexpr int32_t INPUT_LOADSA_TIMEOUT_MS = 10000;
+7 -2
View File
@@ -659,7 +659,7 @@ int32_t InputHub::ReadNotifyLocked()
{
int res;
char event_buf[512];
int event_size;
unsigned int event_size;
int event_pos = 0;
struct inotify_event *event;
@@ -849,7 +849,12 @@ void InputHub::Device::Close()
int32_t InputHub::Device::Enable()
{
chmod(path.c_str(), S_IWRITE | S_IREAD);
char pathCheck[PATH_MAX + 1] = {0x00};
if (std::strlen(path.c_str()) > PATH_MAX || realpath(path.c_str(), pathCheck) == NULL) {
DHLOGE("path check fail\n");
return ERR_DH_INPUT_HUB_DEVICE_ENABLE_FAIL;
}
fd = open(path.c_str(), O_RDWR | O_CLOEXEC | O_NONBLOCK);
if (fd < 0) {
DHLOGE("could not open %s, %s\n", path.c_str(), strerror(errno));
@@ -170,7 +170,7 @@ void DistributedInputHandler::StartInputMonitorDeviceThread(const std::string de
size_t count = inputHub_->CollectInputHandler(mEventBuffer, INPUT_DEVICR_BUFFER_SIZE);
if (count > 0) {
DHLOGI("Count: %zu", count);
for (int iCnt = 0; iCnt < count; iCnt++) {
for (size_t iCnt = 0; iCnt < count; iCnt++) {
NotifyHardWare(iCnt);
}
} else {
@@ -77,7 +77,7 @@ public:
void SetInitWhiteListFlag(bool isInit);
int32_t GetInputTypes();
uint32_t GetInputTypes();
void SetInputTypes(const uint32_t& inputTypess);
@@ -98,7 +98,7 @@ private:
std::shared_ptr<AppExecFwk::EventRunner> runner_;
std::shared_ptr<DistributedInputSinkEventHandler> handler_;
bool InitAuto();
int32_t inputTypes_;
uint32_t inputTypes_;
};
} // namespace DistributedInput
} // namespace DistributedHardware
@@ -343,7 +343,7 @@ void DistributedInputSinkManager::SetInitWhiteListFlag(bool isInit)
isAlreadyInitWhiteList_ = isInit;
}
int32_t DistributedInputSinkManager::GetInputTypes()
uint32_t DistributedInputSinkManager::GetInputTypes()
{
return inputTypes_;
}
@@ -242,7 +242,7 @@ int32_t DistributedInputSinkTransport::SendMessage(int32_t sessionId, std::strin
free(buf);
return ERR_DH_INPUT_SERVER_SINK_TRANSPORT_SENDMESSAGE_FAIL;
}
outLen = message.size();
outLen = (int32_t)(message.size());
int32_t ret = SendBytes(sessionId, buf, outLen);
free(buf);
return ret;
@@ -1040,7 +1040,7 @@ int32_t DistributedInputSourceManager::GetInputTypesMap(const std::string device
int32_t DistributedInputSourceManager::GetAllInputTypesMap()
{
int32_t rInputTypes = INPUT_TYPE_NULL;
uint32_t rInputTypes = INPUT_TYPE_NULL;
std::map<std::string, uint32_t>::iterator iter;
for (iter = InputTypesMap_.begin(); iter != InputTypesMap_.end(); iter++) {
rInputTypes |= iter->second;