From 89e1a953489efae148f90e05d9f5d8c4d6d39c43 Mon Sep 17 00:00:00 2001 From: Hollokin Date: Thu, 4 May 2023 17:12:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B912800004=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=A0=81=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Hollokin --- frameworks/js/napi/inputmethodclient/js_utils.cpp | 3 ++- frameworks/js/napi/inputmethodclient/js_utils.h | 2 +- .../native/inputmethod_ability/src/input_method_panel.cpp | 2 +- services/include/global.h | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) 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