Check for isAttachedToWindow before dispatching touch event

Otherwise we get an IllegalStateException

Fixes: 380318615
Test: repos in production
Flag: EXEMPT bugfix
Change-Id: Id72b76ab288f40ee50ba8485d4b0636c525e22e3
This commit is contained in:
Jon Miranda
2025-03-10 13:10:53 -07:00
parent bc872b2ae4
commit d6b9eff743
@@ -194,6 +194,7 @@ public class NearestTouchFrame extends FrameLayout {
event.offsetLocation(mTouchingChild.getWidth() / 2 - x,
mTouchingChild.getHeight() / 2 - y);
return mTouchingChild.getVisibility() == VISIBLE
&& mTouchingChild.isAttachedToWindow()
&& mTouchingChild.dispatchTouchEvent(event);
}
}