Skip to content

Commit

Permalink
revert(android): prevent security exception
Browse files Browse the repository at this point in the history
  • Loading branch information
YangJonghun committed Nov 8, 2023
1 parent 53ade18 commit a1a7d30
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ dependencies {
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+"

implementation "androidx.core:core:1.9.0"

// For media playback using ExoPlayer
implementation "androidx.media3:media3-exoplayer:$media3_version"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import android.content.IntentFilter;
import android.media.AudioManager;

import androidx.core.content.ContextCompat;

public class AudioBecomingNoisyReceiver extends BroadcastReceiver {

private final Context context;
Expand All @@ -25,7 +27,7 @@ public void onReceive(Context context, Intent intent) {
public void setListener(BecomingNoisyListener listener) {
this.listener = listener;
IntentFilter intentFilter = new IntentFilter(AudioManager.ACTION_AUDIO_BECOMING_NOISY);
context.registerReceiver(this, intentFilter);
ContextCompat.registerReceiver(context, this, intentFilter, ContextCompat.RECEIVER_NOT_EXPORTED);
}

public void removeListener() {
Expand Down

0 comments on commit a1a7d30

Please sign in to comment.