diff --git a/README_zh.md b/README_zh.md
index 90f1ddd36..7c653a9b1 100644
--- a/README_zh.md
+++ b/README_zh.md
@@ -7,7 +7,7 @@
## 简介
-MSDP设备状态感知框架能够识别出目前设备的状态并传递给订阅者,整个框架是基于MSDP算法库和系统SensorHDI组件组成的,将其接收到的感知时间传递给订阅者。根据感知用途分为以下三大类:
+MSDP设备状态感知框架能够识别出目前设备的状态并传递给订阅者,整个框架是基于MSDP算法库和系统SensorHDI组件组成的,将其接收到的感知事件传递给订阅者。根据感知用途分为以下三大类:
- 绝对静止类:利用加速度、陀螺仪等传感器信息识别设备处于绝对静止状态。
- 水平/垂直姿态类:利用加速度、陀螺仪等传感器信息识别设备处于绝对静止状态。
diff --git a/frameworks/js/napi/src/devicestatus_napi.cpp b/frameworks/js/napi/src/devicestatus_napi.cpp
index 18f1fe421..1511e1a94 100644
--- a/frameworks/js/napi/src/devicestatus_napi.cpp
+++ b/frameworks/js/napi/src/devicestatus_napi.cpp
@@ -396,7 +396,7 @@ napi_value DeviceStatusNapi::UnsubscribeDeviceStatus(napi_env env, napi_callback
UnsubscribeCallback(env, type, event);
return nullptr;
}
- FI_HILOGD("type: %{public}d, event: %{public}d", type, event);
+ FI_HILOGD("type:%{public}d, event:%{public}d", type, event);
if (IsMatchType(env, args[2], napi_function)) {
if (!g_obj->Off(type, args[2])) {
FI_HILOGE("Not ready to unsubscribe for type:%{public}d", type);
diff --git a/frameworks/native/interaction/test/unittest/src/interaction_manager_test.cpp b/frameworks/native/interaction/test/unittest/src/interaction_manager_test.cpp
index cb31f8da6..ffc15b14e 100644
--- a/frameworks/native/interaction/test/unittest/src/interaction_manager_test.cpp
+++ b/frameworks/native/interaction/test/unittest/src/interaction_manager_test.cpp
@@ -58,7 +58,7 @@ constexpr uint32_t DEFAULT_ICON_COLOR { 0xFF };
constexpr bool HAS_CANCELED_ANIMATION { true };
constexpr bool HAS_CUSTOM_ANIMATION { true };
constexpr int32_t MOVE_STEP { 10 };
-const std::string UD_KEY = "Unified data key";
+const std::string UD_KEY { "Unified data key" };
int32_t g_deviceMouseId { -1 };
int32_t g_deviceTouchId { -1 };
} // namespace
diff --git a/frameworks/native/src/devicestatus_callback_proxy.cpp b/frameworks/native/src/devicestatus_callback_proxy.cpp
index a0d80b087..5d2f27563 100644
--- a/frameworks/native/src/devicestatus_callback_proxy.cpp
+++ b/frameworks/native/src/devicestatus_callback_proxy.cpp
@@ -49,7 +49,7 @@ void DeviceStatusCallbackProxy::OnDeviceStatusChanged(const Data& devicestatusDa
int32_t ret = remote->SendRequest(static_cast(IRemoteDevStaCallback::DEVICESTATUS_CHANGE),
data, reply, option);
if (ret != RET_OK) {
- FI_HILOGE("SendRequest is failed, error code: %{public}d", ret);
+ FI_HILOGE("SendRequest is failed, error code:%{public}d", ret);
return;
}
}
diff --git a/frameworks/native/src/devicestatus_client.cpp b/frameworks/native/src/devicestatus_client.cpp
index 0ab33c9ea..87fb0a686 100644
--- a/frameworks/native/src/devicestatus_client.cpp
+++ b/frameworks/native/src/devicestatus_client.cpp
@@ -127,7 +127,7 @@ int32_t DeviceStatusClient::SubscribeCallback(Type type, ActivityEvent event, Re
int32_t DeviceStatusClient::UnsubscribeCallback(Type type, ActivityEvent event, sptr callback)
{
CALL_DEBUG_ENTER;
- FI_HILOGI("UNevent: %{public}d", event);
+ FI_HILOGI("UNevent:%{public}d", event);
typeMap_.erase(type);
FI_HILOGD("typeMap_ %{public}d", typeMap_[type]);
CHKPR(callback, RET_ERR);
@@ -249,7 +249,7 @@ int32_t DeviceStatusClient::AllocSocketPair(int32_t moduleType)
const std::string programName(GetProgramName());
int32_t ret = fusion_alloc_socket_fd(programName.c_str(), moduleType, &socketFd_, &tokenType_);
if (ret != RET_OK) {
- FI_HILOGE("Fail to connect to server via socket: %{public}d", ret);
+ FI_HILOGE("Fail to connect to server via socket:%{public}d", ret);
return RET_ERR;
}
FI_HILOGI("Connected successfully to server via socket, "
diff --git a/libs/src/datahub/sensor_data_callback.cpp b/libs/src/datahub/sensor_data_callback.cpp
index 1f7c5dc5f..0a3a5b877 100644
--- a/libs/src/datahub/sensor_data_callback.cpp
+++ b/libs/src/datahub/sensor_data_callback.cpp
@@ -149,7 +149,7 @@ static void SensorDataCallbackImpl(SensorEvent *event)
{
CALL_DEBUG_ENTER;
CHKPV(event);
- FI_HILOGI("SensorDataCallbackImpl sensorTypeId: %{public}d", event->sensorTypeId);
+ FI_HILOGI("SensorDataCallbackImpl sensorTypeId:%{public}d", event->sensorTypeId);
SENSOR_DATA_CB.PushData(event->sensorTypeId, event->data);
}
diff --git a/services/device_manager/src/device_manager.cpp b/services/device_manager/src/device_manager.cpp
index d741e3186..2a44cc278 100644
--- a/services/device_manager/src/device_manager.cpp
+++ b/services/device_manager/src/device_manager.cpp
@@ -241,7 +241,7 @@ std::shared_ptr DeviceManager::RemoveDevice(const std::string &devNode)
void DeviceManager::OnDeviceAdded(std::shared_ptr dev)
{
CHKPV(dev);
- FI_HILOGI("add device %{public}d: %{public}s", dev->GetId(), dev->GetDevPath().c_str());
+ FI_HILOGI("add device %{public}d:%{public}s", dev->GetId(), dev->GetDevPath().c_str());
FI_HILOGI(" sysPath: \"%{public}s\"", dev->GetSysPath().c_str());
FI_HILOGI(" bus: %{public}04x", dev->GetBus());
FI_HILOGI(" vendor: %{public}04x", dev->GetVendor());
diff --git a/services/interaction/coordination/src/coordination_device_manager.cpp b/services/interaction/coordination/src/coordination_device_manager.cpp
index 033ad4f22..8bbcc76be 100755
--- a/services/interaction/coordination/src/coordination_device_manager.cpp
+++ b/services/interaction/coordination/src/coordination_device_manager.cpp
@@ -28,8 +28,8 @@ namespace Msdp {
namespace DeviceStatus {
namespace {
constexpr OHOS::HiviewDFX::HiLogLabel LABEL { LOG_CORE, MSDP_DOMAIN_ID, "CoordinationDeviceManager" };
-constexpr size_t NETWORK_ID_NUMS = 3;
-constexpr size_t DESCRIPTOR_INDEX = 2;
+constexpr size_t NETWORK_ID_NUMS { 3 };
+constexpr size_t DESCRIPTOR_INDEX { 2 };
} // namespace
CoordinationDeviceManager::CoordinationDeviceManager() {}
diff --git a/services/interaction/coordination/src/coordination_sm.cpp b/services/interaction/coordination/src/coordination_sm.cpp
index 246b2dc60..25f015543 100644
--- a/services/interaction/coordination/src/coordination_sm.cpp
+++ b/services/interaction/coordination/src/coordination_sm.cpp
@@ -302,7 +302,7 @@ void CoordinationSM::StartPointerEventFilter()
int32_t POINTER_DEFAULT_PRIORITY = 220;
auto filter = std::make_shared();
uint32_t touchTags = CapabilityToTags(MMI::INPUT_DEV_CAP_POINTER);
- FI_HILOGE("Touchtags: %{public}d", static_cast(touchTags));
+ FI_HILOGE("Touchtags:%{public}d", static_cast(touchTags));
if (filterId_ >= 0) {
MMI::InputManager::GetInstance()->RemoveInputEventFilter(filterId_);
}
@@ -534,8 +534,8 @@ bool CoordinationSM::UpdateMouseLocation()
}
int32_t xPercent = displayX_ * MOUSE_ABS_LOCATION / width;
int32_t yPercent = displayY_ * MOUSE_ABS_LOCATION / height;
- FI_HILOGI("displayWidth: %{public}d, displayHeight: %{public}d, "
- "physicalX: %{public}d, physicalY: %{public}d,",
+ FI_HILOGI("displayWidth:%{public}d, displayHeight:%{public}d, "
+ "physicalX:%{public}d, physicalY:%{public}d,",
width, height, displayX_, displayY_);
mouseLocation_ = std::make_pair(xPercent, yPercent);
return true;
diff --git a/services/interaction/coordination/src/coordination_softbus_adapter.cpp b/services/interaction/coordination/src/coordination_softbus_adapter.cpp
index 2ec3d5120..cde7d8e6c 100644
--- a/services/interaction/coordination/src/coordination_softbus_adapter.cpp
+++ b/services/interaction/coordination/src/coordination_softbus_adapter.cpp
@@ -288,7 +288,7 @@ int32_t CoordinationSoftbusAdapter::StartRemoteCoordination(const std::string &l
break;
}
}
- FI_HILOGD("isPointerButtonPressed: %{public}d", isPointerButtonPressed);
+ FI_HILOGD("isPointerButtonPressed:%{public}d", isPointerButtonPressed);
cJSON *jsonStr = cJSON_CreateObject();
cJSON_AddItemToObject(jsonStr, FI_SOFTBUS_KEY_CMD_TYPE, cJSON_CreateNumber(REMOTE_COORDINATION_START));
cJSON_AddItemToObject(jsonStr, FI_SOFTBUS_KEY_LOCAL_DEVICE_ID, cJSON_CreateString(localNetworkId.c_str()));
diff --git a/services/interaction/drag/src/drag_drawing.cpp b/services/interaction/drag/src/drag_drawing.cpp
index 60fae1816..7b421d165 100644
--- a/services/interaction/drag/src/drag_drawing.cpp
+++ b/services/interaction/drag/src/drag_drawing.cpp
@@ -86,9 +86,9 @@ const std::string FORBID_ONE_DRAG_PATH { "/system/etc/device_status/drag_icon/Fo
const std::string MOUSE_DRAG_PATH { "/system/etc/device_status/drag_icon/Mouse_Drag.svg" };
const std::string MOVE_DRAG_PATH { "/system/etc/device_status/drag_icon/Move_Drag.svg" };
#ifdef __aarch64__
-const std::string DRAG_ANIMATION_EXTENSION_SO_PATH = "/system/lib64/drag_drop_ext/libdrag_drop_ext.z.so";
+const std::string DRAG_ANIMATION_EXTENSION_SO_PATH { "/system/lib64/drag_drop_ext/libdrag_drop_ext.z.so" };
#else
-const std::string DRAG_ANIMATION_EXTENSION_SO_PATH = "/system/lib/drag_drop_ext/libdrag_drop_ext.z.so";
+const std::string DRAG_ANIMATION_EXTENSION_SO_PATH { "/system/lib/drag_drop_ext/libdrag_drop.z.so" };
#endif
struct DrawingInfo {
std::atomic_bool isRunning { false };
diff --git a/services/interaction/drag/src/drag_manager.cpp b/services/interaction/drag/src/drag_manager.cpp
index b2be4809c..8b1b71ad8 100644
--- a/services/interaction/drag/src/drag_manager.cpp
+++ b/services/interaction/drag/src/drag_manager.cpp
@@ -258,7 +258,7 @@ void DragManager::OnDragUp(std::shared_ptr pointerEvent)
MMI::InputManager::GetInstance()->SetPointerVisible(true);
}
int32_t targetTid = DRAG_DATA_MGR.GetTargetTid();
- FI_HILOGD("Target window drag tid: %{public}d", targetTid);
+ FI_HILOGD("Target window drag tid:%{public}d", targetTid);
SendDragData(targetTid, dragData.udKey);
CHKPV(context_);
timerId_ = context_->GetTimerManager().AddTimer(TIMEOUT_MS, 1, [this]() {
diff --git a/tools/vdev/include/virtual_device_builder.h b/tools/vdev/include/virtual_device_builder.h
index 9917ca634..9a70f3c4f 100644
--- a/tools/vdev/include/virtual_device_builder.h
+++ b/tools/vdev/include/virtual_device_builder.h
@@ -33,8 +33,8 @@ namespace DeviceStatus {
using json = nlohmann::json;
class VirtualDeviceBuilder {
public:
- explicit VirtualDeviceBuilder(const std::string &name, uint16_t bustype, uint16_t vendor, uint16_t product);
- explicit VirtualDeviceBuilder(const std::string &name, std::shared_ptr vDev);
+ VirtualDeviceBuilder(const std::string &name, uint16_t bustype, uint16_t vendor, uint16_t product);
+ VirtualDeviceBuilder(const std::string &name, std::shared_ptr vDev);
virtual ~VirtualDeviceBuilder();
DISALLOW_COPY_AND_MOVE(VirtualDeviceBuilder);
bool SetUp();
diff --git a/tools/vdev/src/v_input_device.cpp b/tools/vdev/src/v_input_device.cpp
index d957bb384..d4652a86e 100644
--- a/tools/vdev/src/v_input_device.cpp
+++ b/tools/vdev/src/v_input_device.cpp
@@ -60,7 +60,7 @@ int32_t VInputDevice::Open()
CALL_DEBUG_ENTER;
char buf[PATH_MAX] {};
if (realpath(devPath_.c_str(), buf) == nullptr) {
- FI_HILOGE("Not real path: %{public}s", devPath_.c_str());
+ FI_HILOGE("Not real path:%{public}s", devPath_.c_str());
return RET_ERR;
}
@@ -70,7 +70,7 @@ int32_t VInputDevice::Open()
Utility::ShowFileAttributes(buf);
fd_ = open(buf, O_RDWR | O_NONBLOCK | O_CLOEXEC);
if (fd_ < 0) {
- FI_HILOGE("Unable to open device \'%{public}s\': %{public}s", buf, strerror(errno));
+ FI_HILOGE("Unable to open device \'%{public}s\':%{public}s", buf, strerror(errno));
if (nRetries-- > 0) {
std::this_thread::sleep_for(std::chrono::milliseconds(SLEEP_TIME));
FI_HILOGI("Retry opening device \'%{public}s\'", buf);
@@ -93,7 +93,7 @@ void VInputDevice::Close()
CALL_DEBUG_ENTER;
if (fd_ >= 0) {
if (close(fd_) != 0) {
- FI_HILOGE("close error: %{public}s", strerror(errno));
+ FI_HILOGE("close error:%{public}s", strerror(errno));
}
fd_ = -1;
}
@@ -131,7 +131,7 @@ int32_t VInputDevice::SendEvent(uint16_t type, uint16_t code, int32_t value)
event.input_event_usec = tv.tv_usec;
ssize_t ret = ::write(fd_, &event, sizeof(struct input_event));
if (ret < 0) {
- FI_HILOGE("Failed to send event: %{public}s", strerror(errno));
+ FI_HILOGE("Failed to send event:%{public}s", strerror(errno));
return RET_ERR;
}
return RET_OK;
@@ -144,14 +144,14 @@ void VInputDevice::QueryDeviceInfo()
int32_t rc = ioctl(fd_, EVIOCGNAME(sizeof(buffer) - 1), &buffer);
if (rc < 0) {
- FI_HILOGE("Could not get device name: %{public}s", strerror(errno));
+ FI_HILOGE("Could not get device name:%{public}s", strerror(errno));
} else {
name_.assign(buffer);
}
rc = ioctl(fd_, EVIOCGID, &inputId_);
if (rc < 0) {
- FI_HILOGE("Could not get device input id: %{public}s", strerror(errno));
+ FI_HILOGE("Could not get device input id:%{public}s", strerror(errno));
}
errno_t ret = memset_s(buffer, sizeof(buffer), 0, sizeof(buffer));
if (ret != EOK) {
@@ -160,7 +160,7 @@ void VInputDevice::QueryDeviceInfo()
}
rc = ioctl(fd_, EVIOCGPHYS(sizeof(buffer) - 1), &buffer);
if (rc < 0) {
- FI_HILOGE("Could not get location: %{public}s", strerror(errno));
+ FI_HILOGE("Could not get location:%{public}s", strerror(errno));
} else {
phys_.assign(buffer);
}
@@ -171,7 +171,7 @@ void VInputDevice::QueryDeviceInfo()
}
rc = ioctl(fd_, EVIOCGUNIQ(sizeof(buffer) - 1), &buffer);
if (rc < 0) {
- FI_HILOGE("Could not get uniq: %{public}s", strerror(errno));
+ FI_HILOGE("Could not get uniq:%{public}s", strerror(errno));
} else {
uniq_.assign(buffer);
}
diff --git a/tools/vdev/src/virtual_device_builder.cpp b/tools/vdev/src/virtual_device_builder.cpp
index 3ffcecb0e..41795837e 100644
--- a/tools/vdev/src/virtual_device_builder.cpp
+++ b/tools/vdev/src/virtual_device_builder.cpp
@@ -180,7 +180,7 @@ void VirtualDeviceBuilder::Unmount(const char *name, const char *id)
std::cout << "Mo backing process for virtual " << name << " was found." << std::endl;
EXIT:
if (closedir(procDir) != 0) {
- FI_HILOGE("closedir error: %{public}s", strerror(errno));
+ FI_HILOGE("closedir error:%{public}s", strerror(errno));
}
}
@@ -201,7 +201,7 @@ void VirtualDeviceBuilder::SetSupportedEvents()
const auto &events = setEvents.second();
for (const auto &e : events) {
if (ioctl(fd_, setEvents.first, e) < 0) {
- FI_HILOGE("Failed while setting event type: %{public}s", strerror(errno));
+ FI_HILOGE("Failed while setting event type:%{public}s", strerror(errno));
}
}
}
@@ -211,7 +211,7 @@ void VirtualDeviceBuilder::SetAbsResolution()
{
for (const auto &item : absInit_) {
if (ioctl(fd_, UI_ABS_SETUP, &item) < 0) {
- FI_HILOGE("Failed while setting abs info: %{public}s", strerror(errno));
+ FI_HILOGE("Failed while setting abs info:%{public}s", strerror(errno));
}
}
}
@@ -238,14 +238,14 @@ void VirtualDeviceBuilder::SetPhys()
}
if (ioctl(fd_, UI_SET_PHYS, phys.c_str()) < 0) {
- FI_HILOGE("Failed while setting phys: %{public}s", strerror(errno));
+ FI_HILOGE("Failed while setting phys:%{public}s", strerror(errno));
}
}
void VirtualDeviceBuilder::SetIdentity()
{
if (write(fd_, &uinputDev_, sizeof(uinputDev_)) < 0) {
- FI_HILOGE("Unable to set uinput device info: %{public}s", strerror(errno));
+ FI_HILOGE("Unable to set uinput device info:%{public}s", strerror(errno));
}
}
@@ -266,7 +266,7 @@ bool VirtualDeviceBuilder::SetUp()
if (ioctl(fd_, UI_DEV_CREATE) < 0) {
FI_HILOGE("Failed to setup uinput device");
if (close(fd_) != 0) {
- FI_HILOGE("close error: %{public}s", strerror(errno));
+ FI_HILOGE("close error:%{public}s", strerror(errno));
}
fd_ = -1;
return false;
@@ -278,10 +278,10 @@ void VirtualDeviceBuilder::Close()
{
if (fd_ >= 0) {
if (ioctl(fd_, UI_DEV_DESTROY) < 0) {
- FI_HILOGE("ioctl error: %{public}s", strerror(errno));
+ FI_HILOGE("ioctl error:%{public}s", strerror(errno));
}
if (close(fd_) != 0) {
- FI_HILOGE("close error: %{public}s", strerror(errno));
+ FI_HILOGE("close error:%{public}s", strerror(errno));
}
fd_ = -1;
}
@@ -403,7 +403,7 @@ int32_t VirtualDeviceBuilder::ScanFor(std::function BTN_TASK) {
- FI_HILOGE("Not mouse button: %{public}d", button);
+ FI_HILOGE("Not mouse button:%{public}d", button);
return RET_ERR;
}
@@ -127,7 +127,7 @@ int32_t VirtualMouse::UpButton(int32_t button)
{
CALL_DEBUG_ENTER;
if (button < BTN_MOUSE || button > BTN_TASK) {
- FI_HILOGE("Not mouse button: %{public}d", button);
+ FI_HILOGE("Not mouse button:%{public}d", button);
return RET_ERR;
}