Skip to content

Commit

Permalink
using explicit not-exported flag for AudioBecomingNoisyReceiver
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy G authored and Andy G committed Nov 1, 2023
1 parent 9914faf commit a8b1c20
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.content.BroadcastReceiver;
import android.content.Context;
import androidx.core.content.ContextCompat;
import android.content.Intent;
import android.content.IntentFilter;
import android.media.AudioManager;
Expand All @@ -25,7 +26,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 a8b1c20

Please sign in to comment.