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

[expo-av] Fixed an issue with Audio Interruption Mode not correctly being set on Android #13236

Merged
merged 1 commit into from
Jun 10, 2021
Merged

[expo-av] Fixed an issue with Audio Interruption Mode not correctly being set on Android #13236

merged 1 commit into from
Jun 10, 2021

Conversation

matt-oakes
Copy link
Contributor

Why

The audio interruption mode was not correctly set when using this code:

await Audio.setAudioModeAsync({
    interruptionModeAndroid: Audio.INTERRUPTION_MODE_ANDROID_DO_NOT_MIX,
});

If you started audio in another app and then played audio in my app, it would duck the other audio, rather than interrupting it.

How

The issue was caused by the case statement incorrectly falling through due to a lack of break statement. This caused the mAudioInterruptionMode value to first be set to the correct DO_NOT_MIX value, before then being set to DUCK_OTHERS incorrectly.

Adding the break statement is all that is needed to fix the issue.

Test Plan

Tested this manually in my project.

Checklist

  • Documentation is up to date to reflect these changes (eg: https://docs.expo.io and README.md).
  • This diff will work correctly for expo build (eg: updated @expo/xdl).
  • This diff will work correctly for expo prebuild & EAS Build (eg: updated a module plugin).

@expo-bot expo-bot added the bot: passed checks ExpoBot has nothing to complain about label Jun 10, 2021
Copy link
Member

@brentvatne brentvatne left a comment

Choose a reason for hiding this comment

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

thanks! this looks right to me. cc @bbarthec

Copy link
Contributor

@bbarthec bbarthec left a comment

Choose a reason for hiding this comment

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

LGTM 👌

@bbarthec bbarthec merged commit 34f6af0 into expo:master Jun 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: passed checks ExpoBot has nothing to complain about
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants