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

Bug fix for Android 14 Health Connect Changes #56

Closed
wants to merge 1 commit into from

Conversation

trianglegrrl
Copy link

See #50 for details on what this fixes and why.

See matinzd#50 for details
on what this fixes and why.
Comment on lines +89 to +93
val intent = if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
Intent("android.health.connect.action.MANAGE_HEALTH_PERMISSIONS")
} else {
HCPermissionManager(providerPackageName).healthPermissionContract.createIntent(applicationContext, latestPermissions!!)
}
Copy link
Owner

@matinzd matinzd Jan 18, 2024

Choose a reason for hiding this comment

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

This is already taken care of inside the core:

package > androidx.health.connect.client.contracts > HealthPermissionsRequestContract.kt

    private val delegate: ActivityResultContract<Set<String>, Set<String>> =
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
            HealthPermissionsRequestModuleContract()
        } else {
            HealthPermissionsRequestAppContract(providerPackageName)
        }

https://androidx.tech/artifacts/health.connect/connect-client/1.1.0-alpha06-source/androidx/health/connect/client/contracts/HealthPermissionsRequestContract.kt.html

Copy link
Owner

Choose a reason for hiding this comment

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

@matinzd
Copy link
Owner

matinzd commented Jan 20, 2024

Thanks for your contribution!
I found some time to figure this out. Closing this in favor of #60.

@matinzd matinzd closed this Jan 20, 2024
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.

2 participants