diff --git a/frameworks/native/input/oh_input_manager.cpp b/frameworks/native/input/oh_input_manager.cpp index 16dafb5592cfd116504c3e96ddf6783eb2bd3358..8ee0e356cb44b0d5a81cf1b9e4bf795cb0a96d0b 100644 --- a/frameworks/native/input/oh_input_manager.cpp +++ b/frameworks/native/input/oh_input_manager.cpp @@ -597,7 +597,7 @@ int32_t OH_Input_InjectMouseEventGlobal(const struct Input_MouseEvent* mouseEven true, PointerEvent::GLOBAL_COORDINATE); if ((result == INPUT_PERMISSION_DENIED) || (result == INPUT_OCCUPIED_BY_OTHER)) { MMI_HILOGE("Permission denied or occupied by other"); - return result; + return INPUT_PERMISSION_DENIED; } return INPUT_SUCCESS; } @@ -928,6 +928,10 @@ int32_t OH_Input_InjectTouchEventGlobal(const struct Input_TouchEvent* touchEven g_touchEvent->Reset(); } } + if ((result == INPUT_PERMISSION_DENIED) || (result == INPUT_OCCUPIED_BY_OTHER)) { + MMI_HILOGE("Permission denied or occupied by other"); + return INPUT_PERMISSION_DENIED; + } return INPUT_SUCCESS; }