static const unsigned int WAIT_FOR_IDLE_MILLI_SEC = 1000; // 1sec
int AtspiAccessibleWatcher::mRenderCount = 10;
bool AtspiAccessibleWatcher::isWindowEventEmitted = false;
+bool AtspiAccessibleWatcher::mWaitingForEvent = false;
static bool iShowingNode(AtspiAccessible *node)
{
{
mMutex.lock();
auto a11yEvent = std::make_shared<A11yEventInfo>(std::string(type), std::string(name), std::string(pkg));
- mEventQueue.push_back(a11yEvent);
+ if (mWaitingForEvent) mEventQueue.push_back(a11yEvent);
mMutex.unlock();
if (this->mHandlers.count(a11yEvent->getEvent())) {
{
mMutex.lock();
mEventQueue.clear();
+ mWaitingForEvent = true;
mMutex.unlock();
// Call atspi method for start to listen atspi event.
if (COMPARE(type, event->getEvent()) && (packageName.empty() || packageName == event->getPkg()))
{
LOGI("type %d == %d name %s pkg %s",static_cast<int>(type), static_cast<int>(event->getEvent()), event->getName().c_str(), event->getPkg().c_str());
+ mMutex.lock();
+ mWaitingForEvent = false;
+ mEventQueue.clear();
+ mMutex.unlock();
return true;
}
}
std::chrono::milliseconds{100});
}
+ mMutex.lock();
+ mWaitingForEvent = false;
+ mEventQueue.clear();
+ mMutex.unlock();
+
if (isIdle != IdleEventState::IDLE_LISTEN_READY)
{
LOGI("RenderPost listen finish");