According to the documentation, there is no callback for when a user denies the Health Connect permission twice. We need to display a custom button that redirects the user to the Health Connect settings.
val requestPermissions =
registerForActivityResult(requestPermissionActivityContract) { granted ->
mViewModel.checkHealthConnectPermissions(
grantedPermissions = granted
)
//Update Permission Request Count
if (granted.isEmpty()) {
ShowCustomButton()
}
}