@@ -4235,13 +4235,8 @@ void InputDispatcher::synthesizePointerDownEventsForConnectionLocked(
42354235 << " channel '" << connection->getInputChannelName () << " ' ~ Synthesized "
42364236 << downEvents.size () << " down events to ensure consistent event stream." ;
42374237
4238- auto touchedWindowHandleAndDisplay =
4239- mTouchStates .findTouchedWindowHandleAndDisplay (connection->getToken ());
4240- if (!touchedWindowHandleAndDisplay.has_value ()) {
4241- LOG (FATAL) << __func__ << " : Touch state is out of sync: No touched window for token" ;
4242- }
4243-
4244- const auto [windowHandle, displayId] = touchedWindowHandleAndDisplay.value ();
4238+ const auto [windowHandle, displayId] =
4239+ mTouchStates .findExistingTouchedWindowHandleAndDisplay (connection->getToken ());
42454240
42464241 const bool wasEmpty = connection->outboundQueue .empty ();
42474242 for (std::unique_ptr<EventEntry>& downEventEntry : downEvents) {
@@ -7397,8 +7392,8 @@ bool InputDispatcher::DispatcherTouchState::isPointerInWindow(const sp<android::
73977392 return false ;
73987393}
73997394
7400- std::optional<std:: tuple<const sp<gui::WindowInfoHandle>&, ui::LogicalDisplayId> >
7401- InputDispatcher::DispatcherTouchState::findTouchedWindowHandleAndDisplay (
7395+ std::tuple<const sp<gui::WindowInfoHandle>&, ui::LogicalDisplayId>
7396+ InputDispatcher::DispatcherTouchState::findExistingTouchedWindowHandleAndDisplay (
74027397 const sp<android::IBinder>& token) const {
74037398 for (const auto & [displayId, state] : mTouchStatesByDisplay ) {
74047399 for (const TouchedWindow& w : state.windows ) {
@@ -7407,7 +7402,7 @@ InputDispatcher::DispatcherTouchState::findTouchedWindowHandleAndDisplay(
74077402 }
74087403 }
74097404 }
7410- return std:: nullopt ;
7405+ LOG_ALWAYS_FATAL ( " %s : Touch state is out of sync: No touched window for token " , __func__) ;
74117406}
74127407
74137408void InputDispatcher::DispatcherTouchState::forAllTouchedWindows (
0 commit comments