1 /* 2 * Copyright (C) 2025 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 #include "mock.h" 16 17 #include "stream_buffer.h" 18 #include "pointer_event.h" 19 #include "input_event_data_transformation.h" 20 #include "uds_session.h" 21 #include "uds_server.h" 22 23 namespace OHOS { 24 namespace MMI { 25 ChkRWError() const26bool StreamBuffer::ChkRWError() const 27 { 28 return MOCKHANDLER->mockChkRWErrorRet; 29 } 30 GetPointerItem(int32_t pointerId,PointerItem & pointerItem) const31bool PointerEvent::GetPointerItem(int32_t pointerId, PointerItem &pointerItem) const 32 { 33 return MOCKHANDLER->mockGetPointerItemRet; 34 } 35 Marshalling(std::shared_ptr<PointerEvent> event,NetPacket & pkt)36int32_t InputEventDataTransformation::Marshalling(std::shared_ptr<PointerEvent> event, NetPacket &pkt) 37 { 38 return MOCKHANDLER->mockMarshallingRet; 39 } 40 SendMsg(NetPacket & pkt)41bool UDSSession::SendMsg(NetPacket &pkt) 42 { 43 return MOCKHANDLER->mockSendMsgRet; 44 } 45 AddSessionDeletedCallback(std::function<void (SessionPtr)> callback)46void UDSServer::AddSessionDeletedCallback(std::function<void(SessionPtr)> callback) 47 { 48 callback(MOCKHANDLER->mockSessionPara); 49 } 50 } // namespace MMI 51 } // namespace OHOS 52