mirror of
https://gitee.com/openharmony/msdp_device_status
synced 2025-02-21 08:14:07 +00:00
bugfix Signed-off-by:lcaidm<lichen139@huawei.com>
Signed-off-by: lcaidm <lichen139@huawei.com>
This commit is contained in:
parent
c0770ac391
commit
e314775a94
@ -87,7 +87,7 @@
|
||||
"//base/msdp/device_status/interfaces/innerkits:devicestatus_client",
|
||||
"//base/msdp/device_status/frameworks/js/napi:stationary",
|
||||
"//base/msdp/device_status/frameworks/js/napi/interaction:interaction_jsapi_group",
|
||||
"//base/msdp/device_status/frameworks/js/napi/motion:devicestatus_motion"
|
||||
"//base/msdp/device_status/frameworks/js/napi/motion:motion_napi"
|
||||
],
|
||||
"service_group":[
|
||||
"//base/msdp/device_status/libs:devicestatus_algo",
|
||||
|
@ -17,7 +17,7 @@ config("device_motion_private_config") {
|
||||
include_dirs = [ "include" ]
|
||||
}
|
||||
|
||||
ohos_shared_library("devicestatus_motion") {
|
||||
ohos_shared_library("motion_napi") {
|
||||
branch_protector_ret = "pac_ret"
|
||||
sanitize = {
|
||||
integer_overflow = true
|
||||
@ -55,7 +55,7 @@ ohos_shared_library("devicestatus_motion") {
|
||||
]
|
||||
}
|
||||
|
||||
relative_install_dir = "module"
|
||||
relative_install_dir = "module/multimodalawareness"
|
||||
subsystem_name = "msdp"
|
||||
part_name = "${device_status_part_name}"
|
||||
}
|
||||
|
@ -183,14 +183,12 @@ void MotionEventNapi::OnEventOperatingHand(int32_t eventType, size_t argc, const
|
||||
|
||||
void MotionEventNapi::ConvertOperatingHandData(napi_value handler, size_t argc, const MotionEvent &event)
|
||||
{
|
||||
napi_value motionValue = nullptr;
|
||||
napi_value result;
|
||||
napi_status ret = napi_create_object(env_, &result);
|
||||
napi_status ret = napi_create_int32(env_, event.status, &result);
|
||||
if (ret != napi_ok) {
|
||||
FI_HILOGE("napi_create_object failed");
|
||||
FI_HILOGE("napi_create_int32 failed");
|
||||
return;
|
||||
}
|
||||
CreateIntData(env_, motionValue, result, "OperatingHandStatus", event.status);
|
||||
napi_value callResult = nullptr;
|
||||
ret = napi_call_function(env_, nullptr, handler, argc, &result, &callResult);
|
||||
if (ret != napi_ok) {
|
||||
|
@ -359,19 +359,17 @@ napi_value MotionNapi::GetRecentOptHandStatus(napi_env env, napi_callback_info i
|
||||
}
|
||||
#endif
|
||||
|
||||
napi_status objStatus = napi_create_object(env, &result);
|
||||
if (objStatus != napi_ok) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ConstructMotion(env, jsThis);
|
||||
#ifdef MOTION_ENABLE
|
||||
if (g_motionObj == nullptr) {
|
||||
ThrowMotionErr(env, GETOPT_EXCEPTION, "Error invalid type");
|
||||
return nullptr;
|
||||
}
|
||||
napi_value tmpValue = nullptr;
|
||||
g_motionObj->CreateIntData(env, tmpValue, result, "OperatingHandStatus", static_cast<int32_t>(motionEvent.status));
|
||||
napi_status ret = napi_create_int32(env, static_cast<int32_t>(motionEvent.status), &result);
|
||||
if (ret != napi_ok) {
|
||||
ThrowMotionErr(env, GETOPT_EXCEPTION, "napi_create_int32 failed");
|
||||
return nullptr;
|
||||
}
|
||||
#else
|
||||
ThrowMotionErr(env, DEVICE_EXCEPTION, "Device not support");
|
||||
#endif
|
||||
@ -466,9 +464,9 @@ EXTERN_C_END
|
||||
static napi_module g_module = {
|
||||
.nm_version = 1,
|
||||
.nm_flags = 0,
|
||||
.nm_filename = "device_motion",
|
||||
.nm_filename = "multimodalAwareness.motion",
|
||||
.nm_register_func = MotionInit,
|
||||
.nm_modname = "device_motion",
|
||||
.nm_modname = "multimodalAwareness.motion",
|
||||
.nm_priv = (static_cast<void *>(nullptr)),
|
||||
.reserved = { nullptr }
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user