Skip to content

Conversation

@klnfreedom
Copy link

This pull request introduces improved permission handling for health data retrieval on Android and adds support for tracking the raw workout activity type in the Dart data model. The changes focus on ensuring that sensitive health data is only accessed when the appropriate permissions are granted, with clear logging and error handling, and on making the workout data model more robust and informative.

Android: Enhanced permission checks and error handling

  • Added a new HealthPermissionChecker class to centralize and simplify permission checks for location, distance, calories burned, and steps data. This class ensures that data is only accessed if the corresponding permissions are granted, improving security and user privacy. (android/src/main/kotlin/cachet/plugins/health/HealthPermissionChecker.kt)
  • Updated HealthDataReader to use HealthPermissionChecker for checking permissions before retrieving distance, calories burned, and steps data. If permissions are missing, the code now logs a message and skips data retrieval for that type, instead of attempting access. (android/src/main/kotlin/cachet/plugins/health/HealthDataReader.kt) [1] [2] [3] [4]
  • Improved error handling in HealthDataReader by returning a more descriptive error with an empty list when data is unavailable, instead of just an empty list. (android/src/main/kotlin/cachet/plugins/health/HealthDataReader.kt)

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.

1 participant