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

Updated the code to throw expeption when main thread is blocked. #1795

Merged

Conversation

aditya-07
Copy link
Collaborator

IMPORTANT: All PRs must be linked to an issue (except for extremely trivial and straightforward changes).

Fixes #1681

Description

  1. Updated all runBlocking calls to runBlockingOrThrowMainThreadException that throws BlockingMainThreadException when called from main thread.
  2. Marked all classes except for FhirOperator as internal as FhirOperator is supposed to be library's only public interface for developer applications.
  3. Added a note regarding the BlockingMainThreadException to the functions in FhirOperator.
  4. Updated tests to be called from worker thread using runBlockingOnWorkerThread and added some new tests as well.

Alternative(s) considered
Have you considered any alternatives? And if so, why have you chosen the approach in this PR?

Type
Choose one: Bug fix

Screenshots (if applicable)

Checklist

  • I have read and acknowledged the Code of conduct.
  • I have read the Contributing page.
  • I have signed the Google Individual CLA, or I am covered by my company's Corporate CLA.
  • I have discussed my proposed solution with code owners in the linked issue(s) and we have agreed upon the general approach.
  • I have run ./gradlew spotlessApply and ./gradlew spotlessCheck to check my code follows the style guide of this project.
  • I have run ./gradlew check and ./gradlew connectedCheck to test my changes locally.
  • I have built and run the demo app(s) to verify my change fixes the issue and/or does not break the demo app(s).

Copy link
Contributor

@omarismail94 omarismail94 left a comment

Choose a reason for hiding this comment

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

Nice change Aditya! Left a couple of comments

@aditya-07 aditya-07 assigned omarismail94 and unassigned aditya-07 Jan 18, 2023
Copy link
Contributor

@omarismail94 omarismail94 left a comment

Choose a reason for hiding this comment

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

This looks great @aditya-07 ! just one minor nit

@aditya-07 aditya-07 assigned omarismail94 and unassigned aditya-07 Jan 23, 2023
@omarismail94 omarismail94 merged commit 8d409c1 into google:master Jan 25, 2023
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

Successfully merging this pull request may close these issues.

Workflow | evaluateLibrary not working on android as in the test case.
3 participants