fix(gestures): Use peekDecorView to not force view hierarchy construction by romtsn · Pull Request #5134 · getsentry/sentry-java

SentryGestureListener was calling window.getDecorView() which forces the creation of the entire view hierarchy if it hasn't been created yet. This can cause ANRs on the main thread, as seen in production with ~21k occurrences affecting ~195 users.

The ANR originates from SentryGestureListener.onScrollgetDecorView() triggering expensive view hierarchy construction during touch event processing.

Switches to window.peekDecorView() which returns null if the decor view hasn't been created yet, instead of forcing its creation. The existing null-check already handles this case gracefully by logging and returning early.

Fixes https://sentry.sentry.io/issues/6138840301/