!1434 无障碍手势稳定性问题

Merge pull request !1434 from fanzexuan/branch0925
This commit is contained in:
openharmony_ci 2024-09-25 06:27:57 +00:00 committed by Gitee
commit 7b48f82407
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 11 additions and 6 deletions

View File

@ -23,6 +23,7 @@
#include "accessibility_event_transmission.h"
#include "accessibility_mouse_key.h"
#include "event_handler.h"
#include "ffrt.h"
#include "i_input_event_consumer.h"
#include "input_manager.h"
#include "key_event.h"
@ -70,8 +71,8 @@ public:
static sptr<AccessibilityInputInterceptor> GetInstance();
~AccessibilityInputInterceptor();
void ProcessKeyEvent(std::shared_ptr<MMI::KeyEvent> event) const;
void ProcessPointerEvent(std::shared_ptr<MMI::PointerEvent> event) const;
void ProcessKeyEvent(std::shared_ptr<MMI::KeyEvent> event);
void ProcessPointerEvent(std::shared_ptr<MMI::PointerEvent> event);
bool OnKeyEvent(MMI::KeyEvent &event) override;
bool OnPointerEvent(MMI::PointerEvent &event) override;
void OnMoveMouse(int32_t offsetX, int32_t offsetY) override;
@ -97,6 +98,7 @@ private:
MMI::InputManager *inputManager_ = nullptr;
std::shared_ptr<AccessibilityInputEventConsumer> inputEventConsumer_ = nullptr;
std::shared_ptr<AppExecFwk::EventHandler> eventHandler_ = nullptr;
ffrt::mutex mutex_;
};
} // namespace Accessibility
} // namespace OHOS

View File

@ -267,6 +267,7 @@ void AccessibilityInputInterceptor::DestroyInterceptor()
void AccessibilityInputInterceptor::DestroyTransmitters()
{
std::lock_guard<ffrt::mutex> lock(mutex_);
HILOG_DEBUG();
if ((availableFunctions_ & FEATURE_MOUSE_KEY) != FEATURE_MOUSE_KEY) {
@ -288,8 +289,9 @@ void AccessibilityInputInterceptor::DestroyTransmitters()
}
}
void AccessibilityInputInterceptor::ProcessPointerEvent(std::shared_ptr<MMI::PointerEvent> event) const
void AccessibilityInputInterceptor::ProcessPointerEvent(std::shared_ptr<MMI::PointerEvent> event)
{
std::lock_guard<ffrt::mutex> lock(mutex_);
HILOG_DEBUG();
if (mouseKey_) {
@ -305,8 +307,9 @@ void AccessibilityInputInterceptor::ProcessPointerEvent(std::shared_ptr<MMI::Poi
pointerEventTransmitters_->OnPointerEvent(*event);
}
void AccessibilityInputInterceptor::ProcessKeyEvent(std::shared_ptr<MMI::KeyEvent> event) const
void AccessibilityInputInterceptor::ProcessKeyEvent(std::shared_ptr<MMI::KeyEvent> event)
{
std::lock_guard<ffrt::mutex> lock(mutex_);
HILOG_DEBUG();
if (mouseKey_) {

View File

@ -80,12 +80,12 @@ void AccessibilityInputInterceptor::DestroyInterceptor()
void AccessibilityInputInterceptor::DestroyTransmitters()
{}
void AccessibilityInputInterceptor::ProcessPointerEvent(std::shared_ptr<MMI::PointerEvent> event) const
void AccessibilityInputInterceptor::ProcessPointerEvent(std::shared_ptr<MMI::PointerEvent> event)
{
(void)event;
}
void AccessibilityInputInterceptor::ProcessKeyEvent(std::shared_ptr<MMI::KeyEvent> event) const
void AccessibilityInputInterceptor::ProcessKeyEvent(std::shared_ptr<MMI::KeyEvent> event)
{
(void)event;
}