mirror of
https://gitee.com/openharmony/inputmethod_imf
synced 2024-11-23 06:40:06 +00:00
commit
db2a0d4a83
@ -56,13 +56,12 @@
|
||||
},
|
||||
"build": {
|
||||
"group_type": {
|
||||
"base_group": [ ],
|
||||
"base_group": ["//base/inputmethod/imf/common:inputmethod_common"],
|
||||
"fwk_group": [
|
||||
"//base/inputmethod/imf/interfaces/inner_api/inputmethod_controller:inputmethod_client",
|
||||
"//base/inputmethod/imf/frameworks/js/napi/inputmethodclient:inputmethod",
|
||||
"//base/inputmethod/imf/frameworks/js/napi/inputmethodlist:inputmethodlist",
|
||||
"//base/inputmethod/imf/frameworks/js/napi/inputmethodpanel:panel",
|
||||
"//base/inputmethod/imf/services/dfx:inputmethod_dfx_static"
|
||||
"//base/inputmethod/imf/frameworks/js/napi/inputmethodpanel:panel"
|
||||
],
|
||||
"service_group": [
|
||||
"//base/inputmethod/imf/etc/init:inputmethodservice.cfg",
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2021-2022 Huawei Device Co., Ltd.
|
||||
# Copyright (c) 2024 Huawei Device Co., Ltd.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
@ -14,34 +14,53 @@
|
||||
import("//base/inputmethod/imf/inputmethod.gni")
|
||||
import("//build/ohos.gni")
|
||||
|
||||
ohos_static_library("inputmethod_dfx_static") {
|
||||
config("inputmethod_common_native_config") {
|
||||
visibility = [ ":*" ]
|
||||
include_dirs = [
|
||||
"include",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/include",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_ability/include",
|
||||
]
|
||||
}
|
||||
|
||||
ohos_shared_library("inputmethod_common") {
|
||||
branch_protector_ret = "pac_ret"
|
||||
sanitize = {
|
||||
cfi = true
|
||||
cfi_cross_dso = true
|
||||
debug = false
|
||||
}
|
||||
cflags_cc = [
|
||||
"-fdata-sections",
|
||||
"-ffunction-sections",
|
||||
"-Os",
|
||||
]
|
||||
sources = [
|
||||
"src/global.cpp",
|
||||
"src/input_death_recipient.cpp",
|
||||
"src/inputmethod_dump.cpp",
|
||||
"src/inputmethod_sysevent.cpp",
|
||||
"src/inputmethod_trace.cpp",
|
||||
"src/itypes_util.cpp",
|
||||
"src/message.cpp",
|
||||
"src/message_handler.cpp",
|
||||
]
|
||||
|
||||
include_dirs = [
|
||||
"include",
|
||||
"${inputmethod_path}/services/include",
|
||||
]
|
||||
configs = [ ":inputmethod_common_native_config" ]
|
||||
|
||||
cflags_cc = [ "-fvisibility=hidden" ]
|
||||
public_configs = [ ":inputmethod_common_native_config" ]
|
||||
|
||||
external_deps = [
|
||||
"ability_base:want",
|
||||
"c_utils:utils",
|
||||
"hilog:libhilog",
|
||||
"hisysevent:libhisysevent",
|
||||
"hitrace:hitrace_meter",
|
||||
"hitrace:libhitracechain",
|
||||
"input:libmmi-client",
|
||||
"ipc:ipc_single",
|
||||
]
|
||||
|
||||
subsystem_name = "inputmethod"
|
||||
part_name = "imf"
|
||||
}
|
@ -16,8 +16,6 @@
|
||||
#include "itypes_util.h"
|
||||
|
||||
#include "global.h"
|
||||
#include "input_client_proxy.h"
|
||||
#include "input_data_channel_proxy.h"
|
||||
#include "iremote_object.h"
|
||||
|
||||
namespace OHOS {
|
||||
@ -122,6 +120,7 @@ bool ITypesUtil::Unmarshalling(sptr<IRemoteObject> &output, MessageParcel &data)
|
||||
output = data.ReadRemoteObject();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ITypesUtil::Marshalling(const Property &input, MessageParcel &data)
|
||||
{
|
||||
if (!Marshal(data, input.name, input.id, input.label, input.labelId, input.icon, input.iconId)) {
|
||||
@ -250,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.client->AsObject(), input.channel->AsObject())) {
|
||||
input.state, input.isNotifyInputStart)) {
|
||||
IMSA_HILOGE("write InputClientInfo to message parcel failed");
|
||||
return false;
|
||||
}
|
||||
@ -264,14 +263,6 @@ bool ITypesUtil::Unmarshalling(InputClientInfo &output, MessageParcel &data)
|
||||
IMSA_HILOGE("read InputClientInfo from message parcel failed");
|
||||
return false;
|
||||
}
|
||||
auto client = data.ReadRemoteObject();
|
||||
auto channel = data.ReadRemoteObject();
|
||||
if (client == nullptr || channel == nullptr) {
|
||||
IMSA_HILOGE("read remote object failed");
|
||||
return false;
|
||||
}
|
||||
output.client = iface_cast<IInputClient>(client);
|
||||
output.channel = iface_cast<IInputDataChannel>(channel);
|
||||
return true;
|
||||
}
|
||||
|
@ -30,7 +30,6 @@ config("inputmethod_js_common_public_config") {
|
||||
include_dirs = [
|
||||
"./",
|
||||
"${inputmethod_path}/frameworks/common",
|
||||
"${inputmethod_path}/services/dfx/include",
|
||||
]
|
||||
}
|
||||
|
||||
@ -49,7 +48,7 @@ ohos_static_library("inputmethod_js_common") {
|
||||
]
|
||||
configs = [ ":inputmethod_js_common_config" ]
|
||||
public_configs = [ ":inputmethod_js_common_public_config" ]
|
||||
deps = [ "${inputmethod_path}/services/dfx:inputmethod_dfx_static" ]
|
||||
deps = [ "${inputmethod_path}/common:inputmethod_common" ]
|
||||
external_deps = [ "napi:ace_napi" ]
|
||||
subsystem_name = "inputmethod"
|
||||
part_name = "imf"
|
||||
|
@ -18,18 +18,19 @@ config("inputmethodengine_native_config") {
|
||||
visibility = [ ":*" ]
|
||||
include_dirs = [
|
||||
"include",
|
||||
"${inputmethod_path}/common",
|
||||
"${inputmethod_path}/common/include",
|
||||
"${inputmethod_path}/frameworks/common",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_ability/include",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/include",
|
||||
"${inputmethod_path}/interfaces/inner_api/inputmethod_controller/include",
|
||||
"${inputmethod_path}/services/dfx/include",
|
||||
]
|
||||
ldflags = [ "-Wl,--exclude-libs=ALL" ]
|
||||
cflags = [
|
||||
cflags_cc = [
|
||||
"-fvisibility=hidden",
|
||||
"-fvisibility-inlines-hidden",
|
||||
"-fdata-sections",
|
||||
"-ffunction-sections",
|
||||
"-fvisibility=hidden",
|
||||
"-Os",
|
||||
]
|
||||
}
|
||||
|
||||
@ -37,7 +38,7 @@ config("inputmethodengine_native_public_config") {
|
||||
visibility = [ "./*" ]
|
||||
include_dirs = [
|
||||
"include",
|
||||
"${inputmethod_path}/common",
|
||||
"${inputmethod_path}/common/include",
|
||||
"${inputmethod_path}/frameworks/common",
|
||||
"${inputmethod_path}/frameworks/js/napi/inputmethodclient",
|
||||
"${inputmethod_path}/frameworks/js/napi/inputmethodability",
|
||||
@ -55,7 +56,6 @@ ohos_shared_library("inputmethodengine") {
|
||||
"${inputmethod_path}/frameworks/js/napi/inputmethodclient/async_call.cpp",
|
||||
"${inputmethod_path}/frameworks/js/napi/inputmethodclient/js_utils.cpp",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/keyevent_consumer_proxy.cpp",
|
||||
"${inputmethod_path}/services/src/global.cpp",
|
||||
"input_method_engine_module.cpp",
|
||||
"js_input_method_engine_setting.cpp",
|
||||
"js_keyboard_controller_engine.cpp",
|
||||
@ -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}/services/dfx:inputmethod_dfx_static",
|
||||
]
|
||||
|
||||
external_deps = [
|
||||
|
@ -24,7 +24,6 @@
|
||||
#include "js_util.h"
|
||||
#include "js_utils.h"
|
||||
#include "key_event_napi.h"
|
||||
#include "keyevent_consumer_proxy.h"
|
||||
#include "napi/native_api.h"
|
||||
#include "napi/native_node_api.h"
|
||||
|
||||
|
@ -42,10 +42,6 @@ ohos_shared_library("inputmethod") {
|
||||
debug = false
|
||||
}
|
||||
sources = [
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_client_proxy.cpp",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_data_channel_proxy.cpp",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/itypes_util.cpp",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/keyevent_consumer_proxy.cpp",
|
||||
"async_call.cpp",
|
||||
"input_method_module.cpp",
|
||||
"js_get_input_method_controller.cpp",
|
||||
|
@ -24,7 +24,6 @@
|
||||
#include "js_input_method.h"
|
||||
#include "js_util.h"
|
||||
#include "js_utils.h"
|
||||
#include "keyevent_consumer_proxy.h"
|
||||
#include "napi/native_api.h"
|
||||
#include "napi/native_node_api.h"
|
||||
#include "string_ex.h"
|
||||
|
@ -18,6 +18,7 @@ config("inputmethod_panel_config") {
|
||||
visibility = [ ":*" ]
|
||||
include_dirs = [
|
||||
"./",
|
||||
"${inputmethod_path}/common/include",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_ability/include",
|
||||
]
|
||||
}
|
||||
@ -30,7 +31,6 @@ ohos_shared_library("panel") {
|
||||
debug = false
|
||||
}
|
||||
sources = [
|
||||
"${inputmethod_path}/services/src/global.cpp",
|
||||
"input_method_panel_module.cpp",
|
||||
"js_input_method_panel.cpp",
|
||||
]
|
||||
|
@ -39,12 +39,16 @@ ohos_shared_library("inputmethod_extension") {
|
||||
cfi_cross_dso = true
|
||||
debug = false
|
||||
}
|
||||
cflags_cc = [
|
||||
"-fdata-sections",
|
||||
"-ffunction-sections",
|
||||
"-Os",
|
||||
]
|
||||
include_dirs = [
|
||||
"${inputmethod_path}/frameworks/kits/extension/include",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/include",
|
||||
"${inputmethod_path}/interfaces/inner_api/inputmethod_controller/include",
|
||||
"${inputmethod_path}/services/include",
|
||||
"${inputmethod_path}/services/dfx/include",
|
||||
"${inputmethod_path}/common/include",
|
||||
]
|
||||
|
||||
sources = [
|
||||
@ -52,14 +56,13 @@ ohos_shared_library("inputmethod_extension") {
|
||||
"${inputmethod_path}/frameworks/kits/extension/src/inputmethod_extension_context.cpp",
|
||||
"${inputmethod_path}/frameworks/kits/extension/src/js_inputmethod_extension.cpp",
|
||||
"${inputmethod_path}/frameworks/kits/extension/src/js_inputmethod_extension_context.cpp",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/keyevent_consumer_proxy.cpp",
|
||||
]
|
||||
configs = [ ":ability_config" ]
|
||||
public_configs = [ ":ability_public_config" ]
|
||||
|
||||
deps = [
|
||||
"${inputmethod_path}/common:inputmethod_common",
|
||||
"${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability",
|
||||
"${inputmethod_path}/services/dfx:inputmethod_dfx_static",
|
||||
]
|
||||
|
||||
external_deps = [
|
||||
@ -75,7 +78,9 @@ ohos_shared_library("inputmethod_extension") {
|
||||
"eventhandler:libeventhandler",
|
||||
"hilog:libhilog",
|
||||
"i18n:intl_util",
|
||||
"input:libmmi-client",
|
||||
"ipc:ipc_napi",
|
||||
"ipc:ipc_single",
|
||||
"napi:ace_napi",
|
||||
"samgr:samgr_proxy",
|
||||
"window_manager:libdm",
|
||||
@ -92,7 +97,7 @@ ohos_shared_library("inputmethod_extension_module") {
|
||||
cfi_cross_dso = true
|
||||
debug = false
|
||||
}
|
||||
include_dirs = [ "${inputmethod_path}/services/include" ]
|
||||
include_dirs = [ "${inputmethod_path}/common/include" ]
|
||||
|
||||
sources = [ "${inputmethod_path}/frameworks/kits/extension/src/inputmethod_extension_module_loader.cpp" ]
|
||||
|
||||
|
@ -18,8 +18,6 @@
|
||||
|
||||
#include "global.h"
|
||||
#include "i_input_control_channel.h"
|
||||
#include "i_input_data_channel.h"
|
||||
#include "i_system_cmd_channel.h"
|
||||
#include "input_attribute.h"
|
||||
#include "input_client_info.h"
|
||||
#include "input_method_property.h"
|
||||
@ -54,7 +52,7 @@ public:
|
||||
DECLARE_INTERFACE_DESCRIPTOR(u"ohos.miscservices.inputmethod.IInputMethodCore");
|
||||
|
||||
virtual int32_t StartInput(const InputClientInfo &clientInfo, bool isBindFromClient) = 0;
|
||||
virtual int32_t StopInput(const sptr<IInputDataChannel> &channel) = 0;
|
||||
virtual int32_t StopInput(const sptr<IRemoteObject> &channel) = 0;
|
||||
virtual int32_t ShowKeyboard() = 0;
|
||||
virtual int32_t HideKeyboard() = 0;
|
||||
virtual int32_t InitInputControlChannel(const sptr<IInputControlChannel> &inputControlChannel) = 0;
|
||||
@ -63,8 +61,8 @@ public:
|
||||
virtual bool IsEnable() = 0;
|
||||
virtual int32_t IsPanelShown(const PanelInfo &panelInfo, bool &isShown) = 0;
|
||||
virtual int32_t OnSecurityChange(int32_t security) = 0 ;
|
||||
virtual int32_t OnConnectSystemCmd(const sptr<ISystemCmdChannel> &channel, sptr<IRemoteObject> &agent) = 0 ;
|
||||
virtual void OnClientInactive(const sptr<IInputDataChannel> &channel) = 0;
|
||||
virtual int32_t OnConnectSystemCmd(const sptr<IRemoteObject> &channel, sptr<IRemoteObject> &agent) = 0 ;
|
||||
virtual void OnClientInactive(const sptr<IRemoteObject> &channel) = 0;
|
||||
};
|
||||
} // namespace MiscServices
|
||||
} // namespace OHOS
|
||||
|
@ -25,14 +25,12 @@
|
||||
#include "i_input_data_channel.h"
|
||||
#include "i_input_method_agent.h"
|
||||
#include "i_input_method_core.h"
|
||||
#include "i_input_method_system_ability.h"
|
||||
#include "input_attribute.h"
|
||||
#include "input_control_channel_proxy.h"
|
||||
#include "input_data_channel_proxy.h"
|
||||
#include "input_method_agent_stub.h"
|
||||
#include "input_method_core_stub.h"
|
||||
#include "input_method_engine_listener.h"
|
||||
#include "input_method_panel.h"
|
||||
#include "input_method_system_ability_proxy.h"
|
||||
#include "iremote_object.h"
|
||||
#include "keyboard_listener.h"
|
||||
#include "keyevent_consumer_proxy.h"
|
||||
@ -159,9 +157,10 @@ private:
|
||||
|
||||
ConcurrentMap<PanelType, std::shared_ptr<InputMethodPanel>> panels_{};
|
||||
std::atomic_bool isBound_{ false };
|
||||
sptr<InputMethodCoreStub> coreStub_{ nullptr };
|
||||
sptr<InputMethodAgentStub> agentStub_{ nullptr };
|
||||
sptr<InputMethodAgentStub> systemAgentStub_{ nullptr };
|
||||
|
||||
sptr<IInputMethodCore> coreStub_{ nullptr };
|
||||
sptr<IInputMethodAgent> agentStub_{ nullptr };
|
||||
sptr<IInputMethodAgent> systemAgentStub_{ nullptr };
|
||||
std::mutex imeCheckMutex_;
|
||||
bool isCurrentIme_ = false;
|
||||
|
||||
|
@ -24,7 +24,6 @@
|
||||
#include "iremote_broker.h"
|
||||
#include "iremote_object.h"
|
||||
#include "iremote_proxy.h"
|
||||
#include "keyevent_consumer_proxy.h"
|
||||
#include "message_parcel.h"
|
||||
#include "nocopyable.h"
|
||||
#include "refbase.h"
|
||||
|
@ -18,7 +18,6 @@
|
||||
|
||||
#include "i_input_method_agent.h"
|
||||
#include "iremote_stub.h"
|
||||
#include "keyevent_consumer_proxy.h"
|
||||
#include "message_handler.h"
|
||||
#include "message_option.h"
|
||||
#include "message_parcel.h"
|
||||
|
@ -16,8 +16,6 @@
|
||||
#ifndef FRAMEWORKS_INPUTMETHOD_ABILITY_INCLUDE_INPUT_METHOD_CORE_PROXY_H
|
||||
#define FRAMEWORKS_INPUTMETHOD_ABILITY_INCLUDE_INPUT_METHOD_CORE_PROXY_H
|
||||
|
||||
#include "i_input_control_channel.h"
|
||||
#include "i_input_data_channel.h"
|
||||
#include "i_input_method_core.h"
|
||||
#include "input_attribute.h"
|
||||
#include "input_method_property.h"
|
||||
@ -36,7 +34,7 @@ public:
|
||||
DISALLOW_COPY_AND_MOVE(InputMethodCoreProxy);
|
||||
|
||||
int32_t StartInput(const InputClientInfo &clientInfo, bool isBindFromClient) override;
|
||||
int32_t StopInput(const sptr<IInputDataChannel> &channel) override;
|
||||
int32_t StopInput(const sptr<IRemoteObject> &channel) override;
|
||||
int32_t ShowKeyboard() override;
|
||||
int32_t HideKeyboard() override;
|
||||
int32_t InitInputControlChannel(const sptr<IInputControlChannel> &inputControlChannel) override;
|
||||
@ -45,8 +43,8 @@ public:
|
||||
bool IsEnable() override;
|
||||
int32_t IsPanelShown(const PanelInfo &panelInfo, bool &isShown) override;
|
||||
int32_t OnSecurityChange(int32_t security) override;
|
||||
int32_t OnConnectSystemCmd(const sptr<ISystemCmdChannel> &channel, sptr<IRemoteObject> &agent) override;
|
||||
void OnClientInactive(const sptr<IInputDataChannel> &channel) override;
|
||||
int32_t OnConnectSystemCmd(const sptr<IRemoteObject> &channel, sptr<IRemoteObject> &agent) override;
|
||||
void OnClientInactive(const sptr<IRemoteObject> &channel) override;
|
||||
|
||||
private:
|
||||
static inline BrokerDelegator<InputMethodCoreProxy> delegator_;
|
||||
|
@ -20,9 +20,6 @@
|
||||
#include <cstdint>
|
||||
#include <mutex>
|
||||
|
||||
#include "i_input_control_channel.h"
|
||||
#include "i_input_data_channel.h"
|
||||
#include "i_input_method_agent.h"
|
||||
#include "i_input_method_core.h"
|
||||
#include "input_attribute.h"
|
||||
#include "iremote_broker.h"
|
||||
@ -39,7 +36,7 @@ public:
|
||||
virtual ~InputMethodCoreStub();
|
||||
int OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
|
||||
int32_t StartInput(const InputClientInfo &clientInfo, bool isBindFromClient) override;
|
||||
int32_t StopInput(const sptr<IInputDataChannel> &channel) override;
|
||||
int32_t StopInput(const sptr<IRemoteObject> &channel) override;
|
||||
int32_t ShowKeyboard() override;
|
||||
int32_t HideKeyboard() override;
|
||||
int32_t InitInputControlChannel(const sptr<IInputControlChannel> &inputControlChannel) override;
|
||||
@ -48,8 +45,8 @@ public:
|
||||
bool IsEnable() override;
|
||||
int32_t IsPanelShown(const PanelInfo &panelInfo, bool &isShown) override;
|
||||
int32_t OnSecurityChange(int32_t security) override;
|
||||
int32_t OnConnectSystemCmd(const sptr<ISystemCmdChannel> &channel, sptr<IRemoteObject> &agent) override;
|
||||
void OnClientInactive(const sptr<IInputDataChannel> &channel) override;
|
||||
int32_t OnConnectSystemCmd(const sptr<IRemoteObject> &channel, sptr<IRemoteObject> &agent) override;
|
||||
void OnClientInactive(const sptr<IRemoteObject> &channel) override;
|
||||
void SetMessageHandler(MessageHandler *msgHandler);
|
||||
|
||||
private:
|
||||
|
@ -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 {
|
||||
|
@ -20,8 +20,9 @@
|
||||
#include <utility>
|
||||
|
||||
#include "global.h"
|
||||
#include "input_method_agent_proxy.h"
|
||||
#include "input_method_core_proxy.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"
|
||||
@ -119,7 +120,7 @@ int32_t InputMethodAbility::SetCoreAndAgent()
|
||||
IMSA_HILOGE("imsa proxy is nullptr");
|
||||
return ErrorCode::ERROR_NULL_POINTER;
|
||||
}
|
||||
int32_t ret = proxy->SetCoreAndAgent(coreStub_, agentStub_);
|
||||
int32_t ret = proxy->SetCoreAndAgent(coreStub_, agentStub_->AsObject());
|
||||
if (ret != ErrorCode::NO_ERROR) {
|
||||
IMSA_HILOGE("set failed, ret: %{public}d", ret);
|
||||
return ret;
|
||||
@ -143,13 +144,13 @@ int32_t InputMethodAbility::UnRegisteredProxyIme(UnRegisteredType type)
|
||||
void InputMethodAbility::Initialize()
|
||||
{
|
||||
IMSA_HILOGD("IMA");
|
||||
coreStub_ = new (std::nothrow) InputMethodCoreStub();
|
||||
if (coreStub_ == nullptr) {
|
||||
sptr<InputMethodCoreStub> coreStub = new (std::nothrow) InputMethodCoreStub();
|
||||
if (coreStub == nullptr) {
|
||||
IMSA_HILOGE("failed to create core");
|
||||
return;
|
||||
}
|
||||
agentStub_ = new (std::nothrow) InputMethodAgentStub();
|
||||
if (agentStub_ == nullptr) {
|
||||
sptr<InputMethodAgentStub> agentStub = new (std::nothrow) InputMethodAgentStub();
|
||||
if (agentStub == nullptr) {
|
||||
IMSA_HILOGE("failed to create agent");
|
||||
return;
|
||||
}
|
||||
@ -158,8 +159,10 @@ void InputMethodAbility::Initialize()
|
||||
IMSA_HILOGE("failed to create message handler");
|
||||
return;
|
||||
}
|
||||
coreStub_->SetMessageHandler(msgHandler_);
|
||||
agentStub_->SetMessageHandler(msgHandler_);
|
||||
coreStub->SetMessageHandler(msgHandler_);
|
||||
agentStub->SetMessageHandler(msgHandler_);
|
||||
agentStub_ = agentStub;
|
||||
coreStub_ = coreStub;
|
||||
workThreadHandler = std::thread([this] { WorkThread(); });
|
||||
}
|
||||
|
||||
@ -233,13 +236,13 @@ void InputMethodAbility::OnInitInputControlChannel(Message *msg)
|
||||
|
||||
int32_t InputMethodAbility::StartInput(const InputClientInfo &clientInfo, bool isBindFromClient)
|
||||
{
|
||||
if (clientInfo.channel->AsObject() == nullptr) {
|
||||
if (clientInfo.channel == nullptr) {
|
||||
IMSA_HILOGE("channelObject is nullptr");
|
||||
return ErrorCode::ERROR_CLIENT_NULL_POINTER;
|
||||
}
|
||||
IMSA_HILOGI(
|
||||
"IMA isShowKeyboard: %{public}d, isBindFromClient: %{public}d", clientInfo.isShowKeyboard, isBindFromClient);
|
||||
SetInputDataChannel(clientInfo.channel->AsObject());
|
||||
SetInputDataChannel(clientInfo.channel);
|
||||
isBindFromClient ? InvokeTextChangeCallback(clientInfo.config) : NotifyAllTextConfig();
|
||||
SetInputAttribute(clientInfo.config.inputAttribute);
|
||||
if (imeListener_ == nullptr) {
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include "global.h"
|
||||
#include "input_method_ability.h"
|
||||
#include "ipc_skeleton.h"
|
||||
#include "itypes_util.h"
|
||||
#include "message.h"
|
||||
#include "message_handler.h"
|
||||
|
||||
|
@ -42,7 +42,7 @@ int32_t InputMethodCoreProxy::StartInput(const InputClientInfo &clientInfo, bool
|
||||
{
|
||||
IMSA_HILOGI("CoreProxy");
|
||||
return SendRequest(START_INPUT, [&clientInfo, isBindFromClient](MessageParcel &data) {
|
||||
return ITypesUtil::Marshal(data, isBindFromClient, clientInfo);
|
||||
return ITypesUtil::Marshal(data, isBindFromClient, clientInfo, clientInfo.channel);
|
||||
});
|
||||
}
|
||||
|
||||
@ -53,13 +53,11 @@ int32_t InputMethodCoreProxy::OnSecurityChange(int32_t security)
|
||||
});
|
||||
}
|
||||
|
||||
int32_t InputMethodCoreProxy::OnConnectSystemCmd(const sptr<ISystemCmdChannel> &channel, sptr<IRemoteObject> &agent)
|
||||
int32_t InputMethodCoreProxy::OnConnectSystemCmd(const sptr<IRemoteObject> &channel, sptr<IRemoteObject> &agent)
|
||||
{
|
||||
return SendRequest(ON_CONNECT_SYSTEM_CMD, [channel](MessageParcel& data) {
|
||||
return data.WriteRemoteObject(channel->AsObject());
|
||||
}, [&agent](MessageParcel &reply) {
|
||||
return ITypesUtil::Unmarshal(reply, agent);
|
||||
});
|
||||
return SendRequest(
|
||||
ON_CONNECT_SYSTEM_CMD, [channel](MessageParcel &data) { return data.WriteRemoteObject(channel); },
|
||||
[&agent](MessageParcel &reply) { return ITypesUtil::Unmarshal(reply, agent); });
|
||||
}
|
||||
|
||||
void InputMethodCoreProxy::StopInputService(bool isTerminateIme)
|
||||
@ -83,10 +81,9 @@ int32_t InputMethodCoreProxy::SetSubtype(const SubProperty &property)
|
||||
return SendRequest(SET_SUBTYPE, [&property](MessageParcel &data) { return ITypesUtil::Marshal(data, property); });
|
||||
}
|
||||
|
||||
int32_t InputMethodCoreProxy::StopInput(const sptr<IInputDataChannel> &channel)
|
||||
int32_t InputMethodCoreProxy::StopInput(const sptr<IRemoteObject> &channel)
|
||||
{
|
||||
return SendRequest(
|
||||
STOP_INPUT, [&channel](MessageParcel &data) { return ITypesUtil::Marshal(data, channel->AsObject()); });
|
||||
return SendRequest(STOP_INPUT, [&channel](MessageParcel &data) { return ITypesUtil::Marshal(data, channel); });
|
||||
}
|
||||
|
||||
bool InputMethodCoreProxy::IsEnable()
|
||||
@ -104,11 +101,11 @@ int32_t InputMethodCoreProxy::IsPanelShown(const PanelInfo &panelInfo, bool &isS
|
||||
[&isShown](MessageParcel &reply) { return ITypesUtil::Unmarshal(reply, isShown); });
|
||||
}
|
||||
|
||||
void InputMethodCoreProxy::OnClientInactive(const sptr<IInputDataChannel> &channel)
|
||||
void InputMethodCoreProxy::OnClientInactive(const sptr<IRemoteObject> &channel)
|
||||
{
|
||||
SendRequest(
|
||||
ON_CLIENT_INACTIVE, [&channel](MessageParcel &data) { return ITypesUtil::Marshal(data, channel->AsObject()); },
|
||||
nullptr, MessageOption::TF_ASYNC);
|
||||
ON_CLIENT_INACTIVE, [&channel](MessageParcel &data) { return ITypesUtil::Marshal(data, channel); }, nullptr,
|
||||
MessageOption::TF_ASYNC);
|
||||
}
|
||||
|
||||
int32_t InputMethodCoreProxy::SendRequest(int code, ParcelHandler input, ParcelHandler output, MessageOption option)
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "system_cmd_channel_proxy.h"
|
||||
#include "input_method_ability.h"
|
||||
#include "ipc_skeleton.h"
|
||||
#include "itypes_util.h"
|
||||
#include "message_handler.h"
|
||||
#include "message_parcel.h"
|
||||
|
||||
@ -105,7 +106,8 @@ int32_t InputMethodCoreStub::StartInputOnRemote(MessageParcel &data, MessageParc
|
||||
"CoreStub, callingPid/Uid: %{public}d/%{public}d", IPCSkeleton::GetCallingPid(), IPCSkeleton::GetCallingUid());
|
||||
bool isBindFromClient = false;
|
||||
InputClientInfo clientInfo = {};
|
||||
if (!ITypesUtil::Unmarshal(data, isBindFromClient, clientInfo)) {
|
||||
sptr<IRemoteObject> channel = nullptr;
|
||||
if (!ITypesUtil::Unmarshal(data, isBindFromClient, clientInfo, clientInfo.channel)) {
|
||||
IMSA_HILOGE("Unmarshal failed.");
|
||||
return ErrorCode::ERROR_EX_PARCELABLE;
|
||||
}
|
||||
@ -124,7 +126,7 @@ int32_t InputMethodCoreStub::SecurityChangeOnRemote(MessageParcel &data, Message
|
||||
return ITypesUtil::Marshal(reply, ret) ? ErrorCode::NO_ERROR : ErrorCode::ERROR_EX_PARCELABLE;
|
||||
}
|
||||
|
||||
int32_t InputMethodCoreStub::OnConnectSystemCmd(const sptr<ISystemCmdChannel> &channel, sptr<IRemoteObject> &agent)
|
||||
int32_t InputMethodCoreStub::OnConnectSystemCmd(const sptr<IRemoteObject> &channel, sptr<IRemoteObject> &agent)
|
||||
{
|
||||
return ErrorCode::NO_ERROR;
|
||||
}
|
||||
@ -230,7 +232,7 @@ int32_t InputMethodCoreStub::OnSecurityChange(int32_t security)
|
||||
return ErrorCode::NO_ERROR;
|
||||
}
|
||||
|
||||
int32_t InputMethodCoreStub::StopInput(const sptr<IInputDataChannel> &channel)
|
||||
int32_t InputMethodCoreStub::StopInput(const sptr<IRemoteObject> &channel)
|
||||
{
|
||||
return ErrorCode::NO_ERROR;
|
||||
}
|
||||
@ -245,7 +247,7 @@ int32_t InputMethodCoreStub::IsPanelShown(const PanelInfo &panelInfo, bool &isSh
|
||||
return InputMethodAbility::GetInstance()->IsPanelShown(panelInfo, isShown);
|
||||
}
|
||||
|
||||
void InputMethodCoreStub::OnClientInactive(const sptr<IInputDataChannel> &channel)
|
||||
void InputMethodCoreStub::OnClientInactive(const sptr<IRemoteObject> &channel)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
#ifndef FRAMEWORKS_INPUTMETHOD_CONTROLLER_INCLUDE_LISTEN_EVENT_MANAGER_H
|
||||
#define FRAMEWORKS_INPUTMETHOD_CONTROLLER_INCLUDE_LISTEN_EVENT_MANAGER_H
|
||||
|
||||
#include "ime_event_monitor_manager.h"
|
||||
#include "ime_event_listener.h"
|
||||
|
||||
namespace OHOS {
|
||||
namespace MiscServices {
|
||||
|
@ -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"
|
||||
@ -39,7 +38,7 @@ public:
|
||||
|
||||
DECLARE_INTERFACE_DESCRIPTOR(u"ohos.miscservices.inputmethod.InputClient");
|
||||
|
||||
virtual int32_t OnInputReady(const sptr<IInputMethodAgent> &agent) = 0;
|
||||
virtual int32_t OnInputReady(const sptr<IRemoteObject> &agent) = 0;
|
||||
virtual int32_t OnInputStop() = 0;
|
||||
virtual int32_t OnSwitchInput(const Property &property, const SubProperty &subProperty) = 0;
|
||||
virtual int32_t OnPanelStatusChange(const InputWindowStatus &status, const ImeWindowInfo &info) = 0;
|
||||
|
@ -37,7 +37,7 @@ struct InputClientInfo {
|
||||
uint32_t eventFlag{ NO_EVENT_ON }; // the flag of the all listen event
|
||||
InputAttribute attribute; // the input client attribute
|
||||
sptr<IInputClient> client{ nullptr }; // the remote object handler for service to callback input client
|
||||
sptr<IInputDataChannel> channel{ nullptr }; // the remote object handler for ime to callback input client
|
||||
sptr<IRemoteObject> channel{ nullptr }; // the remote object handler for ime to callback input client
|
||||
sptr<InputDeathRecipient> deathRecipient{ nullptr }; // death recipient of client
|
||||
ClientState state{ ClientState::INACTIVE }; // the state of input client
|
||||
bool isNotifyInputStart { true };
|
||||
|
@ -20,7 +20,6 @@
|
||||
#include <functional>
|
||||
|
||||
#include "i_input_client.h"
|
||||
#include "i_input_method_agent.h"
|
||||
#include "iremote_broker.h"
|
||||
#include "iremote_object.h"
|
||||
#include "iremote_proxy.h"
|
||||
@ -35,7 +34,7 @@ public:
|
||||
~InputClientProxy() = default;
|
||||
DISALLOW_COPY_AND_MOVE(InputClientProxy);
|
||||
|
||||
int32_t OnInputReady(const sptr<IInputMethodAgent> &agent) override;
|
||||
int32_t OnInputReady(const sptr<IRemoteObject> &agent) override;
|
||||
int32_t OnInputStop() override;
|
||||
int32_t OnSwitchInput(const Property &property, const SubProperty &subProperty) override;
|
||||
int32_t OnPanelStatusChange(const InputWindowStatus &status, const ImeWindowInfo &info) override;
|
||||
|
@ -19,7 +19,6 @@
|
||||
#include <cstdint>
|
||||
|
||||
#include "i_input_client.h"
|
||||
#include "i_input_method_agent.h"
|
||||
#include "ime_event_monitor_manager.h"
|
||||
#include "iremote_stub.h"
|
||||
#include "message_handler.h"
|
||||
@ -37,7 +36,7 @@ public:
|
||||
InputClientStub();
|
||||
~InputClientStub();
|
||||
|
||||
int32_t OnInputReady(const sptr<IInputMethodAgent> &agent) override;
|
||||
int32_t OnInputReady(const sptr<IRemoteObject> &agent) override;
|
||||
int32_t OnInputStop() override;
|
||||
int32_t OnSwitchInput(const Property &property, const SubProperty &subProperty) override;
|
||||
int32_t OnPanelStatusChange(const InputWindowStatus &status, const ImeWindowInfo &info) override;
|
||||
|
@ -60,7 +60,7 @@ public:
|
||||
int32_t ListInputMethod(InputMethodStatus status, std::vector<Property> &props) override;
|
||||
int32_t SwitchInputMethod(const std::string &name, const std::string &subName, SwitchTrigger trigger) override;
|
||||
int32_t DisplayOptionalInputMethod() override;
|
||||
int32_t SetCoreAndAgent(const sptr<IInputMethodCore> &core, const sptr<IInputMethodAgent> &agent) override;
|
||||
int32_t SetCoreAndAgent(const sptr<IInputMethodCore> &core, const sptr<IRemoteObject> &agent) override;
|
||||
int32_t UnRegisteredProxyIme(UnRegisteredType type, const sptr<IInputMethodCore> &core) override;
|
||||
int32_t ListCurrentInputMethodSubtype(std::vector<SubProperty> &subProps) override;
|
||||
int32_t ListInputMethodSubtype(const std::string &name, std::vector<SubProperty> &subProps) override;
|
||||
@ -73,7 +73,7 @@ public:
|
||||
int32_t IsPanelShown(const PanelInfo &panelInfo, bool &isShown) override;
|
||||
int32_t GetSecurityMode(int32_t &security) override;
|
||||
int32_t IsDefaultIme() override;
|
||||
int32_t ConnectSystemCmd(const sptr<ISystemCmdChannel> &channel, sptr<IRemoteObject> &agent) override;
|
||||
int32_t ConnectSystemCmd(const sptr<IRemoteObject> &channel, sptr<IRemoteObject> &agent) override;
|
||||
// Deprecated because of no permission check, kept for compatibility
|
||||
int32_t HideCurrentInputDeprecated() override;
|
||||
int32_t ShowCurrentInputDeprecated() override;
|
||||
|
@ -27,10 +27,9 @@ InputClientProxy::InputClientProxy(const sptr<IRemoteObject> &object) : IRemoteP
|
||||
{
|
||||
}
|
||||
|
||||
int32_t InputClientProxy::OnInputReady(const sptr<IInputMethodAgent> &agent)
|
||||
int32_t InputClientProxy::OnInputReady(const sptr<IRemoteObject> &agent)
|
||||
{
|
||||
return SendRequest(
|
||||
ON_INPUT_READY, [agent](MessageParcel &data) { return ITypesUtil::Marshal(data, agent->AsObject()); });
|
||||
return SendRequest(ON_INPUT_READY, [agent](MessageParcel &data) { return ITypesUtil::Marshal(data, agent); });
|
||||
}
|
||||
|
||||
int32_t InputClientProxy::OnInputStop()
|
||||
|
@ -110,7 +110,7 @@ int32_t InputClientStub::DeactivateClientOnRemote(MessageParcel &data, MessagePa
|
||||
return reply.WriteInt32(ErrorCode::NO_ERROR) ? ErrorCode::NO_ERROR : ErrorCode::ERROR_EX_PARCELABLE;
|
||||
}
|
||||
|
||||
int32_t InputClientStub::OnInputReady(const sptr<IInputMethodAgent> &agent)
|
||||
int32_t InputClientStub::OnInputReady(const sptr<IRemoteObject> &agent)
|
||||
{
|
||||
return ErrorCode::NO_ERROR;
|
||||
}
|
||||
|
@ -115,19 +115,18 @@ void InputMethodController::SetControllerListener(std::shared_ptr<ControllerList
|
||||
|
||||
int32_t InputMethodController::Initialize()
|
||||
{
|
||||
auto client = new (std::nothrow) InputClientStub();
|
||||
sptr<IInputClient> client = new (std::nothrow) InputClientStub();
|
||||
if (client == nullptr) {
|
||||
IMSA_HILOGE("failed to new client");
|
||||
return ErrorCode::ERROR_NULL_POINTER;
|
||||
}
|
||||
auto channel = new (std::nothrow) InputDataChannelStub();
|
||||
sptr<IInputDataChannel> channel = new (std::nothrow) InputDataChannelStub();
|
||||
if (channel == nullptr) {
|
||||
delete client;
|
||||
IMSA_HILOGE("failed to new channel");
|
||||
return ErrorCode::ERROR_NULL_POINTER;
|
||||
}
|
||||
InputAttribute attribute = { .inputPattern = InputAttribute::PATTERN_TEXT };
|
||||
clientInfo_ = { .attribute = attribute, .client = client, .channel = channel };
|
||||
clientInfo_ = { .attribute = attribute, .client = client, .channel = channel->AsObject() };
|
||||
|
||||
// make AppExecFwk::EventHandler handler
|
||||
handler_ = std::make_shared<AppExecFwk::EventHandler>(AppExecFwk::EventRunner::GetMainEventRunner());
|
||||
|
@ -34,22 +34,22 @@ int32_t InputMethodSystemAbilityProxy::StartInput(InputClientInfo &inputClientIn
|
||||
{
|
||||
return SendRequest(
|
||||
static_cast<uint32_t>(InputMethodInterfaceCode::START_INPUT),
|
||||
[&inputClientInfo](MessageParcel &data) { return ITypesUtil::Marshal(data, inputClientInfo); },
|
||||
[&inputClientInfo](MessageParcel &data) {
|
||||
return ITypesUtil::Marshal(
|
||||
data, inputClientInfo, inputClientInfo.client->AsObject(), inputClientInfo.channel);
|
||||
},
|
||||
[&agent](MessageParcel &reply) {
|
||||
agent = reply.ReadRemoteObject();
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
int32_t InputMethodSystemAbilityProxy::ConnectSystemCmd(
|
||||
const sptr<ISystemCmdChannel> &channel, sptr<IRemoteObject> &agent)
|
||||
int32_t InputMethodSystemAbilityProxy::ConnectSystemCmd(const sptr<IRemoteObject> &channel, sptr<IRemoteObject> &agent)
|
||||
{
|
||||
return SendRequest(
|
||||
static_cast<uint32_t>(InputMethodInterfaceCode::CONNECT_SYSTEM_CMD),
|
||||
[channel](MessageParcel &data) { return data.WriteRemoteObject(channel->AsObject()); },
|
||||
[&agent](MessageParcel &reply) {
|
||||
return ITypesUtil::Unmarshal(reply, agent);
|
||||
});
|
||||
[channel](MessageParcel &data) { return data.WriteRemoteObject(channel); },
|
||||
[&agent](MessageParcel &reply) { return ITypesUtil::Unmarshal(reply, agent); });
|
||||
}
|
||||
|
||||
int32_t InputMethodSystemAbilityProxy::ShowCurrentInput()
|
||||
@ -101,11 +101,11 @@ int32_t InputMethodSystemAbilityProxy::DisplayOptionalInputMethod()
|
||||
}
|
||||
|
||||
int32_t InputMethodSystemAbilityProxy::SetCoreAndAgent(
|
||||
const sptr<IInputMethodCore> &core, const sptr<IInputMethodAgent> &agent)
|
||||
const sptr<IInputMethodCore> &core, const sptr<IRemoteObject> &agent)
|
||||
{
|
||||
return SendRequest(
|
||||
static_cast<uint32_t>(InputMethodInterfaceCode::SET_CORE_AND_AGENT), [core, agent](MessageParcel &data) {
|
||||
return data.WriteRemoteObject(core->AsObject()) && data.WriteRemoteObject(agent->AsObject());
|
||||
return data.WriteRemoteObject(core->AsObject()) && data.WriteRemoteObject(agent);
|
||||
});
|
||||
}
|
||||
|
||||
@ -215,7 +215,9 @@ int32_t InputMethodSystemAbilityProxy::PanelStatusChange(const InputWindowStatus
|
||||
int32_t InputMethodSystemAbilityProxy::UpdateListenEventFlag(InputClientInfo &clientInfo, uint32_t eventFlag)
|
||||
{
|
||||
return SendRequest(static_cast<uint32_t>(InputMethodInterfaceCode::UPDATE_LISTEN_EVENT_FLAG),
|
||||
[&clientInfo, eventFlag](MessageParcel &data) { return ITypesUtil::Marshal(data, clientInfo, eventFlag); });
|
||||
[&clientInfo, eventFlag](MessageParcel &data) {
|
||||
return ITypesUtil::Marshal(data, clientInfo, clientInfo.client->AsObject(), clientInfo.channel, eventFlag);
|
||||
});
|
||||
}
|
||||
|
||||
bool InputMethodSystemAbilityProxy::IsCurrentIme()
|
||||
|
@ -22,7 +22,6 @@ config("inputmethod_ability_native_config") {
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/include",
|
||||
"${inputmethod_path}/frameworks/common",
|
||||
"${inputmethod_path}/interfaces/inner_api/inputmethod_controller/include",
|
||||
"${inputmethod_path}/services/dfx/include",
|
||||
"${inputmethod_path}/services/include",
|
||||
]
|
||||
}
|
||||
@ -32,11 +31,8 @@ config("inputmethod_ability_native_public_config") {
|
||||
"include",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_ability/include",
|
||||
"${inputmethod_path}/frameworks/common",
|
||||
"${inputmethod_path}/services/dfx/include",
|
||||
"${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",
|
||||
]
|
||||
}
|
||||
|
||||
@ -51,24 +47,20 @@ ohos_shared_library("inputmethod_ability") {
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_ability/src/input_method_ability.cpp",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_ability/src/input_method_ability_interface.cpp",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_ability/src/input_method_ability_utils.cpp",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_ability/src/input_method_agent_proxy.cpp",
|
||||
"${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}/frameworks/native/inputmethod_ability/src/input_method_panel.cpp",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_client_proxy.cpp",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_data_channel_proxy.cpp",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_death_recipient.cpp",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_method_system_ability_proxy.cpp",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/itypes_util.cpp",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/keyevent_consumer_proxy.cpp",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/system_cmd_channel_proxy.cpp",
|
||||
"${inputmethod_path}/services/src/global.cpp",
|
||||
"${inputmethod_path}/services/src/input_control_channel_proxy.cpp",
|
||||
"${inputmethod_path}/services/src/message.cpp",
|
||||
"${inputmethod_path}/services/src/message_handler.cpp",
|
||||
]
|
||||
|
||||
cflags_cc = [
|
||||
"-fdata-sections",
|
||||
"-ffunction-sections",
|
||||
"-Os",
|
||||
]
|
||||
version_script = "inputmethod_ability.versionscript"
|
||||
|
||||
configs = [ ":inputmethod_ability_native_config" ]
|
||||
@ -88,7 +80,7 @@ ohos_shared_library("inputmethod_ability") {
|
||||
"window_manager:libwm",
|
||||
]
|
||||
|
||||
deps = [ "${inputmethod_path}/services/dfx:inputmethod_dfx_static" ]
|
||||
deps = [ "${inputmethod_path}/common:inputmethod_common" ]
|
||||
|
||||
public_configs = [ ":inputmethod_ability_native_public_config" ]
|
||||
|
||||
@ -96,3 +88,47 @@ ohos_shared_library("inputmethod_ability") {
|
||||
innerapi_tags = [ "platformsdk" ]
|
||||
part_name = "imf"
|
||||
}
|
||||
|
||||
ohos_static_library("inputmethod_ability_static") {
|
||||
branch_protector_ret = "pac_ret"
|
||||
sanitize = {
|
||||
cfi = true
|
||||
cfi_cross_dso = true
|
||||
debug = false
|
||||
}
|
||||
sources = [
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_ability/src/input_method_ability.cpp",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_ability/src/input_method_ability_interface.cpp",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_ability/src/input_method_ability_utils.cpp",
|
||||
"${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}/frameworks/native/inputmethod_ability/src/input_method_panel.cpp",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_data_channel_proxy.cpp",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_method_system_ability_proxy.cpp",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/keyevent_consumer_proxy.cpp",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/system_cmd_channel_proxy.cpp",
|
||||
"${inputmethod_path}/services/src/input_control_channel_proxy.cpp",
|
||||
]
|
||||
|
||||
external_deps = [
|
||||
"ability_base:configuration",
|
||||
"ability_base:want",
|
||||
"ability_runtime:ability_context_native",
|
||||
"c_utils:utils",
|
||||
"graphic_2d:window_animation",
|
||||
"hilog:libhilog",
|
||||
"input:libmmi-client",
|
||||
"ipc:ipc_single",
|
||||
"napi:ace_napi",
|
||||
"samgr:samgr_proxy",
|
||||
"window_manager:libdm",
|
||||
"window_manager:libwm",
|
||||
]
|
||||
|
||||
deps = [ "${inputmethod_path}/common:inputmethod_common" ]
|
||||
|
||||
public_configs = [ ":inputmethod_ability_native_public_config" ]
|
||||
|
||||
subsystem_name = "inputmethod"
|
||||
part_name = "imf"
|
||||
}
|
||||
|
@ -16,14 +16,8 @@
|
||||
*InputDataChannelProxy*;
|
||||
*InputMethodAbility*;
|
||||
*InputMethodAbilityInterface*;
|
||||
*InputMethodAgentProxy*;
|
||||
*InputMethodAgentStub*;
|
||||
*InputMethodCoreProxy*;
|
||||
*InputMethodCoreStub*;
|
||||
*InputMethodPanel*;
|
||||
*InputMethodSystemAbilityProxy*;
|
||||
*ITypesUtil*;
|
||||
*MessageHandler*;
|
||||
*KeyEventConsumerProxy*;
|
||||
*SystemCmdChannelProxy*;
|
||||
local:
|
||||
*;
|
||||
|
@ -18,10 +18,10 @@ config("inputmethod_client_native_config") {
|
||||
visibility = [ ":*" ]
|
||||
include_dirs = [
|
||||
"include",
|
||||
"${inputmethod_path}/common/include",
|
||||
"${inputmethod_path}/frameworks/common",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/include",
|
||||
"${inputmethod_path}/interfaces/inner_api/inputmethod_controller/include",
|
||||
"${inputmethod_path}/services/dfx/include",
|
||||
"${inputmethod_path}/services/include",
|
||||
]
|
||||
}
|
||||
@ -30,14 +30,13 @@ config("inputmethod_client_native_public_config") {
|
||||
visibility = [ "./*" ]
|
||||
include_dirs = [
|
||||
"include",
|
||||
"${inputmethod_path}/common",
|
||||
"${inputmethod_path}/common/include",
|
||||
"${inputmethod_path}/frameworks/common",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/include",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_ability/include",
|
||||
"${inputmethod_path}/interfaces/inner_api/inputmethod_ability/include",
|
||||
"${inputmethod_path}/interfaces/inner_api/inputmethod_controller/include",
|
||||
"${inputmethod_path}/services/include",
|
||||
"${inputmethod_path}/services/dfx/include",
|
||||
]
|
||||
}
|
||||
|
||||
@ -53,27 +52,20 @@ ohos_shared_library("inputmethod_client") {
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/ime_event_monitor_manager.cpp",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/ime_event_monitor_manager_impl.cpp",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/ime_system_channel.cpp",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_client_proxy.cpp",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_client_stub.cpp",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_data_channel_proxy.cpp",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_data_channel_stub.cpp",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_death_recipient.cpp",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_method_controller.cpp",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_method_system_ability_proxy.cpp",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_method_utils.cpp",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/itypes_util.cpp",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/keyevent_consumer_proxy.cpp",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/keyevent_consumer_stub.cpp",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/system_cmd_channel_stub.cpp",
|
||||
"${inputmethod_path}/services/src/global.cpp",
|
||||
"${inputmethod_path}/services/src/message.cpp",
|
||||
"${inputmethod_path}/services/src/message_handler.cpp",
|
||||
]
|
||||
|
||||
cflags = [
|
||||
cflags_cc = [
|
||||
"-fvisibility=hidden",
|
||||
"-fvisibility-inlines-hidden",
|
||||
"-fdata-sections",
|
||||
"-ffunction-sections",
|
||||
"-fvisibility=hidden",
|
||||
"-Os",
|
||||
]
|
||||
|
||||
@ -81,9 +73,7 @@ ohos_shared_library("inputmethod_client") {
|
||||
|
||||
innerapi_tags = [ "platformsdk" ]
|
||||
|
||||
deps = [ "${inputmethod_path}/services/dfx:inputmethod_dfx_static" ]
|
||||
|
||||
public_deps = [ "${inputmethod_path}/services/dfx:inputmethod_dfx_static" ]
|
||||
deps = [ "${inputmethod_path}/common:inputmethod_common" ]
|
||||
|
||||
external_deps = [
|
||||
"ability_base:want",
|
||||
@ -118,25 +108,18 @@ ohos_static_library("inputmethod_client_static") {
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/ime_event_monitor_manager.cpp",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/ime_event_monitor_manager_impl.cpp",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/ime_system_channel.cpp",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_client_proxy.cpp",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_client_stub.cpp",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_data_channel_proxy.cpp",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_data_channel_stub.cpp",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_death_recipient.cpp",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_method_controller.cpp",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_method_system_ability_proxy.cpp",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_method_utils.cpp",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/itypes_util.cpp",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/keyevent_consumer_proxy.cpp",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/keyevent_consumer_stub.cpp",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/system_cmd_channel_stub.cpp",
|
||||
"${inputmethod_path}/services/src/message.cpp",
|
||||
"${inputmethod_path}/services/src/message_handler.cpp",
|
||||
]
|
||||
|
||||
public_configs = [ ":inputmethod_client_native_public_config" ]
|
||||
|
||||
public_deps = [ "${inputmethod_path}/services/dfx:inputmethod_dfx_static" ]
|
||||
deps = [ "${inputmethod_path}/common:inputmethod_common" ]
|
||||
|
||||
external_deps = [
|
||||
"ability_base:want",
|
||||
|
@ -309,7 +309,7 @@ public:
|
||||
* @return Returns 0 for success, others for failure.
|
||||
* @since 6
|
||||
*/
|
||||
IMF_API int32_t GetEnterKeyType(int32_t &keyType);
|
||||
int32_t GetEnterKeyType(int32_t &keyType);
|
||||
|
||||
/**
|
||||
* @brief Get input pattern.
|
||||
@ -320,7 +320,7 @@ public:
|
||||
* @return Returns 0 for success, others for failure.
|
||||
* @since 6
|
||||
*/
|
||||
IMF_API int32_t GetInputPattern(int32_t &inputPattern);
|
||||
int32_t GetInputPattern(int32_t &inputPattern);
|
||||
|
||||
/**
|
||||
* @brief Get text config.
|
||||
@ -331,7 +331,7 @@ public:
|
||||
* @return Returns 0 for success, others for failure.
|
||||
* @since 10
|
||||
*/
|
||||
IMF_API int32_t GetTextConfig(TextTotalConfig &config);
|
||||
int32_t GetTextConfig(TextTotalConfig &config);
|
||||
|
||||
/**
|
||||
* @brief Get current input method property.
|
||||
@ -508,7 +508,7 @@ public:
|
||||
*
|
||||
* @since 10
|
||||
*/
|
||||
IMF_API void OnInputReady(sptr<IRemoteObject> agentObject);
|
||||
void OnInputReady(sptr<IRemoteObject> agentObject);
|
||||
|
||||
/**
|
||||
* @brief Unbind IMC with Service.
|
||||
@ -517,7 +517,7 @@ public:
|
||||
*
|
||||
* @since 10
|
||||
*/
|
||||
IMF_API void OnInputStop();
|
||||
void OnInputStop();
|
||||
|
||||
/**
|
||||
* @brief Insert text.
|
||||
@ -528,7 +528,7 @@ public:
|
||||
* @return Returns 0 for success, others for failure.
|
||||
* @since 10
|
||||
*/
|
||||
IMF_API int32_t InsertText(const std::u16string &text);
|
||||
int32_t InsertText(const std::u16string &text);
|
||||
|
||||
/**
|
||||
* @brief Move cursor.
|
||||
@ -539,7 +539,7 @@ public:
|
||||
* @return Returns 0 for success, others for failure.
|
||||
* @since 10
|
||||
*/
|
||||
IMF_API int32_t MoveCursor(Direction direction);
|
||||
int32_t MoveCursor(Direction direction);
|
||||
|
||||
/**
|
||||
* @brief Delete forward.
|
||||
@ -550,7 +550,7 @@ public:
|
||||
* @return Returns 0 for success, others for failure.
|
||||
* @since 10
|
||||
*/
|
||||
IMF_API int32_t DeleteForward(int32_t length);
|
||||
int32_t DeleteForward(int32_t length);
|
||||
|
||||
/**
|
||||
* @brief Delete backward.
|
||||
@ -561,7 +561,7 @@ public:
|
||||
* @return Returns 0 for success, others for failure.
|
||||
* @since 10
|
||||
*/
|
||||
IMF_API int32_t DeleteBackward(int32_t length);
|
||||
int32_t DeleteBackward(int32_t length);
|
||||
|
||||
/**
|
||||
* @brief Get text at the left of cursor.
|
||||
@ -573,7 +573,7 @@ public:
|
||||
* @return Returns 0 for success, others for failure.
|
||||
* @since 10
|
||||
*/
|
||||
IMF_API int32_t GetLeft(int32_t length, std::u16string &text);
|
||||
int32_t GetLeft(int32_t length, std::u16string &text);
|
||||
|
||||
/**
|
||||
* @brief Get text at the right of cursor.
|
||||
@ -585,7 +585,7 @@ public:
|
||||
* @return Returns 0 for success, others for failure.
|
||||
* @since 10
|
||||
*/
|
||||
IMF_API int32_t GetRight(int32_t length, std::u16string &text);
|
||||
int32_t GetRight(int32_t length, std::u16string &text);
|
||||
|
||||
/**
|
||||
* @brief Select text in editor by range.
|
||||
@ -597,7 +597,7 @@ public:
|
||||
* @return Returns 0 for success, others for failure.
|
||||
* @since 10
|
||||
*/
|
||||
IMF_API void SelectByRange(int32_t start, int32_t end);
|
||||
void SelectByRange(int32_t start, int32_t end);
|
||||
|
||||
/**
|
||||
* @brief Select text in editor by cursor movement.
|
||||
@ -609,7 +609,7 @@ public:
|
||||
* @return Returns 0 for success, others for failure.
|
||||
* @since 10
|
||||
*/
|
||||
IMF_API void SelectByMovement(int32_t direction, int32_t cursorMoveSkip);
|
||||
void SelectByMovement(int32_t direction, int32_t cursorMoveSkip);
|
||||
|
||||
/**
|
||||
* @brief Handle extend action code.
|
||||
@ -620,7 +620,7 @@ public:
|
||||
* @return Returns 0 for success, others for failure.
|
||||
* @since 10
|
||||
*/
|
||||
IMF_API int32_t HandleExtendAction(int32_t action);
|
||||
int32_t HandleExtendAction(int32_t action);
|
||||
|
||||
/**
|
||||
* @brief Get the index number of text at cursor.
|
||||
@ -631,7 +631,7 @@ public:
|
||||
* @return Returns 0 for success, others for failure.
|
||||
* @since 10
|
||||
*/
|
||||
IMF_API int32_t GetTextIndexAtCursor(int32_t &index);
|
||||
int32_t GetTextIndexAtCursor(int32_t &index);
|
||||
|
||||
/**
|
||||
* @brief Send keyboard status.
|
||||
@ -641,7 +641,7 @@ public:
|
||||
* @param status Indicates the status of keyboard.
|
||||
* @since 10
|
||||
*/
|
||||
IMF_API void SendKeyboardStatus(KeyboardStatus status);
|
||||
void SendKeyboardStatus(KeyboardStatus status);
|
||||
|
||||
/**
|
||||
* @brief Send panel status info.
|
||||
@ -652,7 +652,7 @@ public:
|
||||
* @param info Indicates the status info of panel.
|
||||
* @since 11
|
||||
*/
|
||||
IMF_API void NotifyPanelStatusInfo(const PanelStatusInfo &info);
|
||||
void NotifyPanelStatusInfo(const PanelStatusInfo &info);
|
||||
|
||||
/**
|
||||
* @brief Send panel height.
|
||||
@ -662,7 +662,7 @@ public:
|
||||
* @param info Indicates the panel height.
|
||||
* @since 11
|
||||
*/
|
||||
IMF_API void NotifyKeyboardHeight(uint32_t height);
|
||||
void NotifyKeyboardHeight(uint32_t height);
|
||||
|
||||
/**
|
||||
* @brief Send function key.
|
||||
@ -673,7 +673,7 @@ public:
|
||||
* @return Returns 0 for success, others for failure.
|
||||
* @since 10
|
||||
*/
|
||||
IMF_API int32_t SendFunctionKey(int32_t functionKey);
|
||||
int32_t SendFunctionKey(int32_t functionKey);
|
||||
|
||||
/**
|
||||
* @brief Deactivate the input client.
|
||||
@ -682,7 +682,7 @@ public:
|
||||
*
|
||||
* @since 11
|
||||
*/
|
||||
IMF_API void DeactivateClient();
|
||||
void DeactivateClient();
|
||||
|
||||
/**
|
||||
* @brief Query whether an input type is supported.
|
||||
@ -740,7 +740,7 @@ public:
|
||||
* @return Returns 0 for success, others for failure.
|
||||
* @since 12
|
||||
*/
|
||||
IMF_API int32_t ReceivePrivateCommand(
|
||||
int32_t ReceivePrivateCommand(
|
||||
const std::unordered_map<std::string, PrivateDataValue> &privateCommand) override;
|
||||
|
||||
/**
|
||||
@ -753,7 +753,7 @@ public:
|
||||
* @return Returns 0 for success, others for failure.
|
||||
* @since 12
|
||||
*/
|
||||
IMF_API int32_t SetPreviewText(const std::string &text, const Range &range);
|
||||
int32_t SetPreviewText(const std::string &text, const Range &range);
|
||||
|
||||
/**
|
||||
* @brief Finish text preview.
|
||||
@ -762,7 +762,7 @@ public:
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
IMF_API int32_t FinishTextPreview();
|
||||
int32_t FinishTextPreview();
|
||||
|
||||
private:
|
||||
InputMethodController();
|
||||
|
@ -18,7 +18,7 @@ config("inputmethod_services_native_config") {
|
||||
visibility = [ ":*" ]
|
||||
include_dirs = [
|
||||
"include",
|
||||
"${inputmethod_path}/common",
|
||||
"${inputmethod_path}/common/include",
|
||||
"${inputmethod_path}/frameworks/common",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_ability/include",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/include",
|
||||
@ -29,10 +29,7 @@ config("inputmethod_services_native_config") {
|
||||
"${inputmethod_path}/services/adapter/system_language_observer/include",
|
||||
"${inputmethod_path}/services/adapter/wms_connection_monitor/include",
|
||||
"${inputmethod_path}/services/identity_checker/include",
|
||||
"${inputmethod_path}/services/dfx/include",
|
||||
]
|
||||
|
||||
cflags_cc = [ "-fexceptions" ]
|
||||
}
|
||||
|
||||
ohos_shared_library("inputmethod_service") {
|
||||
@ -42,10 +39,17 @@ ohos_shared_library("inputmethod_service") {
|
||||
cfi_cross_dso = true
|
||||
debug = false
|
||||
}
|
||||
cflags_cc = [
|
||||
"-fexceptions",
|
||||
"-fvisibility=hidden",
|
||||
"-fvisibility-inlines-hidden",
|
||||
"-fdata-sections",
|
||||
"-ffunction-sections",
|
||||
"-Os",
|
||||
]
|
||||
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}/frameworks/native/inputmethod_controller/src/input_death_recipient.cpp",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/keyevent_consumer_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",
|
||||
@ -53,17 +57,13 @@ ohos_shared_library("inputmethod_service") {
|
||||
"${inputmethod_path}/services/adapter/wms_connection_monitor/src/wms_connection_observer.cpp",
|
||||
"${inputmethod_path}/services/identity_checker/src/identity_checker_impl.cpp",
|
||||
"src/freeze_manager.cpp",
|
||||
"src/global.cpp",
|
||||
"src/im_common_event_manager.cpp",
|
||||
"src/ime_cfg_manager.cpp",
|
||||
"src/ime_info_inquirer.cpp",
|
||||
"src/input_control_channel_proxy.cpp",
|
||||
"src/input_control_channel_stub.cpp",
|
||||
"src/input_method_system_ability.cpp",
|
||||
"src/input_method_system_ability_stub.cpp",
|
||||
"src/input_type_manager.cpp",
|
||||
"src/message.cpp",
|
||||
"src/message_handler.cpp",
|
||||
"src/peruser_session.cpp",
|
||||
"src/sys_cfg_parser.cpp",
|
||||
]
|
||||
@ -73,10 +73,9 @@ ohos_shared_library("inputmethod_service") {
|
||||
public_configs = [ ":inputmethod_services_native_config" ]
|
||||
|
||||
deps = [
|
||||
"${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability",
|
||||
"${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}/services/dfx:inputmethod_dfx_static",
|
||||
"${inputmethod_path}/services/file:imf_file_static",
|
||||
"${inputmethod_path}/services/json:imf_json_static",
|
||||
"//third_party/cJSON:cjson",
|
||||
@ -90,7 +89,79 @@ ohos_shared_library("inputmethod_service") {
|
||||
"bundle_framework:appexecfwk_base",
|
||||
"bundle_framework:appexecfwk_core",
|
||||
"c_utils:utils",
|
||||
"common_event_service:cesfwk_core",
|
||||
"common_event_service:cesfwk_innerkits",
|
||||
"config_policy:configpolicy_util",
|
||||
"data_share:datashare_common",
|
||||
"data_share:datashare_consumer",
|
||||
"eventhandler:libeventhandler",
|
||||
"hilog:libhilog",
|
||||
"init:libbeget_proxy",
|
||||
"init:libbegetutil",
|
||||
"input:libmmi-client",
|
||||
"ipc:ipc_single",
|
||||
"os_account:os_account_innerkits",
|
||||
"resource_schedule_service:ressched_client",
|
||||
"safwk:system_ability_fwk",
|
||||
"samgr:samgr_proxy",
|
||||
"window_manager:libwm",
|
||||
"window_manager:libwsutils",
|
||||
]
|
||||
|
||||
subsystem_name = "inputmethod"
|
||||
part_name = "imf"
|
||||
}
|
||||
|
||||
ohos_static_library("inputmethod_service_static") {
|
||||
branch_protector_ret = "pac_ret"
|
||||
sanitize = {
|
||||
cfi = true
|
||||
cfi_cross_dso = true
|
||||
debug = false
|
||||
}
|
||||
cflags_cc = [
|
||||
"-fdata-sections",
|
||||
"-ffunction-sections",
|
||||
"-Os",
|
||||
]
|
||||
sources = [
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_ability/src/input_method_core_proxy.cpp",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_client_proxy.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",
|
||||
"src/ime_info_inquirer.cpp",
|
||||
"src/input_control_channel_stub.cpp",
|
||||
"src/input_method_system_ability.cpp",
|
||||
"src/input_method_system_ability_stub.cpp",
|
||||
"src/input_type_manager.cpp",
|
||||
"src/peruser_session.cpp",
|
||||
"src/sys_cfg_parser.cpp",
|
||||
]
|
||||
|
||||
public_configs = [ ":inputmethod_services_native_config" ]
|
||||
|
||||
public_deps = [
|
||||
"${inputmethod_path}/common:inputmethod_common",
|
||||
"adapter/keyboard:keboard_event_static",
|
||||
"adapter/settings_data_provider:settings_data_static",
|
||||
"file:imf_file_static",
|
||||
"json:imf_json_static",
|
||||
]
|
||||
|
||||
external_deps = [
|
||||
"ability_base:want",
|
||||
"ability_runtime:ability_manager",
|
||||
"access_token:libaccesstoken_sdk",
|
||||
"access_token:libtokenid_sdk",
|
||||
"bundle_framework:appexecfwk_base",
|
||||
"bundle_framework:appexecfwk_core",
|
||||
"c_utils:utils",
|
||||
"common_event_service:cesfwk_innerkits",
|
||||
"config_policy:configpolicy_util",
|
||||
"data_share:datashare_common",
|
||||
|
@ -18,7 +18,7 @@ config("inputmethod_adapter_native_config") {
|
||||
visibility = [ ":*" ]
|
||||
include_dirs = [
|
||||
"include",
|
||||
"${inputmethod_path}/services/include",
|
||||
"${inputmethod_path}/common/include",
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -17,6 +17,7 @@ import("//build/ohos.gni")
|
||||
config("settings_data_config") {
|
||||
include_dirs = [
|
||||
"include",
|
||||
"${inputmethod_path}/common/include",
|
||||
"${inputmethod_path}/services/include",
|
||||
"${inputmethod_path}/services/adapter/settings_data_provider/common/include",
|
||||
"${inputmethod_path}/services/json/include",
|
||||
|
@ -17,7 +17,7 @@ import("//build/ohos.gni")
|
||||
config("imf_file_config") {
|
||||
include_dirs = [
|
||||
"include",
|
||||
"${inputmethod_path}/services/include",
|
||||
"${inputmethod_path}/common/include",
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,6 @@
|
||||
#define SERVICES_INCLUDE_I_INPUT_CONTROL_CHANNEL_H
|
||||
|
||||
#include "global.h"
|
||||
#include "i_input_method_agent.h"
|
||||
#include "iremote_broker.h"
|
||||
|
||||
namespace OHOS {
|
||||
|
@ -25,7 +25,6 @@
|
||||
#include "event_status_manager.h"
|
||||
#include "global.h"
|
||||
#include "i_input_client.h"
|
||||
#include "i_input_data_channel.h"
|
||||
#include "i_input_method_core.h"
|
||||
#include "i_system_cmd_channel.h"
|
||||
#include "input_attribute.h"
|
||||
@ -59,7 +58,7 @@ public:
|
||||
virtual std::shared_ptr<SubProperty> GetCurrentInputMethodSubtype() = 0;
|
||||
virtual int32_t ListInputMethod(InputMethodStatus status, std::vector<Property> &props) = 0;
|
||||
virtual int32_t DisplayOptionalInputMethod() = 0;
|
||||
virtual int32_t SetCoreAndAgent(const sptr<IInputMethodCore> &core, const sptr<IInputMethodAgent> &agent) = 0;
|
||||
virtual int32_t SetCoreAndAgent(const sptr<IInputMethodCore> &core, const sptr<IRemoteObject> &agent) = 0;
|
||||
virtual int32_t UnRegisteredProxyIme(UnRegisteredType type, const sptr<IInputMethodCore> &core) = 0;
|
||||
virtual int32_t ListCurrentInputMethodSubtype(std::vector<SubProperty> &subProps) = 0;
|
||||
virtual int32_t ListInputMethodSubtype(const std::string &name, std::vector<SubProperty> &subProps) = 0;
|
||||
@ -74,7 +73,7 @@ public:
|
||||
virtual int32_t IsPanelShown(const PanelInfo &panelInfo, bool &isShown) = 0;
|
||||
virtual int32_t GetSecurityMode(int32_t &security) = 0;
|
||||
virtual int32_t IsDefaultIme() = 0;
|
||||
virtual int32_t ConnectSystemCmd(const sptr<ISystemCmdChannel> &channel, sptr<IRemoteObject> &agent) = 0;
|
||||
virtual int32_t ConnectSystemCmd(const sptr<IRemoteObject> &channel, sptr<IRemoteObject> &agent) = 0;
|
||||
|
||||
// Deprecated because of no permission check, and keep for compatibility
|
||||
virtual int32_t HideCurrentInputDeprecated() = 0;
|
||||
|
@ -20,7 +20,6 @@
|
||||
#include <mutex>
|
||||
|
||||
#include "i_input_control_channel.h"
|
||||
#include "i_input_method_agent.h"
|
||||
#include "iremote_broker.h"
|
||||
#include "iremote_stub.h"
|
||||
#include "message_parcel.h"
|
||||
|
@ -40,9 +40,6 @@
|
||||
|
||||
namespace OHOS {
|
||||
namespace MiscServices {
|
||||
using AbilityType = AppExecFwk::ExtensionAbilityType;
|
||||
using namespace AppExecFwk;
|
||||
using namespace Security::AccessToken;
|
||||
enum class ServiceRunningState { STATE_NOT_START, STATE_RUNNING };
|
||||
class InputMethodSystemAbility : public SystemAbility, public InputMethodSystemAbilityStub {
|
||||
DECLARE_SYSTEM_ABILITY(InputMethodSystemAbility);
|
||||
@ -72,7 +69,7 @@ public:
|
||||
int32_t SwitchInputMethod(
|
||||
const std::string &bundleName, const std::string &subName, SwitchTrigger trigger) override;
|
||||
int32_t DisplayOptionalInputMethod() override;
|
||||
int32_t SetCoreAndAgent(const sptr<IInputMethodCore> &core, const sptr<IInputMethodAgent> &agent) override;
|
||||
int32_t SetCoreAndAgent(const sptr<IInputMethodCore> &core, const sptr<IRemoteObject> &agent) override;
|
||||
int32_t UnRegisteredProxyIme(UnRegisteredType type, const sptr<IInputMethodCore> &core) override;
|
||||
int32_t PanelStatusChange(const InputWindowStatus &status, const ImeWindowInfo &info) override;
|
||||
int32_t UpdateListenEventFlag(InputClientInfo &clientInfo, uint32_t eventFlag) override;
|
||||
@ -82,7 +79,7 @@ public:
|
||||
int32_t ExitCurrentInputType() override;
|
||||
int32_t IsPanelShown(const PanelInfo &panelInfo, bool &isShown) override;
|
||||
int32_t GetSecurityMode(int32_t &security) override;
|
||||
int32_t ConnectSystemCmd(const sptr<ISystemCmdChannel> &channel, sptr<IRemoteObject> &agent) override;
|
||||
int32_t ConnectSystemCmd(const sptr<IRemoteObject> &channel, sptr<IRemoteObject> &agent) override;
|
||||
// Deprecated because of no permission check, kept for compatibility
|
||||
int32_t HideCurrentInputDeprecated() override;
|
||||
int32_t ShowCurrentInputDeprecated() override;
|
||||
|
@ -37,7 +37,6 @@
|
||||
#include "ime_cfg_manager.h"
|
||||
#include "input_attribute.h"
|
||||
#include "input_client_info.h"
|
||||
#include "input_control_channel_stub.h"
|
||||
#include "input_death_recipient.h"
|
||||
#include "input_method_info.h"
|
||||
#include "input_method_property.h"
|
||||
@ -53,10 +52,10 @@ namespace OHOS {
|
||||
namespace MiscServices {
|
||||
struct ImeData {
|
||||
sptr<IInputMethodCore> core{ nullptr };
|
||||
sptr<IInputMethodAgent> agent{ nullptr };
|
||||
sptr<IRemoteObject> agent{ nullptr };
|
||||
sptr<InputDeathRecipient> deathRecipient{ nullptr };
|
||||
std::shared_ptr<FreezeManager> freezeMgr;
|
||||
ImeData(sptr<IInputMethodCore> core, sptr<IInputMethodAgent> agent, sptr<InputDeathRecipient> deathRecipient,
|
||||
ImeData(sptr<IInputMethodCore> core, sptr<IRemoteObject> agent, sptr<InputDeathRecipient> deathRecipient,
|
||||
pid_t imePid)
|
||||
: core(std::move(core)), agent(std::move(agent)), deathRecipient(std::move(deathRecipient)),
|
||||
freezeMgr(std::make_shared<FreezeManager>(imePid))
|
||||
@ -77,7 +76,7 @@ public:
|
||||
int32_t OnPrepareInput(const InputClientInfo &clientInfo);
|
||||
int32_t OnStartInput(const InputClientInfo &inputClientInfo, sptr<IRemoteObject> &agent);
|
||||
int32_t OnReleaseInput(const sptr<IInputClient> &client);
|
||||
int32_t OnSetCoreAndAgent(const sptr<IInputMethodCore> &core, const sptr<IInputMethodAgent> &agent);
|
||||
int32_t OnSetCoreAndAgent(const sptr<IInputMethodCore> &core, const sptr<IRemoteObject> &agent);
|
||||
int32_t OnHideCurrentInput();
|
||||
int32_t OnShowCurrentInput();
|
||||
int32_t OnShowInput(sptr<IInputClient> client);
|
||||
@ -94,7 +93,7 @@ public:
|
||||
int64_t GetCurrentClientPid();
|
||||
int32_t OnPanelStatusChange(const InputWindowStatus &status, const ImeWindowInfo &info);
|
||||
int32_t OnUpdateListenEventFlag(const InputClientInfo &clientInfo);
|
||||
int32_t OnRegisterProxyIme(const sptr<IInputMethodCore> &core, const sptr<IInputMethodAgent> &agent);
|
||||
int32_t OnRegisterProxyIme(const sptr<IInputMethodCore> &core, const sptr<IRemoteObject> &agent);
|
||||
int32_t OnUnRegisteredProxyIme(UnRegisteredType type, const sptr<IInputMethodCore> &core);
|
||||
bool StartCurrentIme(int32_t userId, bool isRetry);
|
||||
void StopCurrentIme();
|
||||
@ -105,7 +104,7 @@ public:
|
||||
int32_t IsPanelShown(const PanelInfo &panelInfo, bool &isShown);
|
||||
bool CheckSecurityMode();
|
||||
bool IsWmsReady();
|
||||
int32_t OnConnectSystemCmd(const sptr<ISystemCmdChannel> &channel, sptr<IRemoteObject> &agent);
|
||||
int32_t OnConnectSystemCmd(const sptr<IRemoteObject> &channel, sptr<IRemoteObject> &agent);
|
||||
|
||||
private:
|
||||
struct ResetManager {
|
||||
@ -146,7 +145,7 @@ private:
|
||||
const std::unordered_map<UpdateFlag, std::variant<bool, uint32_t, ImeType, ClientState, TextTotalConfig>>
|
||||
&updateInfos);
|
||||
|
||||
int32_t AddImeData(ImeType type, sptr<IInputMethodCore> core, sptr<IInputMethodAgent> agent, pid_t pid);
|
||||
int32_t AddImeData(ImeType type, sptr<IInputMethodCore> core, sptr<IRemoteObject> agent, pid_t pid);
|
||||
void RemoveImeData(ImeType type, bool isImeDied);
|
||||
int32_t RemoveIme(const sptr<IInputMethodCore> &core, ImeType type);
|
||||
std::shared_ptr<ImeData> GetImeData(ImeType type);
|
||||
@ -157,7 +156,7 @@ private:
|
||||
void UnBindClientWithIme(
|
||||
const std::shared_ptr<InputClientInfo> ¤tClientInfo, bool isUnbindFromClient = false);
|
||||
void StopClientInput(const sptr<IInputClient> ¤tClient);
|
||||
void StopImeInput(ImeType currentType, const sptr<IInputDataChannel> ¤tChannel);
|
||||
void StopImeInput(ImeType currentType, const sptr<IRemoteObject> ¤tChannel);
|
||||
|
||||
int32_t HideKeyboard(const sptr<IInputClient> ¤tClient);
|
||||
int32_t ShowKeyboard(const sptr<IInputClient> ¤tClient);
|
||||
@ -176,8 +175,6 @@ private:
|
||||
bool IsImeStartInBind(ImeType bindImeType, ImeType startImeType);
|
||||
bool IsProxyImeStartInBind(ImeType bindImeType, ImeType startImeType);
|
||||
bool IsProxyImeStartInImeBind(ImeType bindImeType, ImeType startImeType);
|
||||
bool IsBindProxyImeInImeBind(ImeType bindImeType);
|
||||
bool IsBindImeInProxyImeBind(ImeType bindImeType);
|
||||
bool IsImeBindChanged(ImeType bindImeType);
|
||||
std::map<sptr<IRemoteObject>, std::shared_ptr<InputClientInfo>> GetClientMap();
|
||||
int32_t RequestIme(const std::shared_ptr<ImeData> &data, RequestType type, const IpcExec &exec);
|
||||
@ -188,8 +185,6 @@ private:
|
||||
BlockData<bool> isImeStarted_{ MAX_IME_START_TIME, false };
|
||||
std::mutex imeDataLock_;
|
||||
std::unordered_map<ImeType, std::shared_ptr<ImeData>> imeData_;
|
||||
std::mutex attachLock_;
|
||||
std::condition_variable imeAttachCv_;
|
||||
std::mutex inactiveClientLock_;
|
||||
sptr<IInputClient> inactiveClient_; // the inactive input client
|
||||
std::mutex focusedClientLock_;
|
||||
|
@ -17,7 +17,7 @@ import("//build/ohos.gni")
|
||||
config("imf_json_config") {
|
||||
include_dirs = [
|
||||
"include",
|
||||
"${inputmethod_path}/services/include",
|
||||
"${inputmethod_path}/common/include",
|
||||
]
|
||||
}
|
||||
|
||||
@ -34,7 +34,7 @@ ohos_static_library("imf_json_static") {
|
||||
|
||||
cflags_cc = [ "-fvisibility=hidden" ]
|
||||
|
||||
deps = [ "//third_party/cJSON:cjson" ]
|
||||
public_deps = [ "//third_party/cJSON:cjson" ]
|
||||
external_deps = [ "hilog:libhilog" ]
|
||||
subsystem_name = "inputmethod"
|
||||
part_name = "imf"
|
||||
|
@ -19,8 +19,6 @@
|
||||
|
||||
#include "global.h"
|
||||
#include "ime_info_inquirer.h"
|
||||
#include "input_method_system_ability.h"
|
||||
#include "input_method_system_ability_stub.h"
|
||||
#include "ipc_skeleton.h"
|
||||
#include "iservice_registry.h"
|
||||
#include "itypes_util.h"
|
||||
|
@ -15,8 +15,6 @@
|
||||
|
||||
#include "input_control_channel_stub.h"
|
||||
|
||||
#include "i_input_control_channel.h"
|
||||
#include "input_method_agent_proxy.h"
|
||||
#include "ipc_skeleton.h"
|
||||
#include "message_handler.h"
|
||||
#include "message_parcel.h"
|
||||
|
@ -45,6 +45,8 @@ namespace OHOS {
|
||||
namespace MiscServices {
|
||||
using namespace MessageID;
|
||||
using namespace AccountSA;
|
||||
using namespace AppExecFwk;
|
||||
using namespace Security::AccessToken;
|
||||
REGISTER_SYSTEM_ABILITY_BY_ID(InputMethodSystemAbility, INPUT_METHOD_SYSTEM_ABILITY_ID, true);
|
||||
constexpr std::int32_t INIT_INTERVAL = 10000L;
|
||||
constexpr std::int32_t MAIN_USER_ID = 100;
|
||||
@ -269,6 +271,7 @@ int32_t InputMethodSystemAbility::PrepareInput(InputClientInfo &clientInfo)
|
||||
int32_t InputMethodSystemAbility::GenerateClientInfo(InputClientInfo &clientInfo)
|
||||
{
|
||||
if (clientInfo.client == nullptr || clientInfo.channel == nullptr) {
|
||||
IMSA_HILOGE("client or channel is nullptr");
|
||||
return ErrorCode::ERROR_NULL_POINTER;
|
||||
}
|
||||
auto deathRecipient = new (std::nothrow) InputDeathRecipient();
|
||||
@ -409,8 +412,7 @@ int32_t InputMethodSystemAbility::RequestHideInput()
|
||||
return userSession_->OnRequestHideInput();
|
||||
}
|
||||
|
||||
int32_t InputMethodSystemAbility::SetCoreAndAgent(
|
||||
const sptr<IInputMethodCore> &core, const sptr<IInputMethodAgent> &agent)
|
||||
int32_t InputMethodSystemAbility::SetCoreAndAgent(const sptr<IInputMethodCore> &core, const sptr<IRemoteObject> &agent)
|
||||
{
|
||||
IMSA_HILOGD("InputMethodSystemAbility run in");
|
||||
if (IsCurrentIme()) {
|
||||
@ -1238,7 +1240,7 @@ bool InputMethodSystemAbility::IsStartInputTypePermitted()
|
||||
return identityChecker_->IsFocused(IPCSkeleton::GetCallingPid(), tokenId) && userSession_->IsBoundToClient();
|
||||
}
|
||||
|
||||
int32_t InputMethodSystemAbility::ConnectSystemCmd(const sptr<ISystemCmdChannel> &channel, sptr<IRemoteObject> &agent)
|
||||
int32_t InputMethodSystemAbility::ConnectSystemCmd(const sptr<IRemoteObject> &channel, sptr<IRemoteObject> &agent)
|
||||
{
|
||||
auto tokenId = IPCSkeleton::GetCallingTokenID();
|
||||
if (!identityChecker_->HasPermission(tokenId, PERMISSION_CONNECT_IME_ABILITY)) {
|
||||
|
@ -19,13 +19,9 @@
|
||||
|
||||
#include "element_name.h"
|
||||
#include "input_client_proxy.h"
|
||||
#include "system_cmd_channel_proxy.h"
|
||||
#include "input_data_channel_proxy.h"
|
||||
#include "input_method_agent_proxy.h"
|
||||
#include "input_method_core_proxy.h"
|
||||
#include "ipc_skeleton.h"
|
||||
#include "itypes_util.h"
|
||||
#include "os_account_manager.h"
|
||||
|
||||
namespace OHOS {
|
||||
namespace MiscServices {
|
||||
@ -49,10 +45,12 @@ int32_t InputMethodSystemAbilityStub::OnRemoteRequest(
|
||||
int32_t InputMethodSystemAbilityStub::StartInputOnRemote(MessageParcel &data, MessageParcel &reply)
|
||||
{
|
||||
InputClientInfo clientInfo;
|
||||
if (!ITypesUtil::Unmarshal(data, clientInfo)) {
|
||||
sptr<IRemoteObject> client = nullptr;
|
||||
if (!ITypesUtil::Unmarshal(data, clientInfo, client, clientInfo.channel)) {
|
||||
IMSA_HILOGE("read clientInfo failed");
|
||||
return ErrorCode::ERROR_EX_PARCELABLE;
|
||||
}
|
||||
clientInfo.client = iface_cast<IInputClient>(client);
|
||||
sptr<IRemoteObject> agent = nullptr;
|
||||
int32_t ret = StartInput(clientInfo, agent);
|
||||
return reply.WriteInt32(ret) && reply.WriteRemoteObject(agent) ? ErrorCode::NO_ERROR
|
||||
@ -138,7 +136,7 @@ int32_t InputMethodSystemAbilityStub::SetCoreAndAgentOnRemote(MessageParcel &dat
|
||||
IMSA_HILOGE("agentObject is nullptr");
|
||||
return ErrorCode::ERROR_EX_PARCELABLE;
|
||||
}
|
||||
int32_t ret = SetCoreAndAgent(iface_cast<IInputMethodCore>(coreObject), iface_cast<IInputMethodAgent>(agentObject));
|
||||
int32_t ret = SetCoreAndAgent(iface_cast<IInputMethodCore>(coreObject), agentObject);
|
||||
return reply.WriteInt32(ret) ? ErrorCode::NO_ERROR : ErrorCode::ERROR_EX_PARCELABLE;
|
||||
}
|
||||
|
||||
@ -268,11 +266,13 @@ int32_t InputMethodSystemAbilityStub::PanelStatusChangeOnRemote(MessageParcel &d
|
||||
int32_t InputMethodSystemAbilityStub::UpdateListenEventFlagOnRemote(MessageParcel &data, MessageParcel &reply)
|
||||
{
|
||||
InputClientInfo clientInfo;
|
||||
sptr<IRemoteObject> client = nullptr;
|
||||
uint32_t eventFlag = 0;
|
||||
if (!ITypesUtil::Unmarshal(data, clientInfo, eventFlag)) {
|
||||
if (!ITypesUtil::Unmarshal(data, clientInfo, client, clientInfo.channel, eventFlag)) {
|
||||
IMSA_HILOGE("Unmarshal failed");
|
||||
return ErrorCode::ERROR_EX_PARCELABLE;
|
||||
}
|
||||
clientInfo.client = iface_cast<IInputClient>(client);
|
||||
int32_t ret = UpdateListenEventFlag(clientInfo, eventFlag);
|
||||
return reply.WriteInt32(ret) ? ErrorCode::NO_ERROR : ErrorCode::ERROR_EX_PARCELABLE;
|
||||
}
|
||||
@ -358,7 +358,7 @@ int32_t InputMethodSystemAbilityStub::ConnectSystemCmdOnRemote(MessageParcel &da
|
||||
return ErrorCode::ERROR_EX_PARCELABLE;
|
||||
}
|
||||
sptr<IRemoteObject> agent = nullptr;
|
||||
int32_t ret = ConnectSystemCmd(iface_cast<ISystemCmdChannel>(systemCmdStub), agent);
|
||||
int32_t ret = ConnectSystemCmd(systemCmdStub, agent);
|
||||
return reply.WriteInt32(ret) && reply.WriteRemoteObject(agent) ? ErrorCode::NO_ERROR
|
||||
: ErrorCode::ERROR_EX_PARCELABLE;
|
||||
}
|
||||
|
@ -21,11 +21,7 @@
|
||||
#include "element_name.h"
|
||||
#include "ime_cfg_manager.h"
|
||||
#include "ime_info_inquirer.h"
|
||||
#include "input_client_proxy.h"
|
||||
#include "input_control_channel_proxy.h"
|
||||
#include "input_data_channel_proxy.h"
|
||||
#include "input_method_agent_proxy.h"
|
||||
#include "input_method_core_proxy.h"
|
||||
#include "input_control_channel_stub.h"
|
||||
#include "input_type_manager.h"
|
||||
#include "ipc_skeleton.h"
|
||||
#include "iservice_registry.h"
|
||||
@ -493,7 +489,7 @@ int32_t PerUserSession::OnStartInput(const InputClientInfo &inputClientInfo, spt
|
||||
IMSA_HILOGE("data or agent is nullptr.");
|
||||
return ErrorCode::ERROR_IME_NOT_STARTED;
|
||||
}
|
||||
agent = data->agent->AsObject();
|
||||
agent = data->agent;
|
||||
return ErrorCode::NO_ERROR;
|
||||
}
|
||||
|
||||
@ -549,7 +545,7 @@ void PerUserSession::StopClientInput(const sptr<IInputClient> ¤tClient)
|
||||
IMSA_HILOGI("stop client input, ret: %{public}d", ret);
|
||||
}
|
||||
|
||||
void PerUserSession::StopImeInput(ImeType currentType, const sptr<IInputDataChannel> ¤tChannel)
|
||||
void PerUserSession::StopImeInput(ImeType currentType, const sptr<IRemoteObject> ¤tChannel)
|
||||
{
|
||||
auto data = GetImeData(currentType);
|
||||
if (data == nullptr) {
|
||||
@ -572,7 +568,7 @@ void PerUserSession::OnSecurityChange(int32_t security)
|
||||
IMSA_HILOGD("on security change, ret: %{public}d", ret);
|
||||
}
|
||||
|
||||
int32_t PerUserSession::OnSetCoreAndAgent(const sptr<IInputMethodCore> &core, const sptr<IInputMethodAgent> &agent)
|
||||
int32_t PerUserSession::OnSetCoreAndAgent(const sptr<IInputMethodCore> &core, const sptr<IRemoteObject> &agent)
|
||||
{
|
||||
IMSA_HILOGI("run in");
|
||||
auto imeType = ImeType::IME;
|
||||
@ -593,7 +589,7 @@ int32_t PerUserSession::OnSetCoreAndAgent(const sptr<IInputMethodCore> &core, co
|
||||
return ErrorCode::NO_ERROR;
|
||||
}
|
||||
|
||||
int32_t PerUserSession::OnRegisterProxyIme(const sptr<IInputMethodCore> &core, const sptr<IInputMethodAgent> &agent)
|
||||
int32_t PerUserSession::OnRegisterProxyIme(const sptr<IInputMethodCore> &core, const sptr<IRemoteObject> &agent)
|
||||
{
|
||||
IMSA_HILOGD("run in");
|
||||
auto imeType = ImeType::PROXY_IME;
|
||||
@ -756,7 +752,7 @@ void PerUserSession::NotifyImeChangeToClients(const Property &property, const Su
|
||||
}
|
||||
}
|
||||
|
||||
int32_t PerUserSession::AddImeData(ImeType type, sptr<IInputMethodCore> core, sptr<IInputMethodAgent> agent, pid_t pid)
|
||||
int32_t PerUserSession::AddImeData(ImeType type, sptr<IInputMethodCore> core, sptr<IRemoteObject> agent, pid_t pid)
|
||||
{
|
||||
if (core == nullptr || agent == nullptr) {
|
||||
IMSA_HILOGE("core or agent is nullptr");
|
||||
@ -1061,16 +1057,6 @@ bool PerUserSession::IsProxyImeStartInImeBind(ImeType bindImeType, ImeType start
|
||||
return startImeType == ImeType::PROXY_IME && bindImeType == ImeType::IME;
|
||||
}
|
||||
|
||||
bool PerUserSession::IsBindProxyImeInImeBind(ImeType bindImeType)
|
||||
{
|
||||
return bindImeType == ImeType::IME && IsProxyImeEnable();
|
||||
}
|
||||
|
||||
bool PerUserSession::IsBindImeInProxyImeBind(ImeType bindImeType)
|
||||
{
|
||||
return bindImeType == ImeType::PROXY_IME && !IsProxyImeEnable();
|
||||
}
|
||||
|
||||
bool PerUserSession::IsImeBindChanged(ImeType bindImeType)
|
||||
{
|
||||
return (bindImeType == ImeType::IME && IsProxyImeEnable())
|
||||
@ -1174,7 +1160,7 @@ int32_t PerUserSession::RequestIme(const std::shared_ptr<ImeData> &data, Request
|
||||
return ret;
|
||||
}
|
||||
|
||||
int32_t PerUserSession::OnConnectSystemCmd(const sptr<ISystemCmdChannel> &channel, sptr<IRemoteObject> &agent)
|
||||
int32_t PerUserSession::OnConnectSystemCmd(const sptr<IRemoteObject> &channel, sptr<IRemoteObject> &agent)
|
||||
{
|
||||
auto data = GetImeData(ImeType::IME);
|
||||
if (data == nullptr) {
|
||||
|
@ -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"
|
||||
|
@ -25,6 +25,7 @@ ohos_fuzztest("AgentStubFuzzTest") {
|
||||
fuzz_config_file = "//base/inputmethod/imf/test/fuzztest/agentstub_fuzzer"
|
||||
|
||||
include_dirs = [
|
||||
"${inputmethod_path}/common/include",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_ability/include",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/include",
|
||||
]
|
||||
@ -36,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" ]
|
||||
deps = [ "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability_static" ]
|
||||
|
||||
external_deps = [
|
||||
"c_utils:utils",
|
||||
"hilog:libhilog",
|
||||
"input:libmmi-client",
|
||||
"ipc:ipc_single",
|
||||
]
|
||||
}
|
||||
|
@ -18,7 +18,6 @@
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
|
||||
#include "global.h"
|
||||
#include "input_method_agent_stub.h"
|
||||
#include "message_parcel.h"
|
||||
|
||||
|
@ -36,7 +36,7 @@ ohos_fuzztest("ControlChannelStubFuzzTest") {
|
||||
|
||||
sources = [ "controlchannelstub_fuzzer.cpp" ]
|
||||
|
||||
deps = [ "${inputmethod_path}/services:inputmethod_service" ]
|
||||
deps = [ "${inputmethod_path}/services:inputmethod_service_static" ]
|
||||
|
||||
external_deps = [
|
||||
"c_utils:utils",
|
||||
|
@ -25,6 +25,7 @@ ohos_fuzztest("CoreStubFuzzTest") {
|
||||
fuzz_config_file = "//base/inputmethod/imf/test/fuzztest/corestub_fuzzer"
|
||||
|
||||
include_dirs = [
|
||||
"${inputmethod_path}/common/include",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/include",
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_ability/include",
|
||||
"${inputmethod_path}/interfaces/inner_api/inputmethod_controller/include",
|
||||
@ -37,12 +38,9 @@ ohos_fuzztest("CoreStubFuzzTest") {
|
||||
"-fno-omit-frame-pointer",
|
||||
]
|
||||
|
||||
sources = [
|
||||
"${inputmethod_path}/frameworks/native/inputmethod_controller/src/keyevent_consumer_proxy.cpp",
|
||||
"corestub_fuzzer.cpp",
|
||||
]
|
||||
sources = [ "corestub_fuzzer.cpp" ]
|
||||
|
||||
deps = [ "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability" ]
|
||||
deps = [ "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability_static" ]
|
||||
|
||||
external_deps = [
|
||||
"c_utils:utils",
|
||||
|
@ -18,7 +18,6 @@
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
|
||||
#include "global.h"
|
||||
#include "input_method_core_stub.h"
|
||||
#include "message_parcel.h"
|
||||
|
||||
|
@ -37,7 +37,7 @@ ohos_fuzztest("InputClientStubFuzzTest") {
|
||||
sources = [ "inputclientstub_fuzzer.cpp" ]
|
||||
|
||||
deps = [
|
||||
"${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability",
|
||||
"${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability_static",
|
||||
"${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
|
||||
"${inputmethod_path}/services:inputmethod_service",
|
||||
]
|
||||
@ -46,6 +46,7 @@ ohos_fuzztest("InputClientStubFuzzTest") {
|
||||
"ability_runtime:ability_manager",
|
||||
"c_utils:utils",
|
||||
"hilog:libhilog",
|
||||
"input:libmmi-client",
|
||||
"ipc:ipc_single",
|
||||
]
|
||||
}
|
||||
|
@ -62,8 +62,7 @@ void TextOnInputReady()
|
||||
MessageParcel data;
|
||||
data.WriteRemoteObject(mInputMethodAgentStub->AsObject());
|
||||
auto remoteObject = data.ReadRemoteObject();
|
||||
sptr<IInputMethodAgent> iface = iface_cast<IInputMethodAgent>(remoteObject);
|
||||
mClient->OnInputReady(iface);
|
||||
mClient->OnInputReady(remoteObject);
|
||||
}
|
||||
|
||||
void TestOnSwitchInput()
|
||||
|
@ -49,6 +49,7 @@ ohos_fuzztest("InputMethodAbilityFuzzTest") {
|
||||
"input:libmmi-client",
|
||||
"ipc:ipc_single",
|
||||
"napi:ace_napi",
|
||||
"window_manager:libwm",
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -38,25 +38,22 @@ 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",
|
||||
"${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability_static",
|
||||
"${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
|
||||
"${inputmethod_path}/services:inputmethod_service",
|
||||
"${inputmethod_path}/services/json:imf_json_static",
|
||||
"//third_party/cJSON:cjson",
|
||||
"${inputmethod_path}/services:inputmethod_service_static",
|
||||
]
|
||||
|
||||
external_deps = [
|
||||
"ability_runtime:ability_manager",
|
||||
"c_utils:utils",
|
||||
"hilog:libhilog",
|
||||
"input:libmmi-client",
|
||||
"ipc:ipc_single",
|
||||
"napi:ace_napi",
|
||||
"window_manager:libwm",
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -30,10 +30,12 @@
|
||||
#include "i_input_method_agent.h"
|
||||
#include "i_input_method_core.h"
|
||||
#include "input_client_proxy.h"
|
||||
#include "input_client_stub.h"
|
||||
#include "input_method_ability.h"
|
||||
#include "input_method_agent_proxy.h"
|
||||
#include "input_method_agent_stub.h"
|
||||
#include "input_method_core_proxy.h"
|
||||
#include "input_method_core_stub.h"
|
||||
#include "input_method_info.h"
|
||||
#include "input_method_property.h"
|
||||
#include "iremote_broker.h"
|
||||
@ -56,16 +58,15 @@ uint32_t ConvertToUint32(const uint8_t *ptr)
|
||||
|
||||
bool InitializeClientInfo(InputClientInfo &clientInfo)
|
||||
{
|
||||
auto clientStub = new (std::nothrow) InputClientStub();
|
||||
sptr<IInputClient> clientStub = new (std::nothrow) InputClientStub();
|
||||
if (clientStub == nullptr) {
|
||||
IMSA_HILOGE("failed to create client");
|
||||
return false;
|
||||
}
|
||||
auto deathRecipient = new (std::nothrow) InputDeathRecipient();
|
||||
sptr<InputDeathRecipient> deathRecipient = new (std::nothrow) InputDeathRecipient();
|
||||
if (deathRecipient == nullptr) {
|
||||
IMSA_HILOGE("failed to new deathRecipient");
|
||||
delete clientStub;
|
||||
return ErrorCode::ERROR_EX_NULL_POINTER;
|
||||
return false;
|
||||
}
|
||||
clientInfo = { .userID = MAIN_USER_ID, .client = clientStub, .deathRecipient = deathRecipient };
|
||||
return true;
|
||||
@ -92,13 +93,13 @@ bool FuzzPerUserSession(const uint8_t *rawData, size_t size)
|
||||
auto agent = iface_cast<IInputMethodAgent>(agentStub);
|
||||
static std::shared_ptr<PerUserSession> userSessions = std::make_shared<PerUserSession>(MAIN_USER_ID);
|
||||
|
||||
userSessions->OnRegisterProxyIme(core, agent);
|
||||
userSessions->OnRegisterProxyIme(core, agent->AsObject());
|
||||
int32_t type = 4;
|
||||
userSessions->OnUnRegisteredProxyIme(static_cast<UnRegisteredType>(type), core);
|
||||
userSessions->IsProxyImeEnable();
|
||||
|
||||
userSessions->OnPrepareInput(clientInfo);
|
||||
userSessions->OnSetCoreAndAgent(core, agent);
|
||||
userSessions->OnSetCoreAndAgent(core, agent->AsObject());
|
||||
userSessions->OnShowCurrentInput();
|
||||
sptr<IRemoteObject> agentObject = nullptr;
|
||||
clientInfo.isShowKeyboard = false;
|
||||
|
@ -41,10 +41,8 @@ ohos_fuzztest("SystemAbilityStubFuzzTest") {
|
||||
|
||||
deps = [
|
||||
"${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
|
||||
"${inputmethod_path}/services:inputmethod_service",
|
||||
"${inputmethod_path}/services/adapter/settings_data_provider:settings_data_static",
|
||||
"${inputmethod_path}/services:inputmethod_service_static",
|
||||
"${inputmethod_path}/test/common:inputmethod_test_common",
|
||||
"//third_party/cJSON:cjson",
|
||||
]
|
||||
|
||||
external_deps = [
|
||||
|
@ -41,10 +41,8 @@ ohos_static_library("imf_sa_stub_fuzztest_common_static") {
|
||||
|
||||
public_deps = [
|
||||
"${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
|
||||
"${inputmethod_path}/services:inputmethod_service",
|
||||
"${inputmethod_path}/services/adapter/settings_data_provider:settings_data_static",
|
||||
"${inputmethod_path}/services:inputmethod_service_static",
|
||||
"${inputmethod_path}/test/common:inputmethod_test_common",
|
||||
"//third_party/cJSON:cjson",
|
||||
]
|
||||
|
||||
public_configs = [ ":imf_sa_stub_fuzztest_common_config" ]
|
||||
|
@ -32,7 +32,6 @@ group("unittest") {
|
||||
"cpp_test:InputMethodPrivateMemberTest",
|
||||
"cpp_test:InputMethodServiceTest",
|
||||
"cpp_test:InputMethodSwitchTest",
|
||||
"cpp_test:InputMethodUtilsTest",
|
||||
"cpp_test:JsonOperateTest",
|
||||
"cpp_test:NewImeSwitchTest",
|
||||
"cpp_test:SecurityModeParseTest",
|
||||
|
@ -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,17 +115,16 @@ 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",
|
||||
"${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
|
||||
@ -164,11 +164,6 @@ 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",
|
||||
"${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
|
||||
@ -207,10 +202,10 @@ ohos_unittest("InputMethodDfxTest") {
|
||||
configs = [ ":module_private_config" ]
|
||||
|
||||
deps = [
|
||||
"${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}/services/dfx:inputmethod_dfx_static",
|
||||
"${inputmethod_path}/test/common:inputmethod_test_common",
|
||||
"${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
|
||||
"//third_party/googletest:gtest_main",
|
||||
@ -247,11 +242,6 @@ 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",
|
||||
"${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
|
||||
@ -280,32 +270,6 @@ ohos_unittest("InputMethodPanelTest") {
|
||||
]
|
||||
}
|
||||
|
||||
ohos_unittest("InputMethodUtilsTest") {
|
||||
branch_protector_ret = "pac_ret"
|
||||
sanitize = {
|
||||
cfi = true
|
||||
cfi_cross_dso = true
|
||||
debug = false
|
||||
}
|
||||
module_out_path = module_output_path
|
||||
|
||||
sources = [
|
||||
"src/block_queue_test.cpp",
|
||||
"src/input_method_utils_test.cpp",
|
||||
]
|
||||
|
||||
deps = [
|
||||
"${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
|
||||
"//third_party/googletest:gtest_main",
|
||||
]
|
||||
|
||||
external_deps = [
|
||||
"c_utils:utils",
|
||||
"hilog:libhilog",
|
||||
"ipc:ipc_core",
|
||||
]
|
||||
}
|
||||
|
||||
ohos_unittest("InputMethodSwitchTest") {
|
||||
branch_protector_ret = "pac_ret"
|
||||
sanitize = {
|
||||
@ -350,17 +314,20 @@ 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",
|
||||
"${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
|
||||
"${inputmethod_path}/services:inputmethod_service",
|
||||
"${inputmethod_path}/services/adapter/settings_data_provider:settings_data_static",
|
||||
"${inputmethod_path}/services:inputmethod_service_static",
|
||||
"${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
|
||||
"//third_party/cJSON:cjson",
|
||||
"//third_party/googletest:gtest_main",
|
||||
]
|
||||
|
||||
@ -376,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",
|
||||
]
|
||||
@ -468,19 +436,10 @@ ohos_unittest("IdentityCheckerTest") {
|
||||
|
||||
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",
|
||||
"${inputmethod_path}/services:inputmethod_service",
|
||||
"${inputmethod_path}/services/adapter/settings_data_provider:settings_data_static",
|
||||
"${inputmethod_path}/services:inputmethod_service_static",
|
||||
"${inputmethod_path}/test/common:inputmethod_test_common",
|
||||
"${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
|
||||
"//third_party/cJSON:cjson",
|
||||
"//third_party/googletest:gtest_main",
|
||||
]
|
||||
|
||||
@ -556,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",
|
||||
@ -644,7 +598,6 @@ ohos_unittest("SecurityModeParseTest") {
|
||||
|
||||
include_dirs = [
|
||||
"${inputmethod_path}/test/unittest/cpp_test/mock",
|
||||
"${inputmethod_path}/common",
|
||||
"${inputmethod_path}/services/include",
|
||||
"${inputmethod_path}/services/identity_checker/include",
|
||||
"${inputmethod_path}/services/adapter/settings_data_provider/include",
|
||||
@ -662,9 +615,7 @@ ohos_unittest("SecurityModeParseTest") {
|
||||
]
|
||||
|
||||
deps = [
|
||||
"${inputmethod_path}/services:inputmethod_service",
|
||||
"${inputmethod_path}/services/json:imf_json_static",
|
||||
"//third_party/cJSON:cjson",
|
||||
"${inputmethod_path}/services:inputmethod_service_static",
|
||||
"//third_party/googletest:gmock",
|
||||
"//third_party/googletest:gtest_main",
|
||||
]
|
||||
@ -697,12 +648,8 @@ ohos_unittest("ImeFreezeManagerTest") {
|
||||
configs = [ ":module_private_config" ]
|
||||
|
||||
deps = [
|
||||
"${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}/services/adapter/settings_data_provider:settings_data_static",
|
||||
"${inputmethod_path}/services:inputmethod_service_static",
|
||||
"${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
|
||||
"//third_party/cJSON:cjson",
|
||||
"//third_party/googletest:gtest_main",
|
||||
]
|
||||
|
||||
@ -735,9 +682,8 @@ ohos_unittest("JsonOperateTest") {
|
||||
sources = [ "src/json_operate_test.cpp" ]
|
||||
|
||||
deps = [
|
||||
"${inputmethod_path}/services:inputmethod_service",
|
||||
"${inputmethod_path}/services:inputmethod_service_static",
|
||||
"${inputmethod_path}/services/adapter/settings_data_provider:settings_data_static",
|
||||
"${inputmethod_path}/services/file:imf_file_static",
|
||||
"${inputmethod_path}/services/json:imf_json_static",
|
||||
"//third_party/cJSON:cjson",
|
||||
"//third_party/googletest:gtest_main",
|
||||
|
@ -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"
|
||||
|
@ -145,7 +145,7 @@ public:
|
||||
auto agent = inputMethodAbility_->agentStub_->AsObject();
|
||||
imc_->SetAgent(agent);
|
||||
|
||||
sptr<IInputDataChannel> channel = iface_cast<IInputDataChannel>(imc_->clientInfo_.channel->AsObject());
|
||||
sptr<IInputDataChannel> channel = iface_cast<IInputDataChannel>(imc_->clientInfo_.channel);
|
||||
inputMethodAbility_->SetInputDataChannel(channel->AsObject());
|
||||
IMSA_HILOGI("end");
|
||||
}
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include "common_event_support.h"
|
||||
#include "display_manager.h"
|
||||
#include "global.h"
|
||||
#include "ime_event_monitor_manager.h"
|
||||
#include "input_method_ability.h"
|
||||
#include "input_method_controller.h"
|
||||
#include "input_method_engine_listener_impl.h"
|
||||
|
@ -43,6 +43,7 @@
|
||||
using namespace testing::ext;
|
||||
namespace OHOS {
|
||||
namespace MiscServices {
|
||||
using namespace AppExecFwk;
|
||||
class InputMethodPrivateMemberTest : public testing::Test {
|
||||
public:
|
||||
static void SetUpTestCase(void);
|
||||
|
@ -22,7 +22,6 @@
|
||||
|
||||
#include "global.h"
|
||||
#include "ime_event_monitor_manager_impl.h"
|
||||
#include "ime_info_inquirer.h"
|
||||
#include "ime_setting_listener_test_impl.h"
|
||||
#include "input_method_controller.h"
|
||||
#include "input_method_property.h"
|
||||
@ -47,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;
|
||||
};
|
||||
@ -58,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\"]}}";
|
||||
@ -71,15 +68,11 @@ constexpr const char *ENABLE_IME_KEYWORD = "settings.inputmethod.enable_ime";
|
||||
void InputMethodSwitchTest::SetUpTestCase(void)
|
||||
{
|
||||
IMSA_HILOGI("InputMethodSwitchTest::SetUpTestCase");
|
||||
ImeInfoInquirer::GetInstance().InitSystemConfig();
|
||||
enableOn = ImeInfoInquirer::GetInstance().IsEnableInputMethod();
|
||||
TddUtil::GrantNativePermission();
|
||||
if (enableOn == true) {
|
||||
int32_t ret = TddUtil::GetEnableData(beforeValue);
|
||||
if (ret == ErrorCode::NO_ERROR) {
|
||||
IMSA_HILOGI("Enable ime switch test.");
|
||||
int32_t ret = TddUtil::GetEnableData(beforeValue);
|
||||
if (ret == ErrorCode::NO_ERROR) {
|
||||
TddUtil::PushEnableImeValue(ENABLE_IME_KEYWORD, allEnableIme);
|
||||
}
|
||||
TddUtil::PushEnableImeValue(ENABLE_IME_KEYWORD, allEnableIme);
|
||||
}
|
||||
TddUtil::StorageSelfTokenID();
|
||||
TddUtil::SetTestTokenID(
|
||||
@ -92,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();
|
||||
}
|
||||
@ -268,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();
|
||||
@ -290,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();
|
||||
|
@ -1,69 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2021-2023 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#include "input_method_utils.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <gtest/gtest.h>
|
||||
#include <string>
|
||||
#include <sys/time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "global.h"
|
||||
|
||||
using namespace testing::ext;
|
||||
namespace OHOS {
|
||||
namespace MiscServices {
|
||||
class InputMethodUtilsTest : public testing::Test {
|
||||
public:
|
||||
static void SetUpTestCase(void);
|
||||
static void TearDownTestCase(void);
|
||||
void SetUp();
|
||||
void TearDown();
|
||||
};
|
||||
|
||||
void InputMethodUtilsTest::SetUpTestCase(void)
|
||||
{
|
||||
IMSA_HILOGI("InputMethodUtilsTest::SetUpTestCase");
|
||||
}
|
||||
|
||||
void InputMethodUtilsTest::TearDownTestCase(void)
|
||||
{
|
||||
IMSA_HILOGI("InputMethodUtilsTest::TearDownTestCase");
|
||||
}
|
||||
|
||||
void InputMethodUtilsTest::SetUp(void)
|
||||
{
|
||||
IMSA_HILOGI("InputMethodUtilsTest::SetUp");
|
||||
}
|
||||
|
||||
void InputMethodUtilsTest::TearDown(void)
|
||||
{
|
||||
IMSA_HILOGI("InputMethodUtilsTest::TearDown");
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: inputMethodUtils_functionKey_001
|
||||
* @tc.desc: Checkout FunctionKey.
|
||||
* @tc.type: FUNC
|
||||
*/
|
||||
HWTEST_F(InputMethodUtilsTest, inputMethodUtils_functionKey_001, TestSize.Level0)
|
||||
{
|
||||
FunctionKey info;
|
||||
info.SetEnterKeyType(EnterKeyType::UNSPECIFIED);
|
||||
EnterKeyType keyType = info.GetEnterKeyType();
|
||||
EXPECT_EQ(keyType, EnterKeyType::UNSPECIFIED);
|
||||
}
|
||||
} // namespace MiscServices
|
||||
} // namespace OHOS
|
@ -21,7 +21,6 @@
|
||||
|
||||
#include "global.h"
|
||||
#include "ime_event_monitor_manager_impl.h"
|
||||
#include "ime_info_inquirer.h"
|
||||
#include "ime_setting_listener_test_impl.h"
|
||||
#include "input_method_controller.h"
|
||||
#include "input_method_property.h"
|
||||
@ -45,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;
|
||||
};
|
||||
@ -55,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;
|
||||
@ -64,15 +61,11 @@ constexpr const char *ENABLE_IME_KEYWORD = "settings.inputmethod.enable_ime";
|
||||
void NewImeSwitchTest::SetUpTestCase(void)
|
||||
{
|
||||
IMSA_HILOGI("NewImeSwitchTest::SetUpTestCase");
|
||||
ImeInfoInquirer::GetInstance().InitSystemConfig();
|
||||
enableOn = ImeInfoInquirer::GetInstance().IsEnableInputMethod();
|
||||
TddUtil::GrantNativePermission();
|
||||
if (enableOn == true) {
|
||||
int32_t ret = TddUtil::GetEnableData(beforeValue);
|
||||
if (ret == ErrorCode::NO_ERROR) {
|
||||
IMSA_HILOGI("Enable ime switch test.");
|
||||
int32_t ret = TddUtil::GetEnableData(beforeValue);
|
||||
if (ret == ErrorCode::NO_ERROR) {
|
||||
TddUtil::PushEnableImeValue(ENABLE_IME_KEYWORD, allEnableIme);
|
||||
}
|
||||
TddUtil::PushEnableImeValue(ENABLE_IME_KEYWORD, allEnableIme);
|
||||
}
|
||||
TddUtil::StorageSelfTokenID();
|
||||
TddUtil::SetTestTokenID(
|
||||
@ -85,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();
|
||||
}
|
||||
|
@ -17,8 +17,6 @@
|
||||
#define protected public
|
||||
#include "security_mode_parser.h"
|
||||
|
||||
#include "ime_cfg_manager.h"
|
||||
#include "ime_info_inquirer.h"
|
||||
#include "input_method_system_ability.h"
|
||||
#undef private
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user