刪除inputmethod_ability 里include_dirs外部模块绝对路径

Signed-off-by: cy7717 <chenyu301@huawei.com>
This commit is contained in:
cy7717 2024-04-27 16:00:54 +08:00
parent d8bafcc78a
commit 54b66238b1
20 changed files with 314 additions and 112 deletions

View File

@ -37,13 +37,13 @@ ohos_shared_library("inputmethod_common") {
]
sources = [
"src/global.cpp",
"src/itypes_util.cpp",
"src/message.cpp",
"src/message_handler.cpp",
"src/input_death_recipient.cpp",
"src/inputmethod_dump.cpp",
"src/inputmethod_sysevent.cpp",
"src/inputmethod_trace.cpp",
"src/input_death_recipient.cpp",
"src/itypes_util.cpp",
"src/message.cpp",
"src/message_handler.cpp",
]
configs = [ ":inputmethod_common_native_config" ]
@ -51,14 +51,14 @@ ohos_shared_library("inputmethod_common") {
public_configs = [ ":inputmethod_common_native_config" ]
external_deps = [
"hilog:libhilog",
"ability_base:want",
"ipc:ipc_single",
"c_utils:utils",
"hilog:libhilog",
"hisysevent:libhisysevent",
"hitrace:hitrace_meter",
"hitrace:libhitracechain",
"input:libmmi-client",
"ipc:ipc_single",
]
subsystem_name = "inputmethod"

View File

@ -249,7 +249,7 @@ bool ITypesUtil::Unmarshalling(TextTotalConfig &output, MessageParcel &data)
bool ITypesUtil::Marshalling(const InputClientInfo &input, MessageParcel &data)
{
if (!Marshal(data, input.pid, input.uid, input.userID, input.isShowKeyboard, input.eventFlag, input.config,
input.state, input.isNotifyInputStart)) {
input.state, input.isNotifyInputStart)) {
IMSA_HILOGE("write InputClientInfo to message parcel failed");
return false;
}

View File

@ -68,9 +68,9 @@ ohos_shared_library("inputmethodengine") {
configs = [ ":inputmethodengine_native_config" ]
deps = [
"${inputmethod_path}/common:inputmethod_common",
"${inputmethod_path}/frameworks/js/napi/common:inputmethod_js_common",
"${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability",
"${inputmethod_path}/common:inputmethod_common",
]
external_deps = [

View File

@ -61,8 +61,8 @@ ohos_shared_library("inputmethod_extension") {
public_configs = [ ":ability_public_config" ]
deps = [
"${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability",
"${inputmethod_path}/common:inputmethod_common",
"${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability",
]
external_deps = [
@ -78,6 +78,7 @@ ohos_shared_library("inputmethod_extension") {
"eventhandler:libeventhandler",
"hilog:libhilog",
"i18n:intl_util",
"input:libmmi-client",
"ipc:ipc_napi",
"ipc:ipc_single",
"napi:ace_napi",

View File

@ -25,7 +25,7 @@
#include "js_runtime_utils.h"
#include "panel_info.h"
#include "panel_status_listener.h"
#include "window.h"
#include "foundation/window/window_manager/interfaces/innerkits/wm/window.h"
namespace OHOS {
namespace MiscServices {

View File

@ -22,6 +22,7 @@
#include "global.h"
#include "input_method_agent_stub.h"
#include "input_method_core_stub.h"
#include "input_method_system_ability_proxy.h"
#include "input_method_utils.h"
#include "inputmethod_sysevent.h"
#include "inputmethod_trace.h"

View File

@ -17,7 +17,6 @@
#define FRAMEWORKS_INPUTMETHOD_CONTROLLER_INCLUDE_I_INPUT_CLIENT_H
#include "global.h"
#include "i_input_method_agent.h"
#include "input_method_property.h"
#include "input_window_info.h"
#include "iremote_broker.h"

View File

@ -33,9 +33,6 @@ config("inputmethod_ability_native_public_config") {
"${inputmethod_path}/frameworks/common",
"${inputmethod_path}/interfaces/inner_api/inputmethod_controller/include",
"${inputmethod_path}/services/include",
"${windowmanager_path}/interfaces/innerkits/dm",
"${windowmanager_path}/interfaces/innerkits/wm",
"${multimodalinput_path}/interfaces/native/innerkits/event/include",
]
}

View File

@ -300,6 +300,39 @@ public:
*/
IMF_API int32_t ListCurrentInputMethodSubtype(std::vector<SubProperty> &subProperties);
/**
* @brief Get enter key type.
*
* This function is used to get enter key type of current client.
*
* @param keyType Indicates the enter key type of current client that will be obtained, such as SEND, SEARCH...
* @return Returns 0 for success, others for failure.
* @since 6
*/
int32_t GetEnterKeyType(int32_t &keyType);
/**
* @brief Get input pattern.
*
* This function is used to get text input type of current client.
*
* @param inputPattern Indicates the text input type of current client that will be obtained, such as TEXT, URL...
* @return Returns 0 for success, others for failure.
* @since 6
*/
int32_t GetInputPattern(int32_t &inputPattern);
/**
* @brief Get text config.
*
* This function is used to get text config of current client.
*
* @param textConfig Indicates the text config of current client that will be obtained.
* @return Returns 0 for success, others for failure.
* @since 10
*/
int32_t GetTextConfig(TextTotalConfig &config);
/**
* @brief Get current input method property.
*
@ -468,6 +501,189 @@ public:
*/
IMF_API bool WasAttached();
/**
* @brief Set agent which will be used to communicate with IMA.
*
* This function is used to Set agent.
*
* @since 10
*/
void OnInputReady(sptr<IRemoteObject> agentObject);
/**
* @brief Unbind IMC with Service.
*
* This function is unbind imc with service.
*
* @since 10
*/
void OnInputStop();
/**
* @brief Insert text.
*
* This function is used to insert text into editor.
*
* @param text Indicates the text which will be inserted.
* @return Returns 0 for success, others for failure.
* @since 10
*/
int32_t InsertText(const std::u16string &text);
/**
* @brief Move cursor.
*
* This function is used to move cursor according to the direction.
*
* @param direction Indicates the direction according to which the cursor will be moved.
* @return Returns 0 for success, others for failure.
* @since 10
*/
int32_t MoveCursor(Direction direction);
/**
* @brief Delete forward.
*
* This function is used to delete text at the left of cursor.
*
* @param length Indicates the length of deleted text.
* @return Returns 0 for success, others for failure.
* @since 10
*/
int32_t DeleteForward(int32_t length);
/**
* @brief Delete backward.
*
* This function is used to delete text at the right of cursor.
*
* @param length Indicates the length of deleted text.
* @return Returns 0 for success, others for failure.
* @since 10
*/
int32_t DeleteBackward(int32_t length);
/**
* @brief Get text at the left of cursor.
*
* This function is used to get text at the left of cursor.
*
* @param length Indicates the length of text.
* @param text Indicates the text which will be get.
* @return Returns 0 for success, others for failure.
* @since 10
*/
int32_t GetLeft(int32_t length, std::u16string &text);
/**
* @brief Get text at the right of cursor.
*
* This function is used to get text at the right of cursor.
*
* @param length Indicates the length of text.
* @param text Indicates the text which will be get.
* @return Returns 0 for success, others for failure.
* @since 10
*/
int32_t GetRight(int32_t length, std::u16string &text);
/**
* @brief Select text in editor by range.
*
* This function is used to select text in editor by range.
*
* @param start Indicates the beginning of the range.
* @param start Indicates the end of the range.
* @return Returns 0 for success, others for failure.
* @since 10
*/
void SelectByRange(int32_t start, int32_t end);
/**
* @brief Select text in editor by cursor movement.
*
* This function is used to select text in editor by cursor movement.
*
* @param direction Indicates the direction of cursor movement.
* @param cursorMoveSkip Indicates the skip of cursor movement.
* @return Returns 0 for success, others for failure.
* @since 10
*/
void SelectByMovement(int32_t direction, int32_t cursorMoveSkip);
/**
* @brief Handle extend action code.
*
* This function is used to handle extend action code.
*
* @param action Indicates the action code which will be handled.
* @return Returns 0 for success, others for failure.
* @since 10
*/
int32_t HandleExtendAction(int32_t action);
/**
* @brief Get the index number of text at cursor.
*
* This function is used to get the index number of text at cursor.
*
* @param index Indicates the index number of text at cursor.
* @return Returns 0 for success, others for failure.
* @since 10
*/
int32_t GetTextIndexAtCursor(int32_t &index);
/**
* @brief Send keyboard status.
*
* This function is used to send keyboard status to editor.
*
* @param status Indicates the status of keyboard.
* @since 10
*/
void SendKeyboardStatus(KeyboardStatus status);
/**
* @brief Send panel status info.
*
* This function is used to send panel status info to editor.
* Only notify the status info of soft keyboard(not contain candidate column) at present
*
* @param info Indicates the status info of panel.
* @since 11
*/
void NotifyPanelStatusInfo(const PanelStatusInfo &info);
/**
* @brief Send panel height.
*
* This function is used to send panel height to editor.
*
* @param info Indicates the panel height.
* @since 11
*/
void NotifyKeyboardHeight(uint32_t height);
/**
* @brief Send function key.
*
* This function is used to send function key to editor.
*
* @param functionKey Indicates the function key.
* @return Returns 0 for success, others for failure.
* @since 10
*/
int32_t SendFunctionKey(int32_t functionKey);
/**
* @brief Deactivate the input client.
*
* This function is used to deactivate the input client.
*
* @since 11
*/
void DeactivateClient();
/**
* @brief Query whether an input type is supported.
*
@ -501,6 +717,7 @@ public:
* @since 11
*/
IMF_API int32_t IsPanelShown(const PanelInfo &panelInfo, bool &isShown);
int32_t UpdateListenEventFlag(uint32_t finalEventFlag, uint32_t eventFlag, bool isOn);
/**
* @brief Send private command to ime.
@ -514,30 +731,37 @@ public:
IMF_API int32_t SendPrivateCommand(
const std::unordered_map<std::string, PrivateDataValue> &privateCommand) override;
// Internal calls in so, no need IMF_API
int32_t GetEnterKeyType(int32_t &keyType);
int32_t GetInputPattern(int32_t &inputPattern);
int32_t GetTextConfig(TextTotalConfig &config);
void OnInputReady(sptr<IRemoteObject> agentObject);
void OnInputStop();
int32_t InsertText(const std::u16string &text);
int32_t MoveCursor(Direction direction);
int32_t DeleteForward(int32_t length);
int32_t DeleteBackward(int32_t length);
int32_t GetLeft(int32_t length, std::u16string &text);
int32_t GetRight(int32_t length, std::u16string &text);
void SelectByRange(int32_t start, int32_t end);
void SelectByMovement(int32_t direction, int32_t cursorMoveSkip);
int32_t HandleExtendAction(int32_t action);
int32_t GetTextIndexAtCursor(int32_t &index);
void SendKeyboardStatus(KeyboardStatus status);
void NotifyPanelStatusInfo(const PanelStatusInfo &info);
void NotifyKeyboardHeight(uint32_t height);
int32_t SendFunctionKey(int32_t functionKey);
void DeactivateClient();
int32_t UpdateListenEventFlag(uint32_t finalEventFlag, uint32_t eventFlag, bool isOn);
int32_t ReceivePrivateCommand(const std::unordered_map<std::string, PrivateDataValue> &privateCommand) override;
/**
* @brief Receive private command from ime.
*
* This function is used to receive private command from ime.
*
* @param privateCommand Indicates the private command which send from ime.
* @return Returns 0 for success, others for failure.
* @since 12
*/
int32_t ReceivePrivateCommand(
const std::unordered_map<std::string, PrivateDataValue> &privateCommand) override;
/**
* @brief Set preview text.
*
* This function is used to set preview text.
*
* @param text Indicates the text to be previewed.
* @param range Indicates the range of text to be replaced.
* @return Returns 0 for success, others for failure.
* @since 12
*/
int32_t SetPreviewText(const std::string &text, const Range &range);
/**
* @brief Finish text preview.
*
* This function is used to finish text preview.
*
* @since 12
*/
int32_t FinishTextPreview();
private:

View File

@ -73,9 +73,9 @@ ohos_shared_library("inputmethod_service") {
public_configs = [ ":inputmethod_services_native_config" ]
deps = [
"${inputmethod_path}/common:inputmethod_common",
"${inputmethod_path}/services/adapter/keyboard:keboard_event_static",
"${inputmethod_path}/services/adapter/settings_data_provider:settings_data_static",
"${inputmethod_path}/common:inputmethod_common",
"${inputmethod_path}/services/file:imf_file_static",
"${inputmethod_path}/services/json:imf_json_static",
"//third_party/cJSON:cjson",
@ -126,12 +126,12 @@ ohos_static_library("inputmethod_service_static") {
sources = [
"${inputmethod_path}/frameworks/native/inputmethod_ability/src/input_method_core_proxy.cpp",
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_client_proxy.cpp",
"${inputmethod_path}/services/adapter/focus_monitor/src/focus_change_listener.cpp",
"${inputmethod_path}/services/adapter/focus_monitor/src/focus_monitor_manager.cpp",
"${inputmethod_path}/services/adapter/system_language_observer/src/system_language_observer.cpp",
"${inputmethod_path}/services/adapter/wms_connection_monitor/src/wms_connection_monitor_manager.cpp",
"${inputmethod_path}/services/adapter/wms_connection_monitor/src/wms_connection_observer.cpp",
"${inputmethod_path}/services/identity_checker/src/identity_checker_impl.cpp",
"adapter/focus_monitor/src/focus_change_listener.cpp",
"adapter/focus_monitor/src/focus_monitor_manager.cpp",
"adapter/system_language_observer/src/system_language_observer.cpp",
"adapter/wms_connection_monitor/src/wms_connection_monitor_manager.cpp",
"adapter/wms_connection_monitor/src/wms_connection_observer.cpp",
"identity_checker/src/identity_checker_impl.cpp",
"src/freeze_manager.cpp",
"src/im_common_event_manager.cpp",
"src/ime_cfg_manager.cpp",
@ -147,11 +147,11 @@ ohos_static_library("inputmethod_service_static") {
public_configs = [ ":inputmethod_services_native_config" ]
public_deps = [
"${inputmethod_path}/services/adapter/keyboard:keboard_event_static",
"${inputmethod_path}/services/adapter/settings_data_provider:settings_data_static",
"${inputmethod_path}/common:inputmethod_common",
"${inputmethod_path}/services/file:imf_file_static",
"${inputmethod_path}/services/json:imf_json_static",
"adapter/keyboard:keboard_event_static",
"adapter/settings_data_provider:settings_data_static",
"file:imf_file_static",
"json:imf_json_static",
"//third_party/cJSON:cjson",
]

View File

@ -18,6 +18,8 @@
#include <memory>
#include "element_name.h"
#include "input_client_proxy.h"
#include "input_method_core_proxy.h"
#include "ipc_skeleton.h"
#include "itypes_util.h"

View File

@ -50,7 +50,10 @@ ohos_static_library("inputmethod_test_common") {
"${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability",
"${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
]
external_deps = [ "hilog:libhilog" ]
external_deps = [
"hilog:libhilog",
"input:libmmi-client",
]
subsystem_name = "inputmethod"
part_name = "imf"

View File

@ -37,16 +37,14 @@ ohos_fuzztest("AgentStubFuzzTest") {
"-fno-omit-frame-pointer",
]
sources = [
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/keyevent_consumer_proxy.cpp",
"agentstub_fuzzer.cpp",
]
sources = [ "agentstub_fuzzer.cpp" ]
deps = [ "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability_static" ]
external_deps = [
"c_utils:utils",
"hilog:libhilog",
"input:libmmi-client",
"ipc:ipc_single",
]
}

View File

@ -46,6 +46,7 @@ ohos_fuzztest("InputClientStubFuzzTest") {
"ability_runtime:ability_manager",
"c_utils:utils",
"hilog:libhilog",
"input:libmmi-client",
"ipc:ipc_single",
]
}

View File

@ -49,6 +49,7 @@ ohos_fuzztest("InputMethodAbilityFuzzTest") {
"input:libmmi-client",
"ipc:ipc_single",
"napi:ace_napi",
"window_manager:libwm",
]
}

View File

@ -38,10 +38,7 @@ ohos_fuzztest("PerUserSessionFuzzTest") {
"-fno-omit-frame-pointer",
]
sources = [
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/keyevent_consumer_proxy.cpp",
"perusersession_fuzzer.cpp",
]
sources = [ "perusersession_fuzzer.cpp" ]
deps = [
"${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability_static",
@ -53,8 +50,10 @@ ohos_fuzztest("PerUserSessionFuzzTest") {
"ability_runtime:ability_manager",
"c_utils:utils",
"hilog:libhilog",
"input:libmmi-client",
"ipc:ipc_single",
"napi:ace_napi",
"window_manager:libwm",
]
}

View File

@ -44,7 +44,7 @@ ohos_unittest("InputMethodControllerTest") {
configs = [ ":module_private_config" ]
deps = [
"${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability_static",
"${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability",
"${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
"${inputmethod_path}/services:inputmethod_service",
"${inputmethod_path}/test/common:inputmethod_test_common",
@ -84,7 +84,7 @@ ohos_unittest("InputMethodAttachTest") {
configs = [ ":module_private_config" ]
deps = [
"${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability_static",
"${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability",
"${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
"${inputmethod_path}/services:inputmethod_service",
"${inputmethod_path}/test/common:inputmethod_test_common",
@ -100,6 +100,7 @@ ohos_unittest("InputMethodAttachTest") {
"bundle_framework:appexecfwk_core",
"c_utils:utils",
"hilog:libhilog",
"input:libmmi-client",
"napi:ace_napi",
"window_manager:libwm",
]
@ -114,20 +115,18 @@ ohos_unittest("InputMethodAbilityTest") {
module_out_path = module_output_path
sources = [
"${inputmethod_path}/frameworks/native/inputmethod_ability/src/input_method_agent_stub.cpp",
"${inputmethod_path}/frameworks/native/inputmethod_ability/src/input_method_core_proxy.cpp",
"${inputmethod_path}/frameworks/native/inputmethod_ability/src/input_method_core_stub.cpp",
"${inputmethod_path}/services/src/input_control_channel_proxy.cpp",
"src/input_method_ability_exception_test.cpp",
"src/input_method_ability_test.cpp",
]
configs = [ ":module_private_config" ]
include_dirs = [
"${windowmanager_path}/interfaces/innerkits/dm",
"${windowmanager_path}/interfaces/innerkits/wm",
]
deps = [
"${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability_static",
"${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability",
"${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
"${inputmethod_path}/services:inputmethod_service",
"${inputmethod_path}/test/common:inputmethod_test_common",
@ -165,13 +164,8 @@ ohos_unittest("InputMethodServiceTest") {
configs = [ ":module_private_config" ]
include_dirs = [
"${windowmanager_path}/interfaces/innerkits/dm",
"${windowmanager_path}/interfaces/innerkits/wm",
]
deps = [
"${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability_static",
"${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability",
"${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
"${inputmethod_path}/services:inputmethod_service",
"${inputmethod_path}/test/common:inputmethod_test_common",
@ -208,10 +202,10 @@ ohos_unittest("InputMethodDfxTest") {
configs = [ ":module_private_config" ]
deps = [
"${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability_static",
"${inputmethod_path}/common:inputmethod_common",
"${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability",
"${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client",
"${inputmethod_path}/services:inputmethod_service",
"${inputmethod_path}/common:inputmethod_common",
"${inputmethod_path}/test/common:inputmethod_test_common",
"${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
"//third_party/googletest:gtest_main",
@ -248,13 +242,8 @@ ohos_unittest("InputMethodPanelTest") {
configs = [ ":module_private_config" ]
include_dirs = [
"${windowmanager_path}/interfaces/innerkits/dm",
"${windowmanager_path}/interfaces/innerkits/wm",
]
deps = [
"${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability_static",
"${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability",
"${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
"${inputmethod_path}/services:inputmethod_service",
"${inputmethod_path}/test/common:inputmethod_test_common",
@ -325,12 +314,17 @@ ohos_unittest("InputMethodPrivateMemberTest") {
}
module_out_path = module_output_path
sources = [ "src/input_method_private_member_test.cpp" ]
sources = [
"${inputmethod_path}/frameworks/native/inputmethod_ability/src/input_method_agent_stub.cpp",
"${inputmethod_path}/frameworks/native/inputmethod_ability/src/input_method_core_stub.cpp",
"${inputmethod_path}/services/src/input_control_channel_proxy.cpp",
"src/input_method_private_member_test.cpp",
]
configs = [ ":module_private_config" ]
deps = [
"${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability_static",
"${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability",
"${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
"${inputmethod_path}/services:inputmethod_service_static",
"${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
@ -349,6 +343,7 @@ ohos_unittest("InputMethodPrivateMemberTest") {
"input:libmmi-client",
"ipc:ipc_core",
"ipc:ipc_single",
"napi:ace_napi",
"os_account:os_account_innerkits",
"window_manager:libwm",
]
@ -368,7 +363,7 @@ ohos_unittest("InputMethodEditorTest") {
configs = [ ":module_private_config" ]
deps = [
"${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability_static",
"${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability",
"${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
"${inputmethod_path}/services:inputmethod_service",
"${inputmethod_path}/test/common:inputmethod_test_common",
@ -480,7 +475,7 @@ ohos_unittest("TextListenerInnerApiTest") {
configs = [ ":module_private_config" ]
deps = [
"${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability_static",
"${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability",
"${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
"${inputmethod_path}/services:inputmethod_service",
"${inputmethod_path}/test/common:inputmethod_test_common",
@ -520,11 +515,6 @@ ohos_unittest("ImeProxyTest") {
configs = [ ":module_private_config" ]
include_dirs = [
"${windowmanager_path}/interfaces/innerkits/dm",
"${windowmanager_path}/interfaces/innerkits/wm",
]
deps = [
"${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability",
"${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
@ -617,13 +607,15 @@ ohos_unittest("SecurityModeParseTest") {
]
sources = [
"${inputmethod_path}/services/adapter/settings_data_provider/common/src/settings_data_observer.cpp",
"${inputmethod_path}/services/adapter/settings_data_provider/common/src/settings_data_utils.cpp",
"${inputmethod_path}/services/adapter/settings_data_provider/src/security_mode_parser.cpp",
"mock/datashare_helper.cpp",
"src/security_mode_parser_test.cpp",
]
deps = [
"${inputmethod_path}/services:inputmethod_service_static",
"${inputmethod_path}/services/adapter/settings_data_provider:settings_data_static",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest_main",
]

View File

@ -20,7 +20,7 @@
#include "block_data.h"
#include "bundle_mgr_interface.h"
#include "window.h"
#include "foundation/window/window_manager/interfaces/innerkits/wm/window.h"
#include "window_manager.h"
#include "window_option.h"
#include "wm_common.h"

View File

@ -46,7 +46,6 @@ public:
static std::vector<std::string> extName;
static std::vector<std::string> language;
static std::vector<std::string> locale;
static bool enableOn;
static std::string beforeValue;
static std::string allEnableIme;
};
@ -57,7 +56,6 @@ std::string InputMethodSwitchTest::bundleName = "com.example.testIme";
std::vector<std::string> InputMethodSwitchTest::extName{ "InputMethodExtAbility", "InputMethodExtAbility2" };
std::vector<std::string> InputMethodSwitchTest::language{ "chinese", "english" };
std::vector<std::string> InputMethodSwitchTest::locale{ "zh-CN", "en-US" };
bool InputMethodSwitchTest::enableOn = false;
std::string InputMethodSwitchTest::beforeValue;
std::string InputMethodSwitchTest::allEnableIme = "{\"enableImeList\" : {\"100\" : [ \"com.example.newTestIme\", "
"\"com.example.testIme\"]}}";
@ -87,10 +85,8 @@ void InputMethodSwitchTest::SetUpTestCase(void)
void InputMethodSwitchTest::TearDownTestCase(void)
{
IMSA_HILOGI("InputMethodSwitchTest::TearDownTestCase");
if (enableOn) {
TddUtil::GrantNativePermission();
TddUtil::PushEnableImeValue(ENABLE_IME_KEYWORD, beforeValue);
}
TddUtil::GrantNativePermission();
TddUtil::PushEnableImeValue(ENABLE_IME_KEYWORD, beforeValue);
InputMethodController::GetInstance()->Close();
TddUtil::RestoreSelfTokenID();
}
@ -263,11 +259,7 @@ HWTEST_F(InputMethodSwitchTest, testSwitchImeWithErrorBundleName, TestSize.Level
IMSA_HILOGI("oldIme testSwitchImeWithErrorBundleName Test START");
std::string subName = InputMethodSwitchTest::imc_->GetCurrentInputMethodSubtype()->id;
int32_t ret = imc_->SwitchInputMethod(SwitchTrigger::CURRENT_IME, "error bundleName", extName[0]);
if (InputMethodSwitchTest::enableOn) {
EXPECT_EQ(ret, ErrorCode::ERROR_ENABLE_IME);
} else {
EXPECT_EQ(ret, ErrorCode::ERROR_BAD_PARAMETERS);
}
EXPECT_NE(ret, ErrorCode::NO_ERROR);
CheckCurrentProp(subName);
CheckCurrentSubProp(subName);
CheckCurrentSubProps();
@ -285,11 +277,7 @@ HWTEST_F(InputMethodSwitchTest, testSwitchImeWithErrorBundleNameWitchEmptySubNam
IMSA_HILOGI("oldIme testSwitchImeWithErrorBundleNameWitchEmptySubName Test START");
std::string subName = InputMethodSwitchTest::imc_->GetCurrentInputMethodSubtype()->id;
int32_t ret = imc_->SwitchInputMethod(SwitchTrigger::CURRENT_IME, "error bundleName", " ");
if (InputMethodSwitchTest::enableOn) {
EXPECT_EQ(ret, ErrorCode::ERROR_ENABLE_IME);
} else {
EXPECT_EQ(ret, ErrorCode::ERROR_BAD_PARAMETERS);
}
EXPECT_NE(ret, ErrorCode::NO_ERROR);
CheckCurrentProp(subName);
CheckCurrentSubProp(subName);
CheckCurrentSubProps();

View File

@ -44,7 +44,6 @@ public:
static std::vector<std::string> subName;
static std::vector<std::string> locale;
static std::vector<std::string> language;
static bool enableOn;
static std::string beforeValue;
static std::string allEnableIme;
};
@ -54,7 +53,6 @@ std::string NewImeSwitchTest::extName = "InputMethodExtAbility";
std::vector<std::string> NewImeSwitchTest::subName{ "lowerInput", "upperInput", "chineseInput" };
std::vector<std::string> NewImeSwitchTest::locale{ "en-US", "en-US", "zh-CN" };
std::vector<std::string> NewImeSwitchTest::language{ "english", "english", "chinese" };
bool NewImeSwitchTest::enableOn = false;
std::string NewImeSwitchTest::beforeValue;
std::string NewImeSwitchTest::allEnableIme = "{\"enableImeList\" : {\"100\" : [ \"com.example.newTestIme\"]}}";
constexpr uint32_t IME_SUBTYPE_NUM = 3;
@ -80,10 +78,8 @@ void NewImeSwitchTest::SetUpTestCase(void)
void NewImeSwitchTest::TearDownTestCase(void)
{
IMSA_HILOGI("NewImeSwitchTest::TearDownTestCase");
if (enableOn) {
TddUtil::GrantNativePermission();
TddUtil::PushEnableImeValue(ENABLE_IME_KEYWORD, beforeValue);
}
TddUtil::GrantNativePermission();
TddUtil::PushEnableImeValue(ENABLE_IME_KEYWORD, beforeValue);
InputMethodController::GetInstance()->Close();
TddUtil::RestoreSelfTokenID();
}