Description:codex

Match-id-a8953a2fae193835b06fa3e731a53cba652e10f5
This commit is contained in:
xxxx
2022-08-10 10:20:36 +08:00
parent d1bd2444b3
commit 4fa62540c0
4 changed files with 14 additions and 14 deletions
+6 -6
View File
@@ -613,14 +613,14 @@ int32_t InputHub::QueryLocalTouchScreenInfo(int fd)
info.localAbsInfo.absXMax = absInfo.maximum;
info.localAbsInfo.absMtPositionXMin = absInfo.minimum;
info.localAbsInfo.absMtPositionXMax = absInfo.maximum;
info.sinkPhyWidth = 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 = absInfo.maximum + 1;
info.sinkPhyHeight = (uint32_t)(absInfo.maximum + 1);
ioctl(fd, EVIOCGABS(ABS_PRESSURE), &absInfo);
info.localAbsInfo.absPressureMin = absInfo.minimum;
@@ -1009,12 +1009,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_MT_POSITION_X) {
absX = iev.value;
absXIndex = j;
absX = (uint32_t)iev.value;
absXIndex = (int32_t)j;
}
if (iev.code == ABS_MT_POSITION_Y) {
absY = iev.value;
absYIndex = j;
absY = (uint32_t)iev.value;
absYIndex = (int32_t)j;
}
}
@@ -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] = 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] = phyHeight;
dev_.absmax[ABS_Y] = (int32_t)phyHeight;
dev_.absfuzz[ABS_Y] = 0;
dev_.absflat[ABS_Y] = 0;
@@ -70,12 +70,12 @@ VirtualTouchScreen::VirtualTouchScreen(const InputDevice& event, LocalAbsInfo& a
dev_.absflat[ABS_MT_ORIENTATION] = 0;
dev_.absmin[ABS_MT_POSITION_X] = 0;
dev_.absmax[ABS_MT_POSITION_X] = phyWidth;
dev_.absmax[ABS_MT_POSITION_X] = (int32_t)phyWidth;
dev_.absfuzz[ABS_MT_POSITION_X] = 0;
dev_.absflat[ABS_MT_POSITION_X] = 0;
dev_.absmin[ABS_MT_POSITION_Y] = 0;
dev_.absmax[ABS_MT_POSITION_Y] = phyHeight;
dev_.absmax[ABS_MT_POSITION_Y] = (int32_t)phyHeight;
dev_.absfuzz[ABS_MT_POSITION_Y] = 0;
dev_.absflat[ABS_MT_POSITION_Y] = 0;
@@ -375,8 +375,8 @@ void DistributedInputSourceTransport::StartLatencyCount(const std::string& devic
while (isLatencyThreadRunning_.load()) {
if (sendNum_ >= INPUT_LATENCY_DELAY_TIMES) {
uint64_t latency = (uint64_t)(deltaTimeAll_ / 2 / INPUT_LATENCY_DELAY_TIMES);
DHLOGI("LatencyCount average single-channel latency is %d, send times is %d, recive times is %d,\
each RTT latency details is %s", latency, sendNum_, recvNum_, eachLatencyDetails_.c_str());
DHLOGI("LatencyCount average single-channel latency is %d, send times is %d, recive times is %d, " +
"each RTT latency details is %s", latency, sendNum_, recvNum_, eachLatencyDetails_.c_str());
deltaTimeAll_ = 0;
sendNum_ = 0;
recvNum_ = 0;
+2 -2
View File
@@ -26,7 +26,7 @@ namespace OHOS {
namespace DistributedHardware {
namespace DistributedInput {
namespace {
constexpr int32_t MS_ONE_SECOND = 1000;
constexpr int32_t US_ONE_SECOND = 1000 * 1000;
const char *const DESCRIPTOR = "descriptor";
}
@@ -51,7 +51,7 @@ uint64_t GetCurrentTime()
{
struct timeval tv;
gettimeofday(&tv, nullptr);
return tv.tv_sec * MS_ONE_SECOND + tv.tv_usec / MS_ONE_SECOND;
return tv.tv_sec * US_ONE_SECOND + tv.tv_usec;
}
std::string SetAnonyId(const std::string &message)