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

[Android] use explicit not-exported flag for AudioBecomingNoisyReceiver #3327

Merged
merged 4 commits into from
Nov 4, 2023

Conversation

AndyG
Copy link
Contributor

@AndyG AndyG commented Nov 1, 2023

Add RECEIVER_NOT_EXPORTED flag support to AudioBecomingNoisyReceiver for Android 14 support. See
https://developer.android.com/about/versions/14/behavior-changes-14#runtime-receivers-exported for details.

Without this fix, apps using this dependency and targeting SDK 34 will crash when we attempt to register this receiver:

SecurityException: {package name here}: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts

KrzysztofMoch
KrzysztofMoch previously approved these changes Nov 2, 2023
Copy link
Member

@KrzysztofMoch KrzysztofMoch left a comment

Choose a reason for hiding this comment

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

Thanks 🙌

@KrzysztofMoch
Copy link
Member

@AndyG were you able to compile library without bumping androidx.core version? currently we have 1.1.0 but RECEIVER_NOT_EXPORTED seems to be added in 1.9.0

@KrzysztofMoch KrzysztofMoch dismissed their stale review November 2, 2023 08:20

androidx.core version issue

@AndyG
Copy link
Contributor Author

AndyG commented Nov 2, 2023

nope, def want to bump that, will make the necessary changes, test, and ping when ready. thanks for taking a look!

@AndyG
Copy link
Contributor Author

AndyG commented Nov 3, 2023

@KrzysztofMoch I bumped that dependency and some related dependencies to keep them roughly in sync. I was able to use this source on a local build of my own app. Please let me know if you have any further concerns -- excited to help here but my react-native build tools experience is limited to be totally candid so a second opinion is extremely valuable.

@KrzysztofMoch
Copy link
Member

Thanks, I do some tests and we need to change some versions in order to keep kotlin version at 1.7.0:

  • androidx.core:core:1.12.0 -> androidx.core:core:1.9.0
  • androidx.activity:activity:1.8.0 -> androidx.activity:activity:1.6.0

And we need to set minimal kotlin version to 1.7.0 (currently 1.6.20) but I will do it in separate PR.

@freeboub I have checked and this (1.7.0) is recommended version in react native library template

@AndyG
Copy link
Contributor Author

AndyG commented Nov 4, 2023

okay thanks for the heads up. I have made those two changes in this PR, but not the kotlin version. Let me know how I can best support you to get this merged and released!

@freeboub freeboub merged commit 68beb27 into TheWidlarzGroup:master Nov 4, 2023
1 check passed
AndyG added a commit to discord/react-native-video that referenced this pull request Nov 7, 2023
…er (TheWidlarzGroup#3327)

* using explicit not-exported flag for AudioBecomingNoisyReceiver
* androidx.core:core version 1.9.0, androix.activity:activity version 1.6.0

---------

Co-authored-by: Andy G <Andy Garron>
AndyG added a commit to discord/react-native-video that referenced this pull request Nov 7, 2023
…er (TheWidlarzGroup#3327)

* using explicit not-exported flag for AudioBecomingNoisyReceiver

---------

Co-authored-by: Andy G <Andy Garron>
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