• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-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 
16 #include "input_manager.h"
17 
18 #include "error_multimodal.h"
19 #include "input_manager_impl.h"
20 #include "define_multimodal.h"
21 #include "multimodal_event_handler.h"
22 
23 namespace OHOS {
24 namespace MMI {
25 namespace {
26 constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { LOG_CORE, MMI_LOG_DOMAIN, "InputManager" };
27 } // namespace
28 
29 InputManager *InputManager::instance_ = new (std::nothrow) InputManager();
GetInstance()30 InputManager *InputManager::GetInstance()
31 {
32     return instance_;
33 }
34 
GetDisplayBindInfo(DisplayBindInfos & infos)35 int32_t InputManager::GetDisplayBindInfo(DisplayBindInfos &infos)
36 {
37     return InputMgrImpl.GetDisplayBindInfo(infos);
38 }
39 
GetAllMmiSubscribedEvents(std::map<std::tuple<int32_t,int32_t,std::string>,int32_t> & datas)40 int32_t InputManager::GetAllMmiSubscribedEvents(std::map<std::tuple<int32_t, int32_t, std::string>, int32_t> &datas)
41 {
42     return InputMgrImpl.GetAllMmiSubscribedEvents(datas);
43 }
44 
SetDisplayBind(int32_t deviceId,int32_t displayId,std::string & msg)45 int32_t InputManager::SetDisplayBind(int32_t deviceId, int32_t displayId, std::string &msg)
46 {
47     return InputMgrImpl.SetDisplayBind(deviceId, displayId, msg);
48 }
49 
GetWindowPid(int32_t windowId)50 int32_t InputManager::GetWindowPid(int32_t windowId)
51 {
52     return InputMgrImpl.GetWindowPid(windowId);
53 }
54 
UpdateDisplayInfo(const DisplayGroupInfo & displayGroupInfo)55 void InputManager::UpdateDisplayInfo(const DisplayGroupInfo &displayGroupInfo)
56 {
57     InputMgrImpl.UpdateDisplayInfo(displayGroupInfo);
58 }
59 
UpdateWindowInfo(const WindowGroupInfo & windowGroupInfo)60 void InputManager::UpdateWindowInfo(const WindowGroupInfo &windowGroupInfo)
61 {
62     InputMgrImpl.UpdateWindowInfo(windowGroupInfo);
63 }
64 
AddInputEventFilter(std::shared_ptr<IInputEventFilter> filter,int32_t priority,uint32_t deviceTags)65 int32_t InputManager::AddInputEventFilter(std::shared_ptr<IInputEventFilter> filter, int32_t priority,
66     uint32_t deviceTags)
67 {
68     return InputMgrImpl.AddInputEventFilter(filter, priority, deviceTags);
69 }
70 
RemoveInputEventFilter(int32_t filterId)71 int32_t InputManager::RemoveInputEventFilter(int32_t filterId)
72 {
73     return InputMgrImpl.RemoveInputEventFilter(filterId);
74 }
75 
AddInputEventObserver(std::shared_ptr<MMIEventObserver> observer)76 int32_t InputManager::AddInputEventObserver(std::shared_ptr<MMIEventObserver> observer)
77 {
78     return InputMgrImpl.AddInputEventObserver(observer);
79 }
80 
RemoveInputEventObserver(std::shared_ptr<MMIEventObserver> observer)81 int32_t InputManager::RemoveInputEventObserver(std::shared_ptr<MMIEventObserver> observer)
82 {
83     return InputMgrImpl.RemoveInputEventObserver(observer);
84 }
85 
SetWindowInputEventConsumer(std::shared_ptr<IInputEventConsumer> inputEventConsumer)86 void InputManager::SetWindowInputEventConsumer(std::shared_ptr<IInputEventConsumer> inputEventConsumer)
87 {
88     InputMgrImpl.SetWindowInputEventConsumer(inputEventConsumer, nullptr);
89 }
90 
SetWindowInputEventConsumer(std::shared_ptr<IInputEventConsumer> inputEventConsumer,std::shared_ptr<AppExecFwk::EventHandler> eventHandler)91 void InputManager::SetWindowInputEventConsumer(std::shared_ptr<IInputEventConsumer> inputEventConsumer,
92     std::shared_ptr<AppExecFwk::EventHandler> eventHandler)
93 {
94     CHKPV(eventHandler);
95     InputMgrImpl.SetWindowInputEventConsumer(inputEventConsumer, eventHandler);
96 }
97 
SubscribeKeyEvent(std::shared_ptr<KeyOption> keyOption,std::function<void (std::shared_ptr<KeyEvent>)> callback)98 int32_t InputManager::SubscribeKeyEvent(std::shared_ptr<KeyOption> keyOption,
99     std::function<void(std::shared_ptr<KeyEvent>)> callback)
100 {
101     return InputMgrImpl.SubscribeKeyEvent(keyOption, callback);
102 }
103 
UnsubscribeKeyEvent(int32_t subscriberId)104 void InputManager::UnsubscribeKeyEvent(int32_t subscriberId)
105 {
106     InputMgrImpl.UnsubscribeKeyEvent(subscriberId);
107 }
108 
SubscribeSwitchEvent(std::function<void (std::shared_ptr<SwitchEvent>)> callback)109 int32_t InputManager::SubscribeSwitchEvent(std::function<void(std::shared_ptr<SwitchEvent>)> callback)
110 {
111     return InputMgrImpl.SubscribeSwitchEvent(callback);
112 }
113 
UnsubscribeSwitchEvent(int32_t subscriberId)114 void InputManager::UnsubscribeSwitchEvent(int32_t subscriberId)
115 {
116     InputMgrImpl.UnsubscribeSwitchEvent(subscriberId);
117 }
118 
AddMonitor(std::function<void (std::shared_ptr<KeyEvent>)> monitor)119 int32_t InputManager::AddMonitor(std::function<void(std::shared_ptr<KeyEvent>)> monitor)
120 {
121     return InputMgrImpl.AddMonitor(monitor);
122 }
123 
AddMonitor(std::function<void (std::shared_ptr<PointerEvent>)> monitor)124 int32_t InputManager::AddMonitor(std::function<void(std::shared_ptr<PointerEvent>)> monitor)
125 {
126     return InputMgrImpl.AddMonitor(monitor);
127 }
128 
AddMonitor(std::shared_ptr<IInputEventConsumer> monitor)129 int32_t InputManager::AddMonitor(std::shared_ptr<IInputEventConsumer> monitor)
130 {
131     return InputMgrImpl.AddMonitor(monitor);
132 }
133 
RemoveMonitor(int32_t monitorId)134 void InputManager::RemoveMonitor(int32_t monitorId)
135 {
136     InputMgrImpl.RemoveMonitor(monitorId);
137 }
138 
MarkConsumed(int32_t monitorId,int32_t eventId)139 void InputManager::MarkConsumed(int32_t monitorId, int32_t eventId)
140 {
141     InputMgrImpl.MarkConsumed(monitorId, eventId);
142 }
143 
MoveMouse(int32_t offsetX,int32_t offsetY)144 void InputManager::MoveMouse(int32_t offsetX, int32_t offsetY)
145 {
146     InputMgrImpl.MoveMouse(offsetX, offsetY);
147 }
148 
AddInterceptor(std::shared_ptr<IInputEventConsumer> interceptor)149 int32_t InputManager::AddInterceptor(std::shared_ptr<IInputEventConsumer> interceptor)
150 {
151     return InputMgrImpl.AddInterceptor(interceptor);
152 }
153 
AddInterceptor(std::function<void (std::shared_ptr<KeyEvent>)> interceptor)154 int32_t InputManager::AddInterceptor(std::function<void(std::shared_ptr<KeyEvent>)> interceptor)
155 {
156     return InputMgrImpl.AddInterceptor(interceptor);
157 }
158 
AddInterceptor(std::shared_ptr<IInputEventConsumer> interceptor,int32_t priority,uint32_t deviceTags)159 int32_t InputManager::AddInterceptor(std::shared_ptr<IInputEventConsumer> interceptor, int32_t priority,
160     uint32_t deviceTags)
161 {
162     return InputMgrImpl.AddInterceptor(interceptor, priority, deviceTags);
163 }
164 
RemoveInterceptor(int32_t interceptorId)165 void InputManager::RemoveInterceptor(int32_t interceptorId)
166 {
167     InputMgrImpl.RemoveInterceptor(interceptorId);
168 }
169 
SimulateInputEvent(std::shared_ptr<KeyEvent> keyEvent)170 void InputManager::SimulateInputEvent(std::shared_ptr<KeyEvent> keyEvent)
171 {
172     keyEvent->AddFlag(InputEvent::EVENT_FLAG_SIMULATE);
173     InputMgrImpl.SimulateInputEvent(keyEvent);
174 }
175 
SimulateInputEvent(std::shared_ptr<PointerEvent> pointerEvent)176 void InputManager::SimulateInputEvent(std::shared_ptr<PointerEvent> pointerEvent)
177 {
178     pointerEvent->AddFlag(InputEvent::EVENT_FLAG_SIMULATE);
179     InputMgrImpl.SimulateInputEvent(pointerEvent);
180 }
181 
SimulateInputEvent(std::shared_ptr<PointerEvent> pointerEvent,float zOrder)182 void InputManager::SimulateInputEvent(std::shared_ptr<PointerEvent> pointerEvent, float zOrder)
183 {
184     CHKPV(pointerEvent);
185     pointerEvent->AddFlag(InputEvent::EVENT_FLAG_SIMULATE);
186     pointerEvent->SetZOrder(zOrder);
187     InputMgrImpl.SimulateInputEvent(pointerEvent);
188 }
189 
RegisterDevListener(std::string type,std::shared_ptr<IInputDeviceListener> listener)190 int32_t InputManager::RegisterDevListener(std::string type, std::shared_ptr<IInputDeviceListener> listener)
191 {
192     return InputMgrImpl.RegisterDevListener(type, listener);
193 }
194 
UnregisterDevListener(std::string type,std::shared_ptr<IInputDeviceListener> listener)195 int32_t InputManager::UnregisterDevListener(std::string type, std::shared_ptr<IInputDeviceListener> listener)
196 {
197     return InputMgrImpl.UnregisterDevListener(type, listener);
198 }
199 
GetDeviceIds(std::function<void (std::vector<int32_t> &)> callback)200 int32_t InputManager::GetDeviceIds(std::function<void(std::vector<int32_t>&)> callback)
201 {
202     return InputMgrImpl.GetDeviceIds(callback);
203 }
204 
GetDevice(int32_t deviceId,std::function<void (std::shared_ptr<InputDevice>)> callback)205 int32_t InputManager::GetDevice(int32_t deviceId,
206     std::function<void(std::shared_ptr<InputDevice>)> callback)
207 {
208     return InputMgrImpl.GetDevice(deviceId, callback);
209 }
210 
SupportKeys(int32_t deviceId,std::vector<int32_t> keyCodes,std::function<void (std::vector<bool> &)> callback)211 int32_t InputManager::SupportKeys(int32_t deviceId, std::vector<int32_t> keyCodes,
212     std::function<void(std::vector<bool>&)> callback)
213 {
214     return InputMgrImpl.SupportKeys(deviceId, keyCodes, callback);
215 }
216 
SetMouseScrollRows(int32_t Rows)217 int32_t InputManager::SetMouseScrollRows(int32_t Rows)
218 {
219     return InputMgrImpl.SetMouseScrollRows(Rows);
220 }
221 
GetMouseScrollRows(int32_t & Rows)222 int32_t InputManager::GetMouseScrollRows(int32_t &Rows)
223 {
224     return InputMgrImpl.GetMouseScrollRows(Rows);
225 }
226 
SetCustomCursor(int32_t windowId,void * pixelMap,int32_t focusX,int32_t focusY)227 int32_t InputManager::SetCustomCursor(int32_t windowId, void* pixelMap, int32_t focusX, int32_t focusY)
228 {
229     return InputMgrImpl.SetCustomCursor(windowId, focusX, focusY, pixelMap);
230 }
231 
SetMouseIcon(int32_t windowId,void * pixelMap)232 int32_t InputManager::SetMouseIcon(int32_t windowId, void* pixelMap)
233 {
234     return InputMgrImpl.SetMouseIcon(windowId, pixelMap);
235 }
236 
SetPointerSize(int32_t size)237 int32_t InputManager::SetPointerSize(int32_t size)
238 {
239     return InputMgrImpl.SetPointerSize(size);
240 }
241 
GetPointerSize(int32_t & size)242 int32_t InputManager::GetPointerSize(int32_t &size)
243 {
244     return InputMgrImpl.GetPointerSize(size);
245 }
246 
SetMouseHotSpot(int32_t windowId,int32_t hotSpotX,int32_t hotSpotY)247 int32_t InputManager::SetMouseHotSpot(int32_t windowId, int32_t hotSpotX, int32_t hotSpotY)
248 {
249     return InputMgrImpl.SetMouseHotSpot(windowId, hotSpotX, hotSpotY);
250 }
251 
SetMousePrimaryButton(int32_t primaryButton)252 int32_t InputManager::SetMousePrimaryButton(int32_t primaryButton)
253 {
254     return InputMgrImpl.SetMousePrimaryButton(primaryButton);
255 }
256 
GetMousePrimaryButton(int32_t & primaryButton)257 int32_t InputManager::GetMousePrimaryButton(int32_t &primaryButton)
258 {
259     return InputMgrImpl.GetMousePrimaryButton(primaryButton);
260 }
261 
SetHoverScrollState(bool state)262 int32_t InputManager::SetHoverScrollState(bool state)
263 {
264     return InputMgrImpl.SetHoverScrollState(state);
265 }
266 
GetHoverScrollState(bool & state)267 int32_t InputManager::GetHoverScrollState(bool &state)
268 {
269     return InputMgrImpl.GetHoverScrollState(state);
270 }
271 
SetPointerVisible(bool visible)272 int32_t InputManager::SetPointerVisible(bool visible)
273 {
274     return InputMgrImpl.SetPointerVisible(visible);
275 }
276 
IsPointerVisible()277 bool InputManager::IsPointerVisible()
278 {
279     return InputMgrImpl.IsPointerVisible();
280 }
281 
SetPointerColor(int32_t color)282 int32_t InputManager::SetPointerColor(int32_t color)
283 {
284     return InputMgrImpl.SetPointerColor(color);
285 }
286 
GetPointerColor(int32_t & color)287 int32_t InputManager::GetPointerColor(int32_t &color)
288 {
289     return InputMgrImpl.GetPointerColor(color);
290 }
291 
EnableCombineKey(bool enable)292 int32_t InputManager::EnableCombineKey(bool enable)
293 {
294     return InputMgrImpl.EnableCombineKey(enable);
295 }
296 
SetPointerSpeed(int32_t speed)297 int32_t InputManager::SetPointerSpeed(int32_t speed)
298 {
299     return InputMgrImpl.SetPointerSpeed(speed);
300 }
301 
GetPointerSpeed(int32_t & speed)302 int32_t InputManager::GetPointerSpeed(int32_t &speed)
303 {
304     return InputMgrImpl.GetPointerSpeed(speed);
305 }
306 
GetKeyboardType(int32_t deviceId,std::function<void (int32_t)> callback)307 int32_t InputManager::GetKeyboardType(int32_t deviceId, std::function<void(int32_t)> callback)
308 {
309     return InputMgrImpl.GetKeyboardType(deviceId, callback);
310 }
311 
SetAnrObserver(std::shared_ptr<IAnrObserver> observer)312 void InputManager::SetAnrObserver(std::shared_ptr<IAnrObserver> observer)
313 {
314     InputMgrImpl.SetAnrObserver(observer);
315 }
316 
SetPointerStyle(int32_t windowId,PointerStyle pointerStyle)317 int32_t InputManager::SetPointerStyle(int32_t windowId, PointerStyle pointerStyle)
318 {
319     return InputMgrImpl.SetPointerStyle(windowId, pointerStyle);
320 }
321 
GetPointerStyle(int32_t windowId,PointerStyle & pointerStyle)322 int32_t InputManager::GetPointerStyle(int32_t windowId, PointerStyle &pointerStyle)
323 {
324     return InputMgrImpl.GetPointerStyle(windowId, pointerStyle);
325 }
326 
GetFunctionKeyState(int32_t funcKey)327 bool InputManager::GetFunctionKeyState(int32_t funcKey)
328 {
329     return InputMgrImpl.GetFunctionKeyState(funcKey);
330 }
331 
SetFunctionKeyState(int32_t funcKey,bool enable)332 int32_t InputManager::SetFunctionKeyState(int32_t funcKey, bool enable)
333 {
334     return InputMgrImpl.SetFunctionKeyState(funcKey, enable);
335 }
336 
SetPointerLocation(int32_t x,int32_t y)337 int32_t InputManager::SetPointerLocation(int32_t x, int32_t y)
338 {
339     return InputMgrImpl.SetPointerLocation(x, y);
340 }
341 
EnterCaptureMode(int32_t windowId)342 int32_t InputManager::EnterCaptureMode(int32_t windowId)
343 {
344     return InputMgrImpl.EnterCaptureMode(windowId);
345 }
346 
LeaveCaptureMode(int32_t windowId)347 int32_t InputManager::LeaveCaptureMode(int32_t windowId)
348 {
349     return InputMgrImpl.LeaveCaptureMode(windowId);
350 }
351 
AppendExtraData(const ExtraData & extraData)352 void InputManager::AppendExtraData(const ExtraData& extraData)
353 {
354     InputMgrImpl.AppendExtraData(extraData);
355 }
356 
EnableInputDevice(bool enable)357 int32_t InputManager::EnableInputDevice(bool enable)
358 {
359     return InputMgrImpl.EnableInputDevice(enable);
360 }
361 
SetKeyDownDuration(const std::string & businessId,int32_t delay)362 int32_t InputManager::SetKeyDownDuration(const std::string& businessId, int32_t delay)
363 {
364     return InputMgrImpl.SetKeyDownDuration(businessId, delay);
365 }
366 
SetKeyboardRepeatDelay(int32_t delay)367 int32_t InputManager::SetKeyboardRepeatDelay(int32_t delay)
368 {
369     return InputMgrImpl.SetKeyboardRepeatDelay(delay);
370 }
371 
SetKeyboardRepeatRate(int32_t rate)372 int32_t InputManager::SetKeyboardRepeatRate(int32_t rate)
373 {
374     return InputMgrImpl.SetKeyboardRepeatRate(rate);
375 }
376 
GetKeyboardRepeatDelay(std::function<void (int32_t)> callback)377 int32_t InputManager::GetKeyboardRepeatDelay(std::function<void(int32_t)> callback)
378 {
379     return InputMgrImpl.GetKeyboardRepeatDelay(callback);
380 }
381 
GetKeyboardRepeatRate(std::function<void (int32_t)> callback)382 int32_t InputManager::GetKeyboardRepeatRate(std::function<void(int32_t)> callback)
383 {
384     return InputMgrImpl.GetKeyboardRepeatRate(callback);
385 }
386 
387 #ifdef OHOS_BUILD_ENABLE_SECURITY_COMPONENT
SetEnhanceConfig(uint8_t * cfg,uint32_t cfgLen)388 void InputManager::SetEnhanceConfig(uint8_t *cfg, uint32_t cfgLen)
389 {
390     InputMgrImpl.SetEnhanceConfig(cfg, cfgLen);
391 }
392 #endif // OHOS_BUILD_ENABLE_SECURITY_COMPONENT
393 
SetTouchpadScrollSwitch(bool switchFlag)394 int32_t InputManager::SetTouchpadScrollSwitch(bool switchFlag)
395 {
396     return InputMgrImpl.SetTouchpadScrollSwitch(switchFlag);
397 }
398 
GetTouchpadScrollSwitch(bool & switchFlag)399 int32_t InputManager::GetTouchpadScrollSwitch(bool &switchFlag)
400 {
401     return InputMgrImpl.GetTouchpadScrollSwitch(switchFlag);
402 }
SetTouchpadScrollDirection(bool state)403 int32_t InputManager::SetTouchpadScrollDirection(bool state)
404 {
405     return InputMgrImpl.SetTouchpadScrollDirection(state);
406 }
407 
GetTouchpadScrollDirection(bool & state)408 int32_t InputManager::GetTouchpadScrollDirection(bool &state)
409 {
410     return InputMgrImpl.GetTouchpadScrollDirection(state);
411 }
SetTouchpadTapSwitch(bool switchFlag)412 int32_t InputManager::SetTouchpadTapSwitch(bool switchFlag)
413 {
414     return InputMgrImpl.SetTouchpadTapSwitch(switchFlag);
415 }
416 
GetTouchpadTapSwitch(bool & switchFlag)417 int32_t InputManager::GetTouchpadTapSwitch(bool &switchFlag)
418 {
419     return InputMgrImpl.GetTouchpadTapSwitch(switchFlag);
420 }
421 
SetTouchpadPointerSpeed(int32_t speed)422 int32_t InputManager::SetTouchpadPointerSpeed(int32_t speed)
423 {
424     return InputMgrImpl.SetTouchpadPointerSpeed(speed);
425 }
426 
GetTouchpadPointerSpeed(int32_t & speed)427 int32_t InputManager::GetTouchpadPointerSpeed(int32_t &speed)
428 {
429     return InputMgrImpl.GetTouchpadPointerSpeed(speed);
430 }
431 
SetTouchpadPinchSwitch(bool switchFlag)432 int32_t InputManager::SetTouchpadPinchSwitch(bool switchFlag)
433 {
434     return InputMgrImpl.SetTouchpadPinchSwitch(switchFlag);
435 }
436 
GetTouchpadPinchSwitch(bool & switchFlag)437 int32_t InputManager::GetTouchpadPinchSwitch(bool &switchFlag)
438 {
439     return InputMgrImpl.GetTouchpadPinchSwitch(switchFlag);
440 }
441 
SetTouchpadSwipeSwitch(bool switchFlag)442 int32_t InputManager::SetTouchpadSwipeSwitch(bool switchFlag)
443 {
444     return InputMgrImpl.SetTouchpadSwipeSwitch(switchFlag);
445 }
446 
GetTouchpadSwipeSwitch(bool & switchFlag)447 int32_t InputManager::GetTouchpadSwipeSwitch(bool &switchFlag)
448 {
449     return InputMgrImpl.GetTouchpadSwipeSwitch(switchFlag);
450 }
451 
SetTouchpadRightClickType(int32_t type)452 int32_t InputManager::SetTouchpadRightClickType(int32_t type)
453 {
454     return InputMgrImpl.SetTouchpadRightClickType(type);
455 }
456 
GetTouchpadRightClickType(int32_t & type)457 int32_t InputManager::GetTouchpadRightClickType(int32_t &type)
458 {
459     return InputMgrImpl.GetTouchpadRightClickType(type);
460 }
SetWindowPointerStyle(WindowArea area,int32_t pid,int32_t windowId)461 void InputManager::SetWindowPointerStyle(WindowArea area, int32_t pid, int32_t windowId)
462 {
463     InputMgrImpl.SetWindowPointerStyle(area, pid, windowId);
464 }
ClearWindowPointerStyle(int32_t pid,int32_t windowId)465 void InputManager::ClearWindowPointerStyle(int32_t pid, int32_t windowId)
466 {
467     InputMgrImpl.ClearWindowPointerStyle(pid, windowId);
468 }
SetWindowCheckerHandler(std::shared_ptr<IWindowChecker> windowChecker)469 void InputManager::SetWindowCheckerHandler(std::shared_ptr<IWindowChecker> windowChecker)
470 {
471     CHKPV(windowChecker);
472     InputMgrImpl.SetWindowCheckerHandler(windowChecker);
473 }
474 
SetNapStatus(int32_t pid,int32_t uid,std::string bundleName,int32_t napStatus)475 void InputManager::SetNapStatus(int32_t pid, int32_t uid, std::string bundleName, int32_t napStatus)
476 {
477     InputMgrImpl.SetNapStatus(pid, uid, bundleName, napStatus);
478 }
479 
SetShieldStatus(int32_t shieldMode,bool isShield)480 int32_t InputManager::SetShieldStatus(int32_t shieldMode, bool isShield)
481 {
482     return InputMgrImpl.SetShieldStatus(shieldMode, isShield);
483 }
484 
GetShieldStatus(int32_t shieldMode,bool & isShield)485 int32_t InputManager::GetShieldStatus(int32_t shieldMode, bool &isShield)
486 {
487     return InputMgrImpl.GetShieldStatus(shieldMode, isShield);
488 }
489 
AddServiceWatcher(std::shared_ptr<IInputServiceWatcher> watcher)490 void InputManager::AddServiceWatcher(std::shared_ptr<IInputServiceWatcher> watcher)
491 {
492     InputMgrImpl.AddServiceWatcher(watcher);
493 }
494 
RemoveServiceWatcher(std::shared_ptr<IInputServiceWatcher> watcher)495 void InputManager::RemoveServiceWatcher(std::shared_ptr<IInputServiceWatcher> watcher)
496 {
497     InputMgrImpl.RemoveServiceWatcher(watcher);
498 }
499 } // namespace MMI
500 } // namespace OHOS
501