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

recording: fix observation on multiple threads in layout/draw is not supported for compose #204

Merged
merged 4 commits into from
Nov 11, 2024

Conversation

marandaneto
Copy link
Member

💡 Motivation and Context

Tries to close #203

💚 How did you test it?

Running the sample with compose screen

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • I updated the docs if needed.
  • No breaking change or entry added to the changelog.

return
}
val semanticsNodes = semanticsOwner.getAllSemanticsNodes(true)
val latch = CountDownLatch(1)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

given that this method is only executed when view.isComposeView(), its fine to do thread jumping since its a requirement for compose anyway.

Comment on lines +659 to +660
// await for 1s max
latch.await(1000, TimeUnit.MILLISECONDS)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just an arbitrary value since it is a background thread, awaiting time wont block the screen, the time-sensitive is the part within the main thread block

Copy link

@ioannisj ioannisj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@marandaneto marandaneto merged commit 2d99605 into main Nov 11, 2024
6 checks passed
@marandaneto marandaneto deleted the fix/thread-compose branch November 11, 2024 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants