1 /* 2 * Copyright (C) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #include "parcel.h" 17 #include "iremote_broker.h" 18 #include "message_parcel.h" 19 #include "message_handler.h" 20 21 #include "global.h" 22 #include "iremote_proxy.h" 23 #include "i_input_control_channel.h" 24 #include "i_input_method_agent.h" 25 #include "input_control_channel_proxy.h" 26 27 /*! \class InputControlChannelProxy 28 \brief The proxy implementation of IInputControlChannel 29 30 This class should be implemented by input method service 31 */ 32 namespace OHOS { 33 namespace MiscServices { InputControlChannelProxy(const sptr<IRemoteObject> & impl)34 InputControlChannelProxy::InputControlChannelProxy(const sptr<IRemoteObject> &impl) 35 : IRemoteProxy<IInputControlChannel>(impl) 36 { 37 } 38 ~InputControlChannelProxy()39 InputControlChannelProxy::~InputControlChannelProxy() 40 { 41 } 42 HideKeyboardSelf(int flags)43 int32_t InputControlChannelProxy::HideKeyboardSelf(int flags) 44 { 45 IMSA_HILOGI("InputControlChannelProxy::HideKeyboardSelf"); 46 MessageParcel data; 47 MessageParcel reply; 48 MessageOption option; 49 data.WriteInterfaceToken(GetDescriptor()); 50 data.WriteInt32(flags); 51 Remote()->SendRequest(HIDE_KEYBOARD_SELF, data, reply, option); 52 auto result = reply.ReadInt32(); 53 return result; 54 } 55 } // namespace MiscServices 56 } // namespace OHOS 57