diff --git a/interfaces/innerkits/aafwk/include/accessible_ability_client.h b/interfaces/innerkits/aafwk/include/accessible_ability_client.h index f850e15d6..1b96d3661 100644 --- a/interfaces/innerkits/aafwk/include/accessible_ability_client.h +++ b/interfaces/innerkits/aafwk/include/accessible_ability_client.h @@ -57,7 +57,7 @@ struct DisconnectCallback { napi_get_undefined(env_, &undefined); napi_call_function(env_, undefined, handler, 0, &jsEvent, &callResult); }; - if (napi_send_event(env_, task, napi_eprio_high) != napi_status::napi_ok) { + if (napi_send_event(env_, task, napi_eprio_high, "NotifyJS") != napi_status::napi_ok) { HILOG_ERROR("failed to send event"); } } diff --git a/interfaces/kits/napi/accessibility_config/src/napi_accessibility_config.cpp b/interfaces/kits/napi/accessibility_config/src/napi_accessibility_config.cpp index d4c46b0c4..2c73b0d18 100644 --- a/interfaces/kits/napi/accessibility_config/src/napi_accessibility_config.cpp +++ b/interfaces/kits/napi/accessibility_config/src/napi_accessibility_config.cpp @@ -1099,7 +1099,7 @@ int EnableAbilityListsObserver::OnEnableAbilityListsStateChangedWork(uv_work_t * HILOG_ERROR("loop or work is nullptr."); return RET_ERR_FAILED; } - int ret = uv_queue_work_with_qos( + int ret = uv_queue_work_with_qos_internal( loop, work, [](uv_work_t *work) {}, @@ -1123,7 +1123,8 @@ int EnableAbilityListsObserver::OnEnableAbilityListsStateChangedWork(uv_work_t * delete work; work = nullptr; }, - uv_qos_default); + uv_qos_default, + "OnEnableAbilityListsStateChangedWork"); return ret; } diff --git a/interfaces/kits/napi/accessibility_config/src/napi_accessibility_config_observer.cpp b/interfaces/kits/napi/accessibility_config/src/napi_accessibility_config_observer.cpp index dbaf726cd..ba0e83284 100644 --- a/interfaces/kits/napi/accessibility_config/src/napi_accessibility_config_observer.cpp +++ b/interfaces/kits/napi/accessibility_config/src/napi_accessibility_config_observer.cpp @@ -143,7 +143,7 @@ void NAccessibilityConfigObserver::NotifyStateChanged2JS(bool enabled) napi_get_value_int32(callbackInfo->env_, callResult, &result); HILOG_INFO("NotifyStateChangedJS napi_call_function result[%{public}d]", result); }; - if (napi_send_event(env_, task, napi_eprio_high) != napi_status::napi_ok) { + if (napi_send_event(env_, task, napi_eprio_high, "NotifyStateChanged2JS") != napi_status::napi_ok) { HILOG_ERROR("failed to send event"); } } @@ -188,7 +188,7 @@ void NAccessibilityConfigObserver::NotifyPropertyChanged2JS(const OHOS::Accessib napi_get_value_int32(callbackInfo->env_, callResult, &result); HILOG_INFO("NotifyPropertyChangedJS napi_call_function result[%{public}d]", result); }; - if (napi_send_event(env_, task, napi_eprio_high) != napi_status::napi_ok) { + if (napi_send_event(env_, task, napi_eprio_high, "NotifyPropertyChanged2JS") != napi_status::napi_ok) { HILOG_ERROR("failed to send event"); } } @@ -230,7 +230,7 @@ void NAccessibilityConfigObserver::NotifyStringChanged2JS(const std::string& val napi_get_value_string_utf8(callbackInfo->env_, callResult, buf, BUF_SIZE, &result); HILOG_INFO("NotifyStringChanged2JSInner napi_call_function result[%{public}zu]", result); }; - if (napi_send_event(env_, task, napi_eprio_high) != napi_status::napi_ok) { + if (napi_send_event(env_, task, napi_eprio_high, "NotifyStringChanged2JS") != napi_status::napi_ok) { HILOG_ERROR("failed to send event"); } } @@ -273,7 +273,7 @@ void NAccessibilityConfigObserver::NotifyStringVectorChanged2JS(std::vectorenv_, callResult, buf, BUF_SIZE, &result); HILOG_DEBUG("NotifyStringVectorChanged napi_call_function result[%{public}zu]", result); }; - if (napi_send_event(env_, task, napi_eprio_high) != napi_status::napi_ok) { + if (napi_send_event(env_, task, napi_eprio_high, "NotifyStringVectorChanged2JS") != napi_status::napi_ok) { HILOG_ERROR("failed to send event"); } } @@ -313,7 +313,7 @@ void NAccessibilityConfigObserver::NotifyIntChanged2JS(int32_t value) napi_get_value_int32(callbackInfo->env_, callResult, &result); HILOG_INFO("NotifyIntChanged2JSInner napi_call_function result[%{public}d]", result); }; - if (napi_send_event(env_, task, napi_eprio_high) != napi_status::napi_ok) { + if (napi_send_event(env_, task, napi_eprio_high, "NotifyIntChanged2JS") != napi_status::napi_ok) { HILOG_ERROR("failed to send event"); } } @@ -353,7 +353,7 @@ void NAccessibilityConfigObserver::NotifyUintChanged2JS(uint32_t value) napi_get_value_uint32(callbackInfo->env_, callResult, &result); HILOG_INFO("NotifyUintChanged2JSInner napi_call_function result[%{public}d]", result); }; - if (napi_send_event(env_, task, napi_eprio_high) != napi_status::napi_ok) { + if (napi_send_event(env_, task, napi_eprio_high, "NotifyUintChanged2JS") != napi_status::napi_ok) { HILOG_ERROR("failed to send event"); } } @@ -392,7 +392,7 @@ void NAccessibilityConfigObserver::NotifyFloatChanged2JS(float value) int32_t result; napi_get_value_int32(callbackInfo->env_, callResult, &result); }; - if (napi_send_event(env_, task, napi_eprio_high) != napi_status::napi_ok) { + if (napi_send_event(env_, task, napi_eprio_high, "NotifyFloatChanged2JS") != napi_status::napi_ok) { HILOG_ERROR("failed to send event"); } } diff --git a/interfaces/kits/napi/accessibility_extension_module_loader/src/napi_accessibility_extension.cpp b/interfaces/kits/napi/accessibility_extension_module_loader/src/napi_accessibility_extension.cpp index 8fdffde86..149f131b3 100644 --- a/interfaces/kits/napi/accessibility_extension_module_loader/src/napi_accessibility_extension.cpp +++ b/interfaces/kits/napi/accessibility_extension_module_loader/src/napi_accessibility_extension.cpp @@ -194,7 +194,7 @@ void NAccessibilityExtension::OnAbilityConnected() } work->data = static_cast(callbackInfo); - int ret = uv_queue_work_with_qos( + int ret = uv_queue_work_with_qos_internal( loop, work, [](uv_work_t *work) {}, @@ -207,7 +207,8 @@ void NAccessibilityExtension::OnAbilityConnected() delete work; work = nullptr; }, - uv_qos_user_initiated); + uv_qos_user_initiated, + "OnAbilityConnected"); if (ret) { HILOG_ERROR("Failed to execute OnAbilityConnected work queue"); delete callbackInfo; @@ -246,7 +247,7 @@ void NAccessibilityExtension::OnAbilityDisconnected() work->data = static_cast(callbackInfo); ffrt::future syncFuture = callbackInfo->syncPromise_.get_future(); - int ret = uv_queue_work_with_qos( + int ret = uv_queue_work_with_qos_internal( loop, work, [](uv_work_t *work) {}, @@ -260,7 +261,8 @@ void NAccessibilityExtension::OnAbilityDisconnected() delete work; work = nullptr; }, - uv_qos_user_initiated); + uv_qos_user_initiated, + "OnAbilityDisconnected"); if (ret) { HILOG_ERROR("Failed to execute OnAbilityDisconnected work queue"); callbackInfo->syncPromise_.set_value(); @@ -433,7 +435,7 @@ int NAccessibilityExtension::OnAccessibilityEventExec(uv_work_t *work, uv_loop_t if (loop == nullptr || work == nullptr) { return RET_ERR_FAILED; } - int ret = uv_queue_work_with_qos( + int ret = uv_queue_work_with_qos_internal( loop, work, [](uv_work_t *work) {}, @@ -500,7 +502,8 @@ int NAccessibilityExtension::OnAccessibilityEventExec(uv_work_t *work, uv_loop_t work = nullptr; } }, - uv_qos_user_initiated); + uv_qos_user_initiated, + "OnAccessibilityEventExec"); return ret; } @@ -554,7 +557,7 @@ int NAccessibilityExtension::OnKeyPressEventExec(uv_work_t *work, uv_loop_t *loo HILOG_ERROR("loop or work is nullptr."); return RET_ERR_FAILED; } - int ret = uv_queue_work_with_qos( + int ret = uv_queue_work_with_qos_internal( loop, work, [](uv_work_t *work) {}, @@ -596,7 +599,8 @@ int NAccessibilityExtension::OnKeyPressEventExec(uv_work_t *work, uv_loop_t *loo DeleteAndNullify(data); DeleteAndNullify(work); }, - uv_qos_user_initiated); + uv_qos_user_initiated, + "OnKeyPressEventExec"); return ret; } diff --git a/interfaces/kits/napi/accessibility_extension_module_loader/src/napi_accessibility_extension_context.cpp b/interfaces/kits/napi/accessibility_extension_module_loader/src/napi_accessibility_extension_context.cpp index aa30e104c..3bbb12ee6 100644 --- a/interfaces/kits/napi/accessibility_extension_module_loader/src/napi_accessibility_extension_context.cpp +++ b/interfaces/kits/napi/accessibility_extension_module_loader/src/napi_accessibility_extension_context.cpp @@ -839,7 +839,7 @@ private: } }; // NAccessibilityExtensionContext::OnStartAbility - if (napi_status::napi_ok != napi_send_event(env, asyncTask, napi_eprio_high)) { + if (napi_status::napi_ok != napi_send_event(env, asyncTask, napi_eprio_high, "OnStartAbility")) { napiAsyncTask->Reject(env, CreateJsError(env, static_cast(NAccessibilityErrorCode::ACCESSIBILITY_ERROR_SYSTEM_ABNORMALITY), ERROR_MESSAGE_SYSTEM_ABNORMALITY)); diff --git a/interfaces/kits/napi/src/napi_accessibility_system_ability_client.cpp b/interfaces/kits/napi/src/napi_accessibility_system_ability_client.cpp index 202f7b8e4..9f45a1209 100644 --- a/interfaces/kits/napi/src/napi_accessibility_system_ability_client.cpp +++ b/interfaces/kits/napi/src/napi_accessibility_system_ability_client.cpp @@ -886,7 +886,7 @@ void StateListener::NotifyJS(napi_env env, bool state, napi_ref handlerRef) napi_get_undefined(callbackInfo->env_, &undefined); napi_call_function(callbackInfo->env_, undefined, handler, 1, &jsEvent, &callResult); }; - if (napi_send_event(env, task, napi_eprio_high) != napi_status::napi_ok) { + if (napi_send_event(env, task, napi_eprio_high, "NotifyJS") != napi_status::napi_ok) { HILOG_ERROR("failed to send event"); } } @@ -923,7 +923,7 @@ void StateListener::NotifyJS(napi_env env, std::string mode, napi_ref handlerRef napi_get_undefined(callbackInfo->env_, &undefined); napi_call_function(callbackInfo->env_, undefined, handler, 1, &jsEvent, &callResult); }; - if (napi_send_event(env, task, napi_eprio_high) != napi_status::napi_ok) { + if (napi_send_event(env, task, napi_eprio_high, "NotifyJS") != napi_status::napi_ok) { HILOG_ERROR("failed to send event"); } } @@ -1549,7 +1549,7 @@ void StateListenerImpl::DeleteObserverReference(napi_env env, std::shared_ptrenv_), closeScope); napi_delete_reference(tmpEnv, callbackInfo->ref_); }; - if (napi_send_event(env, task, napi_eprio_high) != napi_status::napi_ok) { + if (napi_send_event(env, task, napi_eprio_high, "DeleteObserverReference") != napi_status::napi_ok) { HILOG_ERROR("failed to send event"); } }