Check whether historical health functionality is available #148
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🚀 Pull Request
Brief Description
This pull request hide the corresponding PermissionCard in case of Health Connect historical health functionality is not available. Apart from that it also localizes missing read permission.
Linked Issues
GitHub Copilot Text
This pull request introduces support for checking the availability of historical health data permissions, refactors error messages to use localized strings, and updates the UI logic to conditionally display historical health data options based on availability. Below are the key changes grouped by theme:
Localization Updates:
permission_health_read_missingto bothlib/l10n/app_de.arbandlib/l10n/app_en.arbfor displaying a message when health data read permissions are missing. [1] [2]Permissions State Enhancements:
isHealthHistoricalAvailablein thePermissionsStateclass to track the availability of historical health data functionality. Updated the constructor,copyWithmethod, andPermissionsNotifierlogic to handle this property. [1] [2] [3] [4] [5]UI Logic Adjustments:
PermissionsPageandPermissionsSettingsScreenwidgets to use the newisHealthHistoricalAvailableproperty instead of relying solely on the platform check. This ensures the historical health data option is displayed only when available. [1] [2] [3] [4]Error Message Refactoring:
permission_health_read_missingstring across multiple widgets for consistency. [1] [2] [3] [4]