Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected NPE in tracked msg #71

Closed
pyricau opened this issue Oct 25, 2024 · 0 comments
Closed

Unexpected NPE in tracked msg #71

pyricau opened this issue Oct 25, 2024 · 0 comments

Comments

@pyricau
Copy link
Member

pyricau commented Oct 25, 2024

Crash:

Caused by: java.lang.NullPointerException
        at papa.Choreographers$isInChoreographerFrameMessage$2.invoke(Choreographers.kt:13)
        at papa.Choreographers$isInChoreographerFrameMessage$2.invoke(Choreographers.kt:12)
        at papa.MainThreadMessageScopedLazy.getValue(MainThreadMessageScopedLazy.kt:17)
        at papa.Choreographers.isInChoreographerFrameMessage(Choreographers.kt:12)
        at papa.Choreographers.isInChoreographerFrame(Choreographers.kt:31)
        at papa.Choreographers.postOnFrameRendered(Choreographers.kt:51)
        at papa.InteractionEngine$RealRunningInteraction.finish(InteractionRuleClient.kt:167)
        at papa.OnEventScope$DefaultImpls.recordSingleFrameInteraction(InteractionRuleClient.kt:279)

This is happening because not all main thread code actually runs from dequeuing a message. For instance, touch event handling is done independant of any main thread message dispatching, i.e. in between two messages:

        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4147)
        at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4307)
        at android.view.ViewRootImpl$ImeInputStage.onFinishedInputEvent(ViewRootImpl.java:4468)
        at android.view.inputmethod.InputMethodManager$PendingEvent.run(InputMethodManager.java:2435)
        at android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback(InputMethodManager.java:1998)
        at android.view.inputmethod.InputMethodManager.finishedInputEvent(InputMethodManager.java:1989)
        at android.view.inputmethod.InputMethodManager$ImeInputEventSender.onInputEventFinished(InputMethodManager.java:2412)
        at android.view.InputEventSender.dispatchInputEventFinished(InputEventSender.java:141)
        at android.os.MessageQueue.nativePollOnce(Native Method)
        at android.os.MessageQueue.next(MessageQueue.java:325)
        at android.os.Looper.loop(Looper.java:142)
pyricau added a commit that referenced this issue Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant