mirror of
https://github.com/openharmony/miscservices_inputmethod.git
synced 2026-07-20 23:45:31 -04:00
!91 更新主干bug修改
Merge pull request !91 from demon/OpenHarmony-3.1-Release
This commit is contained in:
@@ -426,7 +426,8 @@ namespace MiscServices {
|
||||
return;
|
||||
}
|
||||
|
||||
int32_t InputMethodAbility::GetEnterKeyType() {
|
||||
int32_t InputMethodAbility::GetEnterKeyType()
|
||||
{
|
||||
IMSA_HILOGI("InputMethodAbility::GetEnterKeyType");
|
||||
|
||||
if (inputDataChannel == nullptr) {
|
||||
@@ -436,7 +437,8 @@ namespace MiscServices {
|
||||
return inputDataChannel->GetEnterKeyType();
|
||||
}
|
||||
|
||||
int32_t InputMethodAbility::GetInputPattern() {
|
||||
int32_t InputMethodAbility::GetInputPattern()
|
||||
{
|
||||
IMSA_HILOGI("InputMethodAbility::GetInputPattern");
|
||||
|
||||
if (inputDataChannel == nullptr) {
|
||||
@@ -446,7 +448,8 @@ namespace MiscServices {
|
||||
return inputDataChannel->GetInputPattern();
|
||||
}
|
||||
|
||||
void InputMethodAbility::StopInput() {
|
||||
void InputMethodAbility::StopInput()
|
||||
{
|
||||
IMSA_HILOGI("InputMethodAbility::StopInput");
|
||||
|
||||
if (inputDataChannel == nullptr) {
|
||||
|
||||
@@ -32,6 +32,11 @@ namespace MiscServices {
|
||||
sptr<IInputControlChannel> &inputControlChannel)
|
||||
{
|
||||
IMSA_HILOGI("InputMethodCoreProxy::initializeInput");
|
||||
auto remote = Remote();
|
||||
if (remote == nullptr) {
|
||||
IMSA_HILOGI("remote is nullptr");
|
||||
return ErrorCode::ERROR_NULL_POINTER;
|
||||
}
|
||||
if (startInputToken == nullptr) {
|
||||
IMSA_HILOGI("InputMethodCoreProxy::initializeInput startInputToken is nullptr");
|
||||
}
|
||||
@@ -56,7 +61,7 @@ namespace MiscServices {
|
||||
MessageOption option {
|
||||
MessageOption::TF_SYNC
|
||||
};
|
||||
int32_t status = Remote()->SendRequest(INITIALIZE_INPUT, data, reply, option);
|
||||
int32_t status = remote->SendRequest(INITIALIZE_INPUT, data, reply, option);
|
||||
if (status != ErrorCode::NO_ERROR) {
|
||||
IMSA_HILOGI("InputMethodCoreProxy::initializeInput status = %{public}d", status);
|
||||
return status;
|
||||
@@ -68,7 +73,11 @@ namespace MiscServices {
|
||||
int32_t InputMethodCoreProxy::InitInputControlChannel(sptr<IInputControlChannel> &inputControlChannel)
|
||||
{
|
||||
IMSA_HILOGI("InputMethodCoreProxy::InitInputControlChannel");
|
||||
|
||||
auto remote = Remote();
|
||||
if (remote == nullptr) {
|
||||
IMSA_HILOGI("remote is nullptr");
|
||||
return ErrorCode::ERROR_NULL_POINTER;
|
||||
}
|
||||
if (inputControlChannel == nullptr) {
|
||||
IMSA_HILOGI("InputMethodCoreProxy::InitInputControlChannel inputControlChannel is nullptr");
|
||||
return ErrorCode::ERROR_EX_NULL_POINTER;
|
||||
@@ -78,12 +87,13 @@ namespace MiscServices {
|
||||
sptr<IRemoteObject> channelObject = inputControlChannel->AsObject();
|
||||
if (channelObject == nullptr) {
|
||||
IMSA_HILOGI("InputMethodCoreProxy::InitInputControlChannel channelObject is nullptr");
|
||||
return ErrorCode::ERROR_EX_NULL_POINTER;
|
||||
}
|
||||
data.WriteRemoteObject(channelObject);
|
||||
MessageOption option {
|
||||
MessageOption::TF_SYNC
|
||||
};
|
||||
int32_t status = Remote()->SendRequest(INIT_INPUT_CONTROL_CHANNEL, data, reply, option);
|
||||
int32_t status = remote->SendRequest(INIT_INPUT_CONTROL_CHANNEL, data, reply, option);
|
||||
if (status != ErrorCode::NO_ERROR) {
|
||||
IMSA_HILOGI("InputMethodCoreProxy::InitInputControlChannel status = %{public}d", status);
|
||||
return status;
|
||||
@@ -95,6 +105,11 @@ namespace MiscServices {
|
||||
void InputMethodCoreProxy::SetClientState(bool state)
|
||||
{
|
||||
IMSA_HILOGI("InputMethodCoreProxy::SetClientState");
|
||||
auto remote = Remote();
|
||||
if (remote == nullptr) {
|
||||
IMSA_HILOGI("remote is nullptr");
|
||||
return;
|
||||
}
|
||||
MessageParcel data;
|
||||
if (!(data.WriteInterfaceToken(GetDescriptor())
|
||||
&& data.WriteBool(state))) {
|
||||
@@ -106,7 +121,7 @@ namespace MiscServices {
|
||||
MessageOption::TF_SYNC
|
||||
};
|
||||
|
||||
int32_t status = Remote()->SendRequest(SET_CLIENT_STATE, data, reply, option);
|
||||
int32_t status = remote->SendRequest(SET_CLIENT_STATE, data, reply, option);
|
||||
if (status != ErrorCode::NO_ERROR) {
|
||||
IMSA_HILOGI("InputMethodCoreProxy::SetClientState status = %{public}d", status);
|
||||
}
|
||||
@@ -115,6 +130,11 @@ namespace MiscServices {
|
||||
const InputAttribute& editorAttribute, bool supportPhysicalKbd)
|
||||
{
|
||||
IMSA_HILOGI("InputMethodCoreProxy::startInput");
|
||||
auto remote = Remote();
|
||||
if (remote == nullptr) {
|
||||
IMSA_HILOGI("remote is nullptr");
|
||||
return false;
|
||||
}
|
||||
if (inputDataChannel == nullptr) {
|
||||
IMSA_HILOGI("InputMethodCoreProxy::startInput inputDataChannel is nullptr");
|
||||
}
|
||||
@@ -132,7 +152,7 @@ namespace MiscServices {
|
||||
MessageOption::TF_SYNC
|
||||
};
|
||||
|
||||
int32_t status = Remote()->SendRequest(START_INPUT, data, reply, option);
|
||||
int32_t status = remote->SendRequest(START_INPUT, data, reply, option);
|
||||
if (status != ErrorCode::NO_ERROR) {
|
||||
IMSA_HILOGI("InputMethodCoreProxy::startInput status = %{public}d", status);
|
||||
return false;
|
||||
@@ -145,12 +165,17 @@ namespace MiscServices {
|
||||
int32_t InputMethodCoreProxy::stopInput()
|
||||
{
|
||||
IMSA_HILOGI("InputMethodCoreProxy::stopInput");
|
||||
auto remote = Remote();
|
||||
if (remote == nullptr) {
|
||||
IMSA_HILOGI("remote is nullptr");
|
||||
return ErrorCode::ERROR_NULL_POINTER;
|
||||
}
|
||||
MessageParcel data, reply;
|
||||
data.WriteInterfaceToken(GetDescriptor());
|
||||
MessageOption option {
|
||||
MessageOption::TF_SYNC
|
||||
};
|
||||
int32_t status = Remote()->SendRequest(STOP_INPUT, data, reply, option);
|
||||
int32_t status = remote->SendRequest(STOP_INPUT, data, reply, option);
|
||||
if (status != ErrorCode::NO_ERROR) {
|
||||
IMSA_HILOGI("InputMethodCoreProxy::stopInput status = %{public}d", status);
|
||||
return status;
|
||||
@@ -192,7 +217,6 @@ namespace MiscServices {
|
||||
void InputMethodCoreProxy::StopInputService(std::string imeId)
|
||||
{
|
||||
IMSA_HILOGI("InputMethodCoreProxy::StopInputService");
|
||||
|
||||
auto remote = Remote();
|
||||
if (remote == nullptr) {
|
||||
IMSA_HILOGI("InputMethodCoreProxy::StopInputService remote is nullptr");
|
||||
@@ -241,13 +265,18 @@ namespace MiscServices {
|
||||
int32_t InputMethodCoreProxy::setKeyboardType(const KeyboardType& type)
|
||||
{
|
||||
IMSA_HILOGI("InputMethodCoreProxy::setKeyboardType");
|
||||
auto remote = Remote();
|
||||
if (remote == nullptr) {
|
||||
IMSA_HILOGI("remote is nullptr");
|
||||
return ErrorCode::ERROR_NULL_POINTER;
|
||||
}
|
||||
MessageParcel data, reply;
|
||||
data.WriteInterfaceToken(GetDescriptor());
|
||||
data.WriteParcelable(&type);
|
||||
MessageOption option {
|
||||
MessageOption::TF_SYNC
|
||||
};
|
||||
int32_t status = Remote()->SendRequest(SET_KEYBOARD_TYPE, data, reply, option);
|
||||
int32_t status = remote->SendRequest(SET_KEYBOARD_TYPE, data, reply, option);
|
||||
if (status != ErrorCode::NO_ERROR) {
|
||||
return status;
|
||||
}
|
||||
@@ -258,12 +287,17 @@ namespace MiscServices {
|
||||
int32_t InputMethodCoreProxy::getKeyboardWindowHeight(int32_t retHeight)
|
||||
{
|
||||
IMSA_HILOGI("InputMethodCoreProxy::getKeyboardWindowHeight");
|
||||
auto remote = Remote();
|
||||
if (remote == nullptr) {
|
||||
IMSA_HILOGI("remote is nullptr");
|
||||
return ErrorCode::ERROR_NULL_POINTER;
|
||||
}
|
||||
MessageParcel data, reply;
|
||||
data.WriteInterfaceToken(GetDescriptor());
|
||||
MessageOption option {
|
||||
MessageOption::TF_SYNC
|
||||
};
|
||||
int32_t status = Remote()->SendRequest(GET_KEYBOARD_WINDOW_HEIGHT, data, reply, option);
|
||||
int32_t status = remote->SendRequest(GET_KEYBOARD_WINDOW_HEIGHT, data, reply, option);
|
||||
if (status != ErrorCode::NO_ERROR) {
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#include "js_input_method_setting.h"
|
||||
namespace OHOS {
|
||||
namespace MiscServices {
|
||||
// class JsInputMethodSetting;
|
||||
NativeValue *CreateInputMethodSetting(NativeEngine& engine);
|
||||
NativeValue *CreateInputMethodController(NativeEngine& engine);
|
||||
}
|
||||
|
||||
@@ -22,8 +22,6 @@
|
||||
#include "input_method_ability.h"
|
||||
namespace OHOS {
|
||||
namespace MiscServices {
|
||||
// constexpr size_t ARGC_ZERO = 0;
|
||||
|
||||
void JsEditorAttribute::Finalizer(NativeEngine* engine, void* data, void* hint)
|
||||
{
|
||||
IMSA_HILOGI("JsEditorAttribute::Finalizer is called");
|
||||
|
||||
@@ -137,6 +137,7 @@ namespace MiscServices {
|
||||
state_ = ServiceRunningState::STATE_RUNNING;
|
||||
std::string defaultIme = ParaHandle::GetDefaultIme(userId_);
|
||||
StartInputService(defaultIme);
|
||||
StartUserIdListener();
|
||||
return ErrorCode::NO_ERROR;
|
||||
}
|
||||
|
||||
@@ -182,8 +183,6 @@ namespace MiscServices {
|
||||
|
||||
userId_ = MAIN_USER_ID;
|
||||
setting->Initialize();
|
||||
|
||||
StartUserIdListener();
|
||||
}
|
||||
|
||||
void InputMethodSystemAbility::StartUserIdListener()
|
||||
@@ -884,6 +883,7 @@ namespace MiscServices {
|
||||
IMSA_HILOGI("InputMethodSystemAbility::OnDisplayOptionalInputMethod has no ime");
|
||||
return;
|
||||
}
|
||||
|
||||
std::string defaultIme = ParaHandle::GetDefaultIme(userId_);
|
||||
std::string params = "";
|
||||
std::vector<InputMethodProperty*>::iterator it;
|
||||
|
||||
@@ -34,6 +34,10 @@ namespace MiscServices {
|
||||
int PlatformCallbackStub::OnRemoteRequest(uint32_t code, MessageParcel& data, MessageParcel& reply,
|
||||
MessageOption& option)
|
||||
{
|
||||
auto descriptorToken = data.ReadInterfaceToken();
|
||||
if (descriptorToken != GetDescriptor()) {
|
||||
return ErrorCode::ERROR_STATUS_UNKNOWN_TRANSACTION;
|
||||
}
|
||||
switch (code) {
|
||||
case NOTIFY_EVENT: {
|
||||
int eventId = data.ReadInt32();
|
||||
|
||||
Reference in New Issue
Block a user