Skip to content

Conversation

krocard
Copy link
Contributor

@krocard krocard commented Oct 7, 2025

Adds support for hapticChannelsMuted to AudioAttributes, which is required to control audio coupled haptic feedback on supported devices.

The change mirrors the addition of hapticChannelMuted in the platform's android.media.AudioAttributes in API 29.

In particular, this changes allows to use the HapticGenerator audio effect with ExoPlayer.

Test

Snippet addapted from HapticGenerator documentation):

val audioSessionId = audioManager.generateAudioSessionId()
val player = Player.Builder().setAudioSessionId(audioSessionId).build()
if (HapticGenerator.isAvailable()) {
     HapticGenerator.create(audioSessionId).setEnabled(true)
 }

Play and check that the phone vibrates in sync with the audio.

This change adds support for hapticChannelsMuted to AudioAttributes,
which is required to control haptic feedback on supported devices.

The change mirrors the addition of this functionality in the platform's
android.media.AudioAttributes in API 29.
Copy link

google-cla bot commented Oct 7, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@icbaker
Copy link
Collaborator

icbaker commented Oct 7, 2025

Thanks Kevin! This looks like it goes a bit of the way towards #2677.

@microkatz
Copy link
Contributor

@krocard

Thanks Kevin! Would you mind signing the cla/google before we can take a look at reviewing your PR?

@krocard
Copy link
Contributor Author

krocard commented Oct 8, 2025

It's in progress. It should be sorted out today.
Edit: We are still working on it.
Edit2: We might have to submit a new one as our old CLA doesn’t seem to be working

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.

3 participants