diff --git a/services/aams/include/accessibility_touch_exploration.h b/services/aams/include/accessibility_touch_exploration.h index 21cbf58b5..e14a3a83a 100644 --- a/services/aams/include/accessibility_touch_exploration.h +++ b/services/aams/include/accessibility_touch_exploration.h @@ -345,7 +345,7 @@ private: void SendTouchEventToAA(MMI::PointerEvent &event); void SendGestureEventToAA(GestureType gestureId, uint64_t displayId); void SendEventToMultimodal(MMI::PointerEvent event, ChangeAction action); - void SendScreenWakeUpEvent(MMI::PointerEvent &event); + void SendScreenWakeUpEvent(); void SendDragDownEventToMultimodal(MMI::PointerEvent event); void SendUpForDragDownEvent(); bool GetPointerItemWithFingerNum(uint32_t fingerNum, std::vector &curPoints, diff --git a/services/aams_ext/src/touch_exploration_multi_finger_gesture.cpp b/services/aams_ext/src/touch_exploration_multi_finger_gesture.cpp index 1f7ca54f5..467b148fa 100644 --- a/services/aams_ext/src/touch_exploration_multi_finger_gesture.cpp +++ b/services/aams_ext/src/touch_exploration_multi_finger_gesture.cpp @@ -388,7 +388,7 @@ void TouchExploration::HandleTwoFingersDownStateMove(MMI::PointerEvent &event) CancelPostEvent(TouchExplorationMsg::TWO_FINGER_LONG_PRESS_MSG); if (event.GetPointerIds().size() != static_cast(PointerCount::POINTER_COUNT_2)) { Clear(); - SendScreenWakeUpEvent(event); + SendScreenWakeUpEvent(); SetCurrentState(TouchExplorationState::INVALID); return; } @@ -685,7 +685,7 @@ void TouchExploration::HandleMultiFingersTapStateMove(MMI::PointerEvent &event, SetCurrentState(TouchExplorationState::INVALID); } - SendScreenWakeUpEvent(event); + SendScreenWakeUpEvent(); } void TouchExploration::HandleTwoFingersTapStateMove(MMI::PointerEvent &event) @@ -749,7 +749,7 @@ void TouchExploration::HandleMultiFingersContinueDownStateMove(MMI::PointerEvent SetCurrentState(TouchExplorationState::INVALID); } - SendScreenWakeUpEvent(event); + SendScreenWakeUpEvent(); } void TouchExploration::HandleTwoFingersContinueDownStateMove(MMI::PointerEvent &event) @@ -880,7 +880,7 @@ void TouchExploration::HandleThreeFingersDownStateMove(MMI::PointerEvent &event) CancelPostEvent(TouchExplorationMsg::THREE_FINGER_LONG_PRESS_MSG); if (event.GetPointerIds().size() != static_cast(PointerCount::POINTER_COUNT_3)) { Clear(); - SendScreenWakeUpEvent(event); + SendScreenWakeUpEvent(); SetCurrentState(TouchExplorationState::INVALID); return; } @@ -889,7 +889,7 @@ void TouchExploration::HandleThreeFingersDownStateMove(MMI::PointerEvent &event) SetCurrentState(TouchExplorationState::THREE_FINGERS_SWIPE); } - SendScreenWakeUpEvent(event); + SendScreenWakeUpEvent(); } void TouchExploration::HandleThreeFingersSwipeStateDown(MMI::PointerEvent &event) @@ -1044,7 +1044,7 @@ void TouchExploration::HandleThreeFingersSwipeStateMove(MMI::PointerEvent &event { receivedPointerEvents_.push_back(event); SaveMultiFingerSwipeGesturePointerInfo(event); - SendScreenWakeUpEvent(event); + SendScreenWakeUpEvent(); } void TouchExploration::HandleThreeFingersTapStateDown(MMI::PointerEvent &event) @@ -1109,7 +1109,7 @@ void TouchExploration::HandleFourFingersDownStateMove(MMI::PointerEvent &event) CancelPostEvent(TouchExplorationMsg::FOUR_FINGER_LONG_PRESS_MSG); if (event.GetPointerIds().size() != static_cast(PointerCount::POINTER_COUNT_4)) { Clear(); - SendScreenWakeUpEvent(event); + SendScreenWakeUpEvent(); SetCurrentState(TouchExplorationState::INVALID); return; } @@ -1118,7 +1118,7 @@ void TouchExploration::HandleFourFingersDownStateMove(MMI::PointerEvent &event) SetCurrentState(TouchExplorationState::FOUR_FINGERS_SWIPE); } - SendScreenWakeUpEvent(event); + SendScreenWakeUpEvent(); } void TouchExploration::HandleFourFingersSwipeStateDown(MMI::PointerEvent &event) @@ -1136,7 +1136,7 @@ void TouchExploration::HandleFourFingersSwipeStateMove(MMI::PointerEvent &event) { receivedPointerEvents_.push_back(event); SaveMultiFingerSwipeGesturePointerInfo(event); - SendScreenWakeUpEvent(event); + SendScreenWakeUpEvent(); } void TouchExploration::HandleFourFingersTapStateDown(MMI::PointerEvent &event) diff --git a/services/aams_ext/src/touch_exploration_single_finger_gesture.cpp b/services/aams_ext/src/touch_exploration_single_finger_gesture.cpp index a76c52b77..a437b5653 100644 --- a/services/aams_ext/src/touch_exploration_single_finger_gesture.cpp +++ b/services/aams_ext/src/touch_exploration_single_finger_gesture.cpp @@ -22,6 +22,9 @@ #include "parcel/accessibility_event_info_parcel.h" #include "accessibility_input_interceptor.h" #include "extend_service_manager.h" +#ifdef OHOS_BUILD_ENABLE_POWER_MANAGER +#include "accessibility_extend_power_manager.h" +#endif #ifdef OHOS_BUILD_ENABLE_DISPLAY_MANAGER #include "accessibility_display_manager.h" #endif @@ -317,18 +320,10 @@ void TouchExploration::SendEventToMultimodal(MMI::PointerEvent event, ChangeActi EventTransmission::OnPointerEvent(event); } -void TouchExploration::SendScreenWakeUpEvent(MMI::PointerEvent &event) +void TouchExploration::SendScreenWakeUpEvent() { HILOG_DEBUG(); - // Send move event to wake up the screen and prevent the screen from turning off. - MMI::PointerEvent::PointerItem pointerItem {}; - for (auto& pId : event.GetPointerIds()) { - event.GetPointerItem(pId, pointerItem); - pointerItem.SetPressed(false); - event.RemovePointerItem(pId); - event.AddPointerItem(pointerItem); - } - SendEventToMultimodal(event, ChangeAction::NO_CHANGE); + Singleton::GetInstance().RefreshActivity(); } void TouchExploration::HoverEventRunner() @@ -397,7 +392,7 @@ void TouchExploration::HandleInvalidState(MMI::PointerEvent &event) event.GetPointerItem(event.GetPointerId(), pointerItem); if (event.GetPointerAction() == MMI::PointerEvent::POINTER_ACTION_MOVE) { - SendScreenWakeUpEvent(event); + SendScreenWakeUpEvent(); } // the last finger is lifted @@ -483,7 +478,7 @@ void TouchExploration::HandleOneFingerDownStateMove(MMI::PointerEvent &event) handler_->SendEvent(static_cast(TouchExplorationMsg::SWIPE_COMPLETE_TIMEOUT_MSG), 0, static_cast(TimeoutDuration::SWIPE_COMPLETE_TIMEOUT)); SetCurrentState(TouchExplorationState::ONE_FINGER_SWIPE); - SendScreenWakeUpEvent(event); + SendScreenWakeUpEvent(); } } @@ -639,7 +634,7 @@ void TouchExploration::HandleOneFingerSwipeStateUp(MMI::PointerEvent &event) void TouchExploration::HandleOneFingerSwipeStateMove(MMI::PointerEvent &event) { AddOneFingerSwipeEvent(event); - SendScreenWakeUpEvent(event); + SendScreenWakeUpEvent(); } bool TouchExploration::RecordFocusedLocation(MMI::PointerEvent &event)