1 /*
2  * Copyright (C) 2024 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 namespace OHOS {
18 namespace MMI {
19 std::shared_ptr<InputDeviceManager> InputDeviceManager::instance_ = nullptr;
20 std::mutex InputDeviceManager::mutex_;
21 
GetInstance()22 std::shared_ptr<InputDeviceManager> InputDeviceManager::GetInstance()
23 {
24     if (instance_ == nullptr) {
25         std::lock_guard<std::mutex> lock(mutex_);
26         if (instance_ == nullptr) {
27             instance_ = std::make_shared<InputDeviceManager>();
28         }
29     }
30     return instance_;
31 }
32 
Attach(std::shared_ptr<IDeviceObserver> observer)33 void InputDeviceManager::Attach(std::shared_ptr<IDeviceObserver> observer)
34 {}
35 
Detach(std::shared_ptr<IDeviceObserver> observer)36 void InputDeviceManager::Detach(std::shared_ptr<IDeviceObserver> observer)
37 {}
38 
NotifyPointerDevice(bool hasPointerDevice, bool isVisible, bool isHotPlug)39 void InputDeviceManager::NotifyPointerDevice(bool hasPointerDevice, bool isVisible, bool isHotPlug)
40 {}
41 
GetInputDevice(int32_t deviceId, bool checked) const42 std::shared_ptr<InputDevice> InputDeviceManager::GetInputDevice(int32_t deviceId, bool checked) const
43 {
44     if (DfsMessageParcel::messageParcel == nullptr) {
45         return nullptr;
46     }
47     return DfsMessageParcel::messageParcel->GetInputDevice(deviceId, checked);
48 }
49 
StartBytrace(std::shared_ptr<KeyEvent> key, HandlerType handlerType)50 void BytraceAdapter::StartBytrace(std::shared_ptr<KeyEvent> key, HandlerType handlerType)
51 {}
52 
StartBytrace(std::shared_ptr<PointerEvent> pointerEvent, TraceBtn traceBtn)53 void BytraceAdapter::StartBytrace(std::shared_ptr<PointerEvent> pointerEvent, TraceBtn traceBtn)
54 {}
55 } // namespace MMI
56 } // namespace OHOS