fix:modify code

Signed-off-by: zhaolinglan <zhaolinglan@huawei.com>
This commit is contained in:
zhaolinglan 2023-08-15 09:26:29 +08:00
parent 1f3f478451
commit 24463a48eb
5 changed files with 8 additions and 7 deletions

View File

@ -297,7 +297,7 @@ bool JsKeyboardDelegateSetting::OnKeyEvent(const std::shared_ptr<MMI::KeyEvent>
IMSA_HILOGE("failed to get uv work");
return false;
}
StartAsync("OnFullKeyEvent START", static_cast<int32_t>(TraceTaskId::ON_FULL_KEY_EVENT));
StartAsync("OnFullKeyEvent", static_cast<int32_t>(TraceTaskId::ON_FULL_KEY_EVENT));
uv_queue_work_with_qos(
loop_, work, [](uv_work_t *work) {},
[](uv_work_t *work, int status) {
@ -323,7 +323,7 @@ bool JsKeyboardDelegateSetting::OnKeyEvent(const std::shared_ptr<MMI::KeyEvent>
// 1 means callback has one param.
JsCallbackHandler::Traverse(entry->vecCopy, { 1, getKeyEventProperty }, isConsumed);
entry->isDone->SetValue(isConsumed);
FinishAsync("OnFullKeyEvent END", static_cast<int32_t>(TraceTaskId::ON_FULL_KEY_EVENT));
FinishAsync("OnFullKeyEvent", static_cast<int32_t>(TraceTaskId::ON_FULL_KEY_EVENT));
},
uv_qos_user_initiated);
bool isConsumed = isDone->GetValue();
@ -345,7 +345,7 @@ bool JsKeyboardDelegateSetting::OnKeyEvent(int32_t keyCode, int32_t keyStatus)
IMSA_HILOGE("failed to get uv work");
return false;
}
StartAsync("OnKeyEvent START", static_cast<int32_t>(TraceTaskId::ON_KEY_EVENT));
StartAsync("OnKeyEvent", static_cast<int32_t>(TraceTaskId::ON_KEY_EVENT));
uv_queue_work_with_qos(
loop_, work, [](uv_work_t *work) {},
[](uv_work_t *work, int status) {
@ -372,7 +372,7 @@ bool JsKeyboardDelegateSetting::OnKeyEvent(int32_t keyCode, int32_t keyStatus)
// 1 means callback has one param.
JsCallbackHandler::Traverse(entry->vecCopy, { 1, getKeyEventProperty }, isConsumed);
entry->isDone->SetValue(isConsumed);
FinishAsync("OnKeyEvent End", static_cast<int32_t>(TraceTaskId::ON_KEY_EVENT));
FinishAsync("OnKeyEvent", static_cast<int32_t>(TraceTaskId::ON_KEY_EVENT));
},
uv_qos_user_initiated);
bool isConsumed = isDone->GetValue();

View File

@ -165,10 +165,11 @@ void JsInputMethodExtension::OnStart(const AAFwk::Want &want)
NativeValue *argv[] = { nativeWant };
StartAsync("onCreate", static_cast<int32_t>(TraceTaskId::ONCREATE_EXTENSION));
CallObjectMethod("onCreate", argv, ARGC_ONE);
FinishAsync("onCreate", static_cast<int32_t>(TraceTaskId::ONCREATE_EXTENSION));
InputMethodAbility::GetInstance()->OnImeReady();
auto ret = InputMethodAbility::GetInstance()->SetCoreAndAgent();
IMSA_HILOGI("ime bind imf ret: %{public}d", ret);
FinishAsync("onCreate", static_cast<int32_t>(TraceTaskId::ONSTART_EXTENSION));
FinishAsync("OnStart", static_cast<int32_t>(TraceTaskId::ONSTART_EXTENSION));
}
void JsInputMethodExtension::OnStop()

View File

@ -843,6 +843,7 @@ void InputMethodController::GetTextIndexAtCursor(const Message *msg)
bool InputMethodController::DispatchKeyEvent(std::shared_ptr<MMI::KeyEvent> keyEvent)
{
InputMethodSyncTrace tracer("DispatchKeyEvent trace");
IMSA_HILOGI("InputMethodController in");
if (!isEditable_.load()) {
IMSA_HILOGE("not in editable state");

View File

@ -20,8 +20,6 @@
namespace OHOS {
namespace MiscServices {
constexpr uint64_t HITRACE_TAG_MISC = (1ULL << 41); // Notification module tag.
void InitHiTrace();
void ValueTrace(const std::string &name, int64_t count);

View File

@ -19,6 +19,7 @@
namespace OHOS {
namespace MiscServices {
constexpr uint64_t HITRACE_TAG_MISC = (1ULL << 41); // Notification module tag.
void InitHiTrace()
{
UpdateTraceLabel();