fix codex warning

Signed-off-by: zhouyongfei <zhouyongfei@huawei.com>
This commit is contained in:
zhouyongfei
2021-09-22 15:59:51 +08:00
parent cc82dbf2ff
commit 6f1ed85e60
65 changed files with 2693 additions and 2785 deletions
@@ -18,12 +18,11 @@
namespace OHOS {
namespace MiscServices {
using namespace ErrorCode;
InputClientProxy::InputClientProxy(const sptr<IRemoteObject> &object) : IRemoteProxy<IInputClient>(object)
{
InputClientProxy::InputClientProxy(const sptr<IRemoteObject> &object) : IRemoteProxy<IInputClient>(object) {
}
int32_t InputClientProxy::onInputReady(int32_t retValue, const sptr<IInputMethodAgent>& agent, const InputChannel* channel)
{
int32_t InputClientProxy::onInputReady(int32_t retValue, const sptr<IInputMethodAgent>& agent,
const InputChannel* channel) {
IMSA_HILOGI("InputClientProxy::onInputReady");
MessageParcel data, reply;
MessageOption option;
@@ -18,88 +18,86 @@
namespace OHOS {
namespace MiscServices {
InputClientStub::InputClientStub()
{
InputClientStub::InputClientStub()
{
}
InputClientStub::~InputClientStub()
{
}
int32_t InputClientStub::OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply,
MessageOption &option)
{
IMSA_HILOGI("InputClientStub::OnRemoteRequest. code = %{public}u", code);
auto descriptorToken = data.ReadInterfaceToken();
if (descriptorToken != GetDescriptor()) {
return ErrorCode::ERROR_STATUS_UNKNOWN_TRANSACTION;
}
switch (code) {
case ON_INPUT_READY: {
if (msgHandler == nullptr) {
break;
}
MessageParcel* parcel = new MessageParcel();
parcel->WriteInt32(data.ReadInt32());
if (data.ReadInt32() > 0) {
parcel->WriteRemoteObject(data.ReadRemoteObject());
}
if (data.ReadInt32() > 0) {
parcel->WriteParcelable(data.ReadParcelable<InputChannel>());
}
Message* msg = new Message(MessageID::MSG_ID_ON_INPUT_READY, parcel);
msgHandler->SendMessage(msg);
break;
}
case ON_INPUT_RELEASED: {
if (msgHandler == nullptr) {
break;
}
MessageParcel* parcel = new MessageParcel();
parcel->WriteInt32(data.ReadInt32());
Message* msg = new Message(MessageID::MSG_ID_EXIT_SERVICE, parcel);
msgHandler->SendMessage(msg);
break;
}
case SET_DISPLAY_MODE: {
if (msgHandler == nullptr) {
break;
}
MessageParcel* parcel = new MessageParcel();
parcel->WriteInt32(data.ReadInt32());
Message* msg = new Message(MessageID::MSG_ID_SET_DISPLAY_MODE, parcel);
msgHandler->SendMessage(msg);
break;
}
default:
return IPCObjectStub::OnRemoteRequest(code, data, reply, option);
InputClientStub::~InputClientStub()
{
}
return NO_ERROR;
}
int32_t InputClientStub::onInputReady(int32_t retValue, const sptr<IInputMethodAgent>& agent, const InputChannel* channel)
{
return ErrorCode::NO_ERROR;
}
int32_t InputClientStub::OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply,
MessageOption &option)
{
IMSA_HILOGI("InputClientStub::OnRemoteRequest. code = %{public}u", code);
auto descriptorToken = data.ReadInterfaceToken();
if (descriptorToken != GetDescriptor()) {
return ErrorCode::ERROR_STATUS_UNKNOWN_TRANSACTION;
}
switch (code) {
case ON_INPUT_READY: {
if (msgHandler == nullptr) {
break;
}
MessageParcel* parcel = new MessageParcel();
parcel->WriteInt32(data.ReadInt32());
if (data.ReadInt32() > 0) {
parcel->WriteRemoteObject(data.ReadRemoteObject());
}
if (data.ReadInt32() > 0) {
parcel->WriteParcelable(data.ReadParcelable<InputChannel>());
}
int32_t InputClientStub::onInputReleased(int32_t retValue)
{
return ErrorCode::NO_ERROR;
}
Message* msg = new Message(MessageID::MSG_ID_ON_INPUT_READY, parcel);
msgHandler->SendMessage(msg);
break;
}
case ON_INPUT_RELEASED: {
if (msgHandler == nullptr) {
break;
}
MessageParcel* parcel = new MessageParcel();
parcel->WriteInt32(data.ReadInt32());
Message* msg = new Message(MessageID::MSG_ID_EXIT_SERVICE, parcel);
msgHandler->SendMessage(msg);
break;
}
case SET_DISPLAY_MODE: {
if (msgHandler == nullptr) {
break;
}
MessageParcel* parcel = new MessageParcel();
parcel->WriteInt32(data.ReadInt32());
Message* msg = new Message(MessageID::MSG_ID_SET_DISPLAY_MODE, parcel);
msgHandler->SendMessage(msg);
break;
}
default:
return IPCObjectStub::OnRemoteRequest(code, data, reply, option);
}
return NO_ERROR;
}
int32_t InputClientStub::setDisplayMode(int32_t mode)
{
return ErrorCode::NO_ERROR;
}
int32_t InputClientStub::onInputReady(int32_t retValue, const sptr<IInputMethodAgent>& agent,
const InputChannel* channel) {
return ErrorCode::NO_ERROR;
}
void InputClientStub::SetHandler(MessageHandler* handler)
{
msgHandler = handler;
}
int32_t InputClientStub::onInputReleased(int32_t retValue)
{
return ErrorCode::NO_ERROR;
}
int32_t InputClientStub::setDisplayMode(int32_t mode)
{
return ErrorCode::NO_ERROR;
}
void InputClientStub::SetHandler(MessageHandler* handler)
{
msgHandler = handler;
}
}
}
@@ -19,55 +19,53 @@
namespace OHOS {
namespace MiscServices {
InputDataChannelProxy::InputDataChannelProxy(const sptr<IRemoteObject> &object) : IRemoteProxy<IInputDataChannel>(object)
{
}
bool InputDataChannelProxy::InsertText(const std::u16string& text)
{
IMSA_HILOGI("InputDataChannelProxy::InsertText");
MessageParcel data, reply;
MessageOption option;
data.WriteInterfaceToken(GetDescriptor());
data.WriteString16(text);
auto ret = Remote()->SendRequest(INSERT_TEXT, data, reply, option);
if (ret != NO_ERROR) {
return false;
InputDataChannelProxy::InputDataChannelProxy(const sptr<IRemoteObject> &object)
: IRemoteProxy<IInputDataChannel>(object) {
}
auto result = reply.ReadBool();
return result;
}
bool InputDataChannelProxy::DeleteBackward(int32_t length)
{
IMSA_HILOGI("InputDataChannelProxy::DeleteBackward");
MessageParcel data, reply;
MessageOption option;
data.WriteInterfaceToken(GetDescriptor());
data.WriteInt32(length);
bool InputDataChannelProxy::InsertText(const std::u16string& text)
{
IMSA_HILOGI("InputDataChannelProxy::InsertText");
MessageParcel data, reply;
MessageOption option;
data.WriteInterfaceToken(GetDescriptor());
data.WriteString16(text);
auto ret = Remote()->SendRequest(DELETE_BACKWARD, data, reply, option);
if (ret != NO_ERROR) {
return false;
auto ret = Remote()->SendRequest(INSERT_TEXT, data, reply, option);
if (ret != NO_ERROR) {
return false;
}
auto result = reply.ReadBool();
return result;
}
auto result = reply.ReadBool();
return result;
}
void InputDataChannelProxy::Close()
{
IMSA_HILOGI("InputDataChannelProxy::Close");
MessageParcel data, reply;
MessageOption option;
data.WriteInterfaceToken(GetDescriptor());
bool InputDataChannelProxy::DeleteBackward(int32_t length)
{
IMSA_HILOGI("InputDataChannelProxy::DeleteBackward");
MessageParcel data, reply;
MessageOption option;
data.WriteInterfaceToken(GetDescriptor());
data.WriteInt32(length);
auto ret = Remote()->SendRequest(CLOSE, data, reply, option);
if (ret != NO_ERROR) {
auto ret = Remote()->SendRequest(DELETE_BACKWARD, data, reply, option);
if (ret != NO_ERROR) {
return false;
}
auto result = reply.ReadBool();
return result;
}
void InputDataChannelProxy::Close()
{
IMSA_HILOGI("InputDataChannelProxy::Close");
MessageParcel data, reply;
MessageOption option;
data.WriteInterfaceToken(GetDescriptor());
auto ret = Remote()->SendRequest(CLOSE, data, reply, option);
if (ret != NO_ERROR) {
}
}
}
}
}
@@ -17,82 +17,82 @@
namespace OHOS {
namespace MiscServices {
InputDataChannelStub::InputDataChannelStub() : msgHandler(nullptr)
{
InputDataChannelStub::InputDataChannelStub() : msgHandler(nullptr)
{
}
InputDataChannelStub::~InputDataChannelStub()
{
if (msgHandler != nullptr) {
delete msgHandler;
}
}
int32_t InputDataChannelStub::OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply,
MessageOption &option)
{
IMSA_HILOGI("InputDataChannelStub::OnRemoteRequest code = %{public}d", code);
auto descriptorToken = data.ReadInterfaceToken();
if (descriptorToken != GetDescriptor()) {
return ErrorCode::ERROR_STATUS_UNKNOWN_TRANSACTION;
}
switch (code) {
case INSERT_TEXT: {
auto text = data.ReadString16();
InsertText(text);
break;
InputDataChannelStub::~InputDataChannelStub()
{
if (msgHandler != nullptr) {
delete msgHandler;
}
case DELETE_BACKWARD: {
auto length = data.ReadInt32();
DeleteBackward(length);
break;
}
int32_t InputDataChannelStub::OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply,
MessageOption &option)
{
IMSA_HILOGI("InputDataChannelStub::OnRemoteRequest code = %{public}d", code);
auto descriptorToken = data.ReadInterfaceToken();
if (descriptorToken != GetDescriptor()) {
return ErrorCode::ERROR_STATUS_UNKNOWN_TRANSACTION;
}
case CLOSE: {
Close();
break;
switch (code) {
case INSERT_TEXT: {
auto text = data.ReadString16();
InsertText(text);
break;
}
case DELETE_BACKWARD: {
auto length = data.ReadInt32();
DeleteBackward(length);
break;
}
case CLOSE: {
Close();
break;
}
default:
return IPCObjectStub::OnRemoteRequest(code, data, reply, option);
}
default:
return IPCObjectStub::OnRemoteRequest(code, data, reply, option);
return NO_ERROR;
}
return NO_ERROR;
}
bool InputDataChannelStub::InsertText(const std::u16string& text)
{
IMSA_HILOGI("InputDataChannelStub::InsertText");
if (msgHandler != nullptr) {
MessageParcel* parcel = new MessageParcel;
parcel->WriteString16(text);
Message* msg = new Message(MessageID::MSG_ID_INSERT_CHAR, parcel);
msgHandler->SendMessage(msg);
IMSA_HILOGI("InputDataChannelStub::InsertText return true");
return true;
bool InputDataChannelStub::InsertText(const std::u16string& text)
{
IMSA_HILOGI("InputDataChannelStub::InsertText");
if (msgHandler != nullptr) {
MessageParcel* parcel = new MessageParcel;
parcel->WriteString16(text);
Message* msg = new Message(MessageID::MSG_ID_INSERT_CHAR, parcel);
msgHandler->SendMessage(msg);
IMSA_HILOGI("InputDataChannelStub::InsertText return true");
return true;
}
return false;
}
return false;
}
bool InputDataChannelStub::DeleteBackward(int32_t length)
{
IMSA_HILOGI("InputDataChannelStub::DeleteBackward");
if (msgHandler != nullptr) {
MessageParcel* parcel = new MessageParcel;
parcel->WriteInt32(length);
Message* msg = new Message(MessageID::MSG_ID_DELETE_BACKWARD, parcel);
msgHandler->SendMessage(msg);
return true;
bool InputDataChannelStub::DeleteBackward(int32_t length)
{
IMSA_HILOGI("InputDataChannelStub::DeleteBackward");
if (msgHandler != nullptr) {
MessageParcel* parcel = new MessageParcel;
parcel->WriteInt32(length);
Message* msg = new Message(MessageID::MSG_ID_DELETE_BACKWARD, parcel);
msgHandler->SendMessage(msg);
return true;
}
return false;
}
return false;
}
void InputDataChannelStub::Close()
{
void InputDataChannelStub::Close()
{
}
}
void InputDataChannelStub::SetHandler(MessageHandler* handler)
{
msgHandler = handler;
}
void InputDataChannelStub::SetHandler(MessageHandler* handler)
{
msgHandler = handler;
}
}
}
@@ -174,7 +174,8 @@ using namespace MessageID;
ReleaseInput(mClient);
}
void InputMethodController::PrepareInput(int32_t displayId,sptr<InputClientStub> &client,sptr<InputDataChannelStub> &channel,InputAttribute &attribute)
void InputMethodController::PrepareInput(int32_t displayId, sptr<InputClientStub> &client,
sptr<InputDataChannelStub> &channel, InputAttribute &attribute)
{
IMSA_HILOGI("InputMethodController::PrepareInput");
if(mImms == nullptr){
@@ -17,394 +17,395 @@
namespace OHOS {
namespace MiscServices {
using namespace ErrorCode;
InputMethodSystemAbilityProxy::InputMethodSystemAbilityProxy(const sptr<IRemoteObject> &object)
: IRemoteProxy<IInputMethodSystemAbility>(object)
{
}
void InputMethodSystemAbilityProxy::prepareInput(MessageParcel& data)
{
MessageParcel reply;
MessageOption option;
auto ret = Remote()->SendRequest(PREPARE_INPUT, data, reply, option);
if (ret != NO_ERROR) {
IMSA_HILOGI("InputMethodSystemAbilityProxy::prepareInput SendRequest failed");
return;
}
ret = reply.ReadInt32();
if (ret != NO_ERROR) {
IMSA_HILOGI("InputMethodSystemAbilityProxy::prepareInput reply failed");
return;
}
}
void InputMethodSystemAbilityProxy::releaseInput(MessageParcel& data)
{
MessageParcel reply;
MessageOption option;
auto ret = Remote()->SendRequest(RELEASE_INPUT, data, reply, option);
if (ret != NO_ERROR) {
IMSA_HILOGI("InputMethodSystemAbilityProxy::releaseInput SendRequest failed");
return;
}
ret = reply.ReadInt32();
if (ret != NO_ERROR) {
IMSA_HILOGI("InputMethodSystemAbilityProxy::releaseInput reply failed");
return;
}
}
void InputMethodSystemAbilityProxy::startInput(MessageParcel& data)
{
IMSA_HILOGI("InputMethodSystemAbilityProxy::startInput");
MessageParcel reply;
MessageOption option;
auto ret = Remote()->SendRequest(START_INPUT,data,reply,option);
if (ret != NO_ERROR) {
IMSA_HILOGI("InputMethodSystemAbilityProxy::startInput SendRequest failed");
return;
}
ret = reply.ReadInt32();
if (ret != NO_ERROR) {
IMSA_HILOGI("InputMethodSystemAbilityProxy::startInput reply failed");
return;
}
}
void InputMethodSystemAbilityProxy::stopInput(MessageParcel& data)
{
IMSA_HILOGI("InputMethodSystemAbilityProxy::stopInput");
MessageParcel reply;
MessageOption option;
auto ret = Remote()->SendRequest(STOP_INPUT,data,reply,option);
if (ret != NO_ERROR) {
IMSA_HILOGI("InputMethodSystemAbilityProxy::stopInput SendRequest failed");
return;
}
ret = reply.ReadInt32();
if (ret != NO_ERROR) {
IMSA_HILOGI("InputMethodSystemAbilityProxy::stopInput reply failed");
return;
}
}
int32_t InputMethodSystemAbilityProxy::setInputMethodCore(sptr<IInputMethodCore> &core)
using namespace ErrorCode;
InputMethodSystemAbilityProxy::InputMethodSystemAbilityProxy(const sptr<IRemoteObject> &object)
: IRemoteProxy<IInputMethodSystemAbility>(object)
{
IMSA_HILOGI("InputMethodSystemAbilityProxy::setInputMethodCore");
if (core == nullptr) {
IMSA_HILOGI("InputMethodSystemAbilityProxy::setInputMethodCore inputDataChannel is nullptr");
}
auto remote = Remote();
if (remote == nullptr)
return -1;
MessageParcel data;
if (!(data.WriteInterfaceToken(GetDescriptor())
&& data.WriteRemoteObject(core->AsObject())))
return -1;
}
void InputMethodSystemAbilityProxy::prepareInput(MessageParcel& data)
{
MessageParcel reply;
MessageOption option { MessageOption::TF_SYNC };
MessageOption option;
int32_t status = Remote()->SendRequest(SET_INPUT_METHOD_CORE, data, reply, option);
auto ret = Remote()->SendRequest(PREPARE_INPUT, data, reply, option);
if (ret != NO_ERROR) {
IMSA_HILOGI("InputMethodSystemAbilityProxy::prepareInput SendRequest failed");
return;
}
return status;
ret = reply.ReadInt32();
if (ret != NO_ERROR) {
IMSA_HILOGI("InputMethodSystemAbilityProxy::prepareInput reply failed");
return;
}
}
int32_t InputMethodSystemAbilityProxy::Prepare(int32_t displayId, sptr<InputClientStub> &client, sptr<InputDataChannelStub> &channel, InputAttribute &attribute)
{
MessageParcel data, reply;
MessageOption option;
if (!data.WriteInterfaceToken(GetDescriptor())) {
return ERROR_EX_PARCELABLE;
void InputMethodSystemAbilityProxy::releaseInput(MessageParcel& data)
{
MessageParcel reply;
MessageOption option;
auto ret = Remote()->SendRequest(RELEASE_INPUT, data, reply, option);
if (ret != NO_ERROR) {
IMSA_HILOGI("InputMethodSystemAbilityProxy::releaseInput SendRequest failed");
return;
}
ret = reply.ReadInt32();
if (ret != NO_ERROR) {
IMSA_HILOGI("InputMethodSystemAbilityProxy::releaseInput reply failed");
return;
}
}
if (!(data.WriteInt32(displayId)
&& data.WriteRemoteObject(client->AsObject())
&& data.WriteRemoteObject(channel->AsObject())
&& data.WriteParcelable(&attribute))) {
return ERROR_EX_PARCELABLE;
void InputMethodSystemAbilityProxy::startInput(MessageParcel& data)
{
IMSA_HILOGI("InputMethodSystemAbilityProxy::startInput");
MessageParcel reply;
MessageOption option;
auto ret = Remote()->SendRequest(START_INPUT,data,reply,option);
if (ret != NO_ERROR) {
IMSA_HILOGI("InputMethodSystemAbilityProxy::startInput SendRequest failed");
return;
}
ret = reply.ReadInt32();
if (ret != NO_ERROR) {
IMSA_HILOGI("InputMethodSystemAbilityProxy::startInput reply failed");
return;
}
}
void InputMethodSystemAbilityProxy::stopInput(MessageParcel& data)
{
IMSA_HILOGI("InputMethodSystemAbilityProxy::stopInput");
MessageParcel reply;
MessageOption option;
auto ret = Remote()->SendRequest(STOP_INPUT,data,reply,option);
if (ret != NO_ERROR) {
IMSA_HILOGI("InputMethodSystemAbilityProxy::stopInput SendRequest failed");
return;
}
ret = reply.ReadInt32();
if (ret != NO_ERROR) {
IMSA_HILOGI("InputMethodSystemAbilityProxy::stopInput reply failed");
return;
}
}
int32_t InputMethodSystemAbilityProxy::setInputMethodCore(sptr<IInputMethodCore> &core)
{
IMSA_HILOGI("InputMethodSystemAbilityProxy::setInputMethodCore");
if (core == nullptr) {
IMSA_HILOGI("InputMethodSystemAbilityProxy::setInputMethodCore inputDataChannel is nullptr");
}
auto remote = Remote();
if (remote == nullptr)
return -1;
MessageParcel data;
if (!(data.WriteInterfaceToken(GetDescriptor())
&& data.WriteRemoteObject(core->AsObject())))
return -1;
MessageParcel reply;
MessageOption option { MessageOption::TF_SYNC };
auto ret = Remote()->SendRequest(PREPARE_INPUT, data, reply, option);
if (ret != NO_ERROR) {
return ERROR_STATUS_FAILED_TRANSACTION;
int32_t status = Remote()->SendRequest(SET_INPUT_METHOD_CORE, data, reply, option);
return status;
}
int32_t InputMethodSystemAbilityProxy::Prepare(int32_t displayId, sptr<InputClientStub> &client,
sptr<InputDataChannelStub> &channel, InputAttribute &attribute)
{
MessageParcel data, reply;
MessageOption option;
if (!data.WriteInterfaceToken(GetDescriptor())) {
return ERROR_EX_PARCELABLE;
}
if (!(data.WriteInt32(displayId)
&& data.WriteRemoteObject(client->AsObject())
&& data.WriteRemoteObject(channel->AsObject())
&& data.WriteParcelable(&attribute))) {
return ERROR_EX_PARCELABLE;
}
auto ret = Remote()->SendRequest(PREPARE_INPUT, data, reply, option);
if (ret != NO_ERROR) {
return ERROR_STATUS_FAILED_TRANSACTION;
}
ret = reply.ReadInt32();
if (ret != NO_ERROR) {
return ret;
}
return NO_ERROR;
}
ret = reply.ReadInt32();
if (ret != NO_ERROR) {
return ret;
int32_t InputMethodSystemAbilityProxy::Release(sptr<InputClientStub> &client)
{
IMSA_HILOGI("InputMethodSystemAbilityProxy::Release");
MessageParcel data, reply;
MessageOption option;
if (!data.WriteInterfaceToken(GetDescriptor())) {
return ERROR_EX_PARCELABLE;
}
if (!data.WriteRemoteObject(client->AsObject().GetRefPtr())) {
return ERROR_EX_PARCELABLE;
}
auto ret = Remote()->SendRequest(RELEASE_INPUT, data, reply, option);
if (ret != NO_ERROR) {
return ERROR_STATUS_FAILED_TRANSACTION;
}
ret = reply.ReadInt32();
if (ret != NO_ERROR) {
return ret;
}
return NO_ERROR;
}
return NO_ERROR;
}
int32_t InputMethodSystemAbilityProxy::Start(sptr<InputClientStub> &client)
{
MessageParcel data, reply;
MessageOption option;
if (!data.WriteInterfaceToken(GetDescriptor())) {
return ERROR_EX_PARCELABLE;
}
int32_t InputMethodSystemAbilityProxy::Release(sptr<InputClientStub> &client)
{
IMSA_HILOGI("InputMethodSystemAbilityProxy::Release");
MessageParcel data, reply;
MessageOption option;
if (!data.WriteInterfaceToken(GetDescriptor())) {
return ERROR_EX_PARCELABLE;
if (!data.WriteRemoteObject(client->AsObject().GetRefPtr())) {
return ERROR_EX_PARCELABLE;
}
auto ret = Remote()->SendRequest(START_INPUT, data, reply, option);
if (ret != NO_ERROR) {
return ERROR_STATUS_FAILED_TRANSACTION;
}
ret = reply.ReadInt32();
if (ret != NO_ERROR) {
return ret;
}
return NO_ERROR;
}
if (!data.WriteRemoteObject(client->AsObject().GetRefPtr())) {
return ERROR_EX_PARCELABLE;
int32_t InputMethodSystemAbilityProxy::Stop(sptr<InputClientStub> &client)
{
MessageParcel data, reply;
MessageOption option;
if (!data.WriteInterfaceToken(GetDescriptor())) {
return ERROR_EX_PARCELABLE;
}
if (!data.WriteRemoteObject(client->AsObject().GetRefPtr())) {
return ERROR_EX_PARCELABLE;
}
auto ret = Remote()->SendRequest(STOP_INPUT, data, reply, option);
if (ret != NO_ERROR) {
return ERROR_STATUS_FAILED_TRANSACTION;
}
ret = reply.ReadInt32();
if (ret != NO_ERROR) {
return ret;
}
return NO_ERROR;
}
auto ret = Remote()->SendRequest(RELEASE_INPUT, data, reply, option);
if (ret != NO_ERROR) {
return ERROR_STATUS_FAILED_TRANSACTION;
int32_t InputMethodSystemAbilityProxy::getDisplayMode(int32_t *retMode)
{
MessageParcel data, reply;
MessageOption option;
if (!data.WriteInterfaceToken(GetDescriptor())) {
return ERROR_EX_PARCELABLE;
}
auto ret = Remote()->SendRequest(GET_DISPLAY_MODE, data, reply, option);
if (ret != NO_ERROR) {
return ERROR_STATUS_FAILED_TRANSACTION;
}
ret = reply.ReadInt32();
if (ret != NO_ERROR) {
return ret;
}
if (!reply.ReadInt32(*retMode)) {
return ERROR_STATUS_BAD_VALUE;
}
return NO_ERROR;
}
ret = reply.ReadInt32();
if (ret != NO_ERROR) {
return ret;
int32_t InputMethodSystemAbilityProxy::getKeyboardWindowHeight(int32_t *retHeight)
{
if (retHeight == nullptr) {
return ERROR_NULL_POINTER;
}
MessageParcel data, reply;
MessageOption option;
if (!data.WriteInterfaceToken(GetDescriptor())) {
return ERROR_EX_PARCELABLE;
}
auto ret = Remote()->SendRequest(GET_KEYBOARD_WINDOW_HEIGHT, data, reply, option);
if (ret != NO_ERROR) {
return ERROR_STATUS_FAILED_TRANSACTION;
}
ret = reply.ReadInt32();
if (ret != NO_ERROR) {
return ret;
}
if (!reply.ReadInt32(*retHeight)) {
return ERROR_STATUS_BAD_VALUE;
}
return NO_ERROR;
}
return NO_ERROR;
}
int32_t InputMethodSystemAbilityProxy::getCurrentKeyboardType(KeyboardType* retType)
{
if (retType == nullptr) {
return ERROR_NULL_POINTER;
}
int32_t InputMethodSystemAbilityProxy::Start(sptr<InputClientStub> &client)
{
MessageParcel data, reply;
MessageOption option;
if (!data.WriteInterfaceToken(GetDescriptor())) {
return ERROR_EX_PARCELABLE;
MessageParcel data, reply;
MessageOption option;
if (!data.WriteInterfaceToken(GetDescriptor())) {
return ERROR_EX_PARCELABLE;
}
auto ret = Remote()->SendRequest(GET_CURRENT_KEYBOARD_TYPE, data, reply, option);
if (ret != NO_ERROR) {
return ERROR_STATUS_FAILED_TRANSACTION;
}
ret = reply.ReadInt32();
if (ret != NO_ERROR) {
return ret;
}
KeyboardType* keyType = reply.ReadParcelable<KeyboardType>();
*retType = *keyType;
delete keyType;
return NO_ERROR;
}
if (!data.WriteRemoteObject(client->AsObject().GetRefPtr())) {
return ERROR_EX_PARCELABLE;
}
auto ret = Remote()->SendRequest(START_INPUT, data, reply, option);
if (ret != NO_ERROR) {
return ERROR_STATUS_FAILED_TRANSACTION;
int32_t InputMethodSystemAbilityProxy::listInputMethodEnabled(std::vector<InputMethodProperty*> *properties)
{
if (properties == nullptr) {
return ERROR_NULL_POINTER;
}
MessageParcel data, reply;
MessageOption option;
if (!data.WriteInterfaceToken(GetDescriptor())) {
return ERROR_EX_PARCELABLE;
}
auto ret = Remote()->SendRequest(LIST_INPUT_METHOD_ENABLED, data, reply, option);
if (ret != NO_ERROR) {
return ERROR_STATUS_FAILED_TRANSACTION;
}
ret = reply.ReadInt32();
if (ret != NO_ERROR) {
return ret;
}
auto size = reply.ReadInt32();
while (size > 0) {
InputMethodProperty* imp = reply.ReadParcelable<InputMethodProperty>();
properties->push_back(imp);
size--;
}
return NO_ERROR;
}
ret = reply.ReadInt32();
if (ret != NO_ERROR) {
return ret;
int32_t InputMethodSystemAbilityProxy::listInputMethod(std::vector<InputMethodProperty*> *properties)
{
if (properties == nullptr) {
return ERROR_NULL_POINTER;
}
MessageParcel data, reply;
MessageOption option;
if (!data.WriteInterfaceToken(GetDescriptor())) {
return ERROR_EX_PARCELABLE;
}
auto ret = Remote()->SendRequest(LIST_INPUT_METHOD, data, reply, option);
if (ret != NO_ERROR) {
return ERROR_STATUS_FAILED_TRANSACTION;
}
ret = reply.ReadInt32();
if (ret != NO_ERROR) {
return ret;
}
auto size = reply.ReadInt32();
while (size > 0) {
InputMethodProperty* imp = reply.ReadParcelable<InputMethodProperty>();
properties->push_back(imp);
size--;
}
return NO_ERROR;
}
return NO_ERROR;
}
int32_t InputMethodSystemAbilityProxy::listKeyboardType(const std::u16string& imeId,
std::vector<KeyboardType*> *types)
{
if (types == nullptr) {
return ERROR_NULL_POINTER;
}
int32_t InputMethodSystemAbilityProxy::Stop(sptr<InputClientStub> &client)
{
MessageParcel data, reply;
MessageOption option;
if (!data.WriteInterfaceToken(GetDescriptor())) {
return ERROR_EX_PARCELABLE;
MessageParcel data, reply;
MessageOption option;
if (!(data.WriteInterfaceToken(GetDescriptor()) && data.WriteString16(imeId))) {
return ERROR_EX_PARCELABLE;
}
auto ret = Remote()->SendRequest(LIST_KEYBOARD_TYPE, data, reply, option);
if (ret != NO_ERROR) {
return ERROR_STATUS_FAILED_TRANSACTION;
}
ret = reply.ReadInt32();
if (ret != NO_ERROR) {
return ret;
}
auto size = reply.ReadInt32();
while (size > 0) {
KeyboardType* kt = reply.ReadParcelable<KeyboardType>();
types->push_back(kt);
size--;
}
return NO_ERROR;
}
if (!data.WriteRemoteObject(client->AsObject().GetRefPtr())) {
return ERROR_EX_PARCELABLE;
}
auto ret = Remote()->SendRequest(STOP_INPUT, data, reply, option);
if (ret != NO_ERROR) {
return ERROR_STATUS_FAILED_TRANSACTION;
}
ret = reply.ReadInt32();
if (ret != NO_ERROR) {
return ret;
}
return NO_ERROR;
}
int32_t InputMethodSystemAbilityProxy::getDisplayMode(int32_t *retMode)
{
MessageParcel data, reply;
MessageOption option;
if (!data.WriteInterfaceToken(GetDescriptor())) {
return ERROR_EX_PARCELABLE;
}
auto ret = Remote()->SendRequest(GET_DISPLAY_MODE, data, reply, option);
if (ret != NO_ERROR) {
return ERROR_STATUS_FAILED_TRANSACTION;
}
ret = reply.ReadInt32();
if (ret != NO_ERROR) {
return ret;
}
if (!reply.ReadInt32(*retMode)) {
return ERROR_STATUS_BAD_VALUE;
}
return NO_ERROR;
}
int32_t InputMethodSystemAbilityProxy::getKeyboardWindowHeight(int32_t *retHeight)
{
if (retHeight == nullptr) {
return ERROR_NULL_POINTER;
}
MessageParcel data, reply;
MessageOption option;
if (!data.WriteInterfaceToken(GetDescriptor())) {
return ERROR_EX_PARCELABLE;
}
auto ret = Remote()->SendRequest(GET_KEYBOARD_WINDOW_HEIGHT, data, reply, option);
if (ret != NO_ERROR) {
return ERROR_STATUS_FAILED_TRANSACTION;
}
ret = reply.ReadInt32();
if (ret != NO_ERROR) {
return ret;
}
if (!reply.ReadInt32(*retHeight)) {
return ERROR_STATUS_BAD_VALUE;
}
return NO_ERROR;
}
int32_t InputMethodSystemAbilityProxy::getCurrentKeyboardType(KeyboardType* retType)
{
if (retType == nullptr) {
return ERROR_NULL_POINTER;
}
MessageParcel data, reply;
MessageOption option;
if (!data.WriteInterfaceToken(GetDescriptor())) {
return ERROR_EX_PARCELABLE;
}
auto ret = Remote()->SendRequest(GET_CURRENT_KEYBOARD_TYPE, data, reply, option);
if (ret != NO_ERROR) {
return ERROR_STATUS_FAILED_TRANSACTION;
}
ret = reply.ReadInt32();
if (ret != NO_ERROR) {
return ret;
}
KeyboardType* keyType = reply.ReadParcelable<KeyboardType>();
*retType = *keyType;
delete keyType;
return NO_ERROR;
}
int32_t InputMethodSystemAbilityProxy::listInputMethodEnabled(std::vector<InputMethodProperty*> *properties)
{
if (properties == nullptr) {
return ERROR_NULL_POINTER;
}
MessageParcel data, reply;
MessageOption option;
if (!data.WriteInterfaceToken(GetDescriptor())) {
return ERROR_EX_PARCELABLE;
}
auto ret = Remote()->SendRequest(LIST_INPUT_METHOD_ENABLED, data, reply, option);
if (ret != NO_ERROR) {
return ERROR_STATUS_FAILED_TRANSACTION;
}
ret = reply.ReadInt32();
if (ret != NO_ERROR) {
return ret;
}
auto size = reply.ReadInt32();
while (size > 0) {
InputMethodProperty* imp = reply.ReadParcelable<InputMethodProperty>();
properties->push_back(imp);
size--;
}
return NO_ERROR;
}
int32_t InputMethodSystemAbilityProxy::listInputMethod(std::vector<InputMethodProperty*> *properties)
{
if (properties == nullptr) {
return ERROR_NULL_POINTER;
}
MessageParcel data, reply;
MessageOption option;
if (!data.WriteInterfaceToken(GetDescriptor())) {
return ERROR_EX_PARCELABLE;
}
auto ret = Remote()->SendRequest(LIST_INPUT_METHOD, data, reply, option);
if (ret != NO_ERROR) {
return ERROR_STATUS_FAILED_TRANSACTION;
}
ret = reply.ReadInt32();
if (ret != NO_ERROR) {
return ret;
}
auto size = reply.ReadInt32();
while (size > 0) {
InputMethodProperty* imp = reply.ReadParcelable<InputMethodProperty>();
properties->push_back(imp);
size--;
}
return NO_ERROR;
}
int32_t InputMethodSystemAbilityProxy::listKeyboardType(const std::u16string& imeId, std::vector<KeyboardType*> *types)
{
if (types == nullptr) {
return ERROR_NULL_POINTER;
}
MessageParcel data, reply;
MessageOption option;
if (!(data.WriteInterfaceToken(GetDescriptor()) && data.WriteString16(imeId))) {
return ERROR_EX_PARCELABLE;
}
auto ret = Remote()->SendRequest(LIST_KEYBOARD_TYPE, data, reply, option);
if (ret != NO_ERROR) {
return ERROR_STATUS_FAILED_TRANSACTION;
}
ret = reply.ReadInt32();
if (ret != NO_ERROR) {
return ret;
}
auto size = reply.ReadInt32();
while (size > 0) {
KeyboardType* kt = reply.ReadParcelable<KeyboardType>();
types->push_back(kt);
size--;
}
return NO_ERROR;
}
}
}