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

[health] Prevent app crash on Android when Health Connect SDK is unavailable #1048

Merged
merged 5 commits into from
Sep 23, 2024

Conversation

SlimShadyIAm
Copy link
Contributor

@SlimShadyIAm SlimShadyIAm commented Sep 19, 2024

Added checks for SDK status before reading, writing or otherwise interacting with Health Connect. If HC is not available, we will throw an exception to say that HC needs to be installed.

Closes #1043.

@bardram
Copy link
Contributor

bardram commented Sep 20, 2024

I will review this. But in general, I'm not a big fan of all the exceptions being thrown, so I will look into reducing this.

Copy link
Contributor

@bardram bardram left a comment

Choose a reason for hiding this comment

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

I've updated the plugin to more gracefull error handling and making it throw less errors. Also updated the demo app to use the method to check for Health Connect and only allow accesss to setter / getters (buttons) when HC is available.

Update to docs, incl. README.

@bardram bardram marked this pull request as ready for review September 20, 2024 13:30
@bardram
Copy link
Contributor

bardram commented Sep 23, 2024

Also upgraded to the type-safe JSON serialization in carp_serialization v. 2.0

@bardram bardram merged commit d586552 into master Sep 23, 2024
1 check passed
@bardram bardram deleted the fix/check-hc-availability branch September 23, 2024 15:40
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.

[health: 11.0.0] Crashes with lateinit property healthConnectClient has not been initialized
2 participants