Skip to content

Comments

Add hearing aid support#1849

Open
sabrina-440 wants to merge 8 commits intojellyfin:masterfrom
sabrina-440:master
Open

Add hearing aid support#1849
sabrina-440 wants to merge 8 commits intojellyfin:masterfrom
sabrina-440:master

Conversation

@sabrina-440
Copy link

Changes
Add BluetoothHearingAid device (https://developer.android.com/reference/android/bluetooth/BluetoothHearingAid?hl=en#ACTION_CONNECTION_STATE_CHANGED) to the playback manager.
I do not have a hearing aid so I cannot test if it fixes the bug...

Issues
Attempts to fix #1836

// Bluetooth related filters - needs BLUETOOTH permission
addAction(BluetoothA2dp.ACTION_CONNECTION_STATE_CHANGED)
addAction(BluetoothHeadset.ACTION_AUDIO_STATE_CHANGED)
addAction(BluetoothHearingAid.ACTION_CONNECTION_STATE_CHANGED)

Check warning

Code scanning / Android Lint

Using inlined constants on older versions Warning

Field requires API level 29 (current min is 21): android.bluetooth.BluetoothHearingAid#ACTION_CONNECTION_STATE_CHANGED
@Nightfirecat
Copy link

I'm happy to test this. I see there's two APKs generated by the CI build, one is -libre-debug, the other -proprietary-debug. Which is the ideal one to install for testing purposes? (or does it matter?)

@crobibero
Copy link
Member

The main difference between libre/proprietary is chromecast support. There may be other differences but that's the one I know of

@Nightfirecat
Copy link

No dice, sadly--I get the same behavior on this debug build as I do on the release version.

@sabrina-440
Copy link
Author

No dice, sadly--I get the same behavior on this debug build as I do on the release version.

Thank you for testing, it seems not possibly due to not using new enough API I think? But I'm also not very familiar with this. When I have time I will look into if there's a way to upgrade


defaultConfig {
minSdk = 21
minSdk = 29
Copy link
Member

Choose a reason for hiding this comment

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

We'll keep the minimum SDK version at 21 for the next release and increase it to 23 afterwards. There are no plans to set it even higher in the foreseeable future.

Copy link
Author

Choose a reason for hiding this comment

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

Makes sense, I think in that case hearing aid support is not possible

Copy link
Member

@Maxr1998 Maxr1998 Dec 29, 2025

Choose a reason for hiding this comment

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

You should be able to simply wrap the code using new APIs with AndroidVersion.isAtLeast* methods, this way you can support hearing aids on newer versions without impacting older versions.

Copy link
Author

Choose a reason for hiding this comment

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

thanks for the suggestion, was in the middle of a move but just got a chance to add this

Copy link
Member

@Maxr1998 Maxr1998 left a comment

Choose a reason for hiding this comment

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

Thanks for the changes. There's one more comment that needs to be resolved. Please also make sure that our linter passes, you can run it locally with ./gradlew detekt. You should also reformat the code once more in Android Studio, the default configuration should fix most of the style issues which detekt will report already.

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.

Music does not play through bluetooth-connected hearing aids

5 participants