mirror of
https://github.com/openharmony/distributedhardware_distributed_input.git
synced 2026-07-20 21:41:02 -04:00
Description:reviewbot
Match-id-c5bb6f6e6d3b7d1b477eb9a68e4934ea711ba0c4
This commit is contained in:
+2
-4
@@ -29,9 +29,6 @@
|
||||
|
||||
namespace OHOS {
|
||||
namespace DistributedHardware {
|
||||
namespace {
|
||||
const uint32_t SLEEP_TIME_US = 100 * 1000;
|
||||
}
|
||||
void OpenInputSoftbusFuzzTest(const uint8_t* data, size_t size)
|
||||
{
|
||||
if ((data == nullptr) || (size <= 0)) {
|
||||
@@ -40,7 +37,8 @@ void OpenInputSoftbusFuzzTest(const uint8_t* data, size_t size)
|
||||
|
||||
std::string remoteDevId(reinterpret_cast<const char*>(data), size);
|
||||
|
||||
usleep(SLEEP_TIME_US);
|
||||
const uint32_t sleepTimeUs = 100 * 1000;
|
||||
usleep(sleepTimeUs);
|
||||
DistributedInput::DistributedInputSourceTransport::GetInstance().OpenInputSoftbus(remoteDevId);
|
||||
DistributedInput::DistributedInputSourceTransport::GetInstance().CloseInputSoftbus(remoteDevId);
|
||||
}
|
||||
|
||||
@@ -33,7 +33,6 @@ namespace OHOS {
|
||||
namespace DistributedHardware {
|
||||
namespace DistributedInput {
|
||||
namespace {
|
||||
constexpr int32_t US_ONE_SECOND = 1000 * 1000;
|
||||
const char *const DESCRIPTOR = "descriptor";
|
||||
}
|
||||
|
||||
@@ -64,9 +63,10 @@ std::string GetLocalNetworkId()
|
||||
|
||||
uint64_t GetCurrentTime()
|
||||
{
|
||||
constexpr int32_t usOneSecond = 1000 * 1000;
|
||||
struct timeval tv;
|
||||
gettimeofday(&tv, nullptr);
|
||||
return tv.tv_sec * US_ONE_SECOND + tv.tv_usec;
|
||||
return tv.tv_sec * usOneSecond + tv.tv_usec;
|
||||
}
|
||||
|
||||
std::string SetAnonyId(const std::string &message)
|
||||
|
||||
Reference in New Issue
Block a user