diff --git a/frameworks/js/napi/inputmethodclient/js_utils.cpp b/frameworks/js/napi/inputmethodclient/js_utils.cpp index dec12c4c..86b8fc0f 100644 --- a/frameworks/js/napi/inputmethodclient/js_utils.cpp +++ b/frameworks/js/napi/inputmethodclient/js_utils.cpp @@ -46,6 +46,7 @@ const std::map JsUtils::ERROR_CODE_MAP = { { ErrorCode::ERROR_EX_PARCELABLE, EXCEPTION_IMMS }, { ErrorCode::ERROR_EX_ILLEGAL_ARGUMENT, EXCEPTION_IMMS }, { ErrorCode::ERROR_EX_ILLEGAL_STATE, EXCEPTION_IMMS }, + { ErrorCode::ERROR_NOT_IME, EXCEPTION_IME }, }; const std::map JsUtils::ERROR_CODE_CONVERT_MESSAGE_MAP = { @@ -55,7 +56,7 @@ const std::map JsUtils::ERROR_CODE_CONVERT_MESSAGE_MAP = { { EXCEPTION_PACKAGEMANAGER, "package manager error." }, { EXCEPTION_IMENGINE, "input method engine error." }, { EXCEPTION_IMCLIENT, "input method client error." }, - { EXCEPTION_KEYEVENT, "key event processing error." }, + { EXCEPTION_IME, "not an input method extension." }, { EXCEPTION_CONFPERSIST, "configuration persisting error." }, { EXCEPTION_CONTROLLER, "input method controller error." }, { EXCEPTION_SETTINGS, "input method settings extension error." }, diff --git a/frameworks/js/napi/inputmethodclient/js_utils.h b/frameworks/js/napi/inputmethodclient/js_utils.h index 0264311b..2c8542b9 100644 --- a/frameworks/js/napi/inputmethodclient/js_utils.h +++ b/frameworks/js/napi/inputmethodclient/js_utils.h @@ -37,7 +37,7 @@ enum IMFErrorCode : int32_t { EXCEPTION_PACKAGEMANAGER = 12800001, EXCEPTION_IMENGINE, EXCEPTION_IMCLIENT, - EXCEPTION_KEYEVENT, + EXCEPTION_IME, EXCEPTION_CONFPERSIST, EXCEPTION_CONTROLLER, EXCEPTION_SETTINGS, diff --git a/frameworks/native/inputmethod_ability/src/input_method_panel.cpp b/frameworks/native/inputmethod_ability/src/input_method_panel.cpp index 5d3f73e8..d1237c67 100644 --- a/frameworks/native/inputmethod_ability/src/input_method_panel.cpp +++ b/frameworks/native/inputmethod_ability/src/input_method_panel.cpp @@ -51,7 +51,7 @@ int32_t InputMethodPanel::CreatePanel( window_ = OHOS::Rosen::Window::Create(windowName, winOption_, context, wmError); if (wmError == WMError::WM_ERROR_INVALID_PERMISSION || wmError == WMError::WM_ERROR_NOT_SYSTEM_APP) { IMSA_HILOGE("Create window failed, permission denied, %{public}d", wmError); - return ErrorCode::ERROR_STATUS_PERMISSION_DENIED; + return ErrorCode::ERROR_NOT_IME; } if (window_ == nullptr || wmError != WMError::WM_OK) { return ErrorCode::ERROR_OPERATE_PANEL; diff --git a/services/include/global.h b/services/include/global.h index 7ac1af92..d278005f 100644 --- a/services/include/global.h +++ b/services/include/global.h @@ -93,6 +93,7 @@ enum { ERROR_CLIENT_ADD_FAILED = 19, ERROR_OPERATE_PANEL = 20, ERROR_NOT_CURRENT_IME = 21, + ERROR_NOT_IME = 22, }; }; // namespace ErrorCode