[Android] use explicit not-exported flag for AudioBecomingNoisyReceiver (#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>
This commit is contained in:
Andy Garron 2023-11-04 06:59:59 -07:00 committed by GitHub
parent ad0422d989
commit 68beb2701a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -152,11 +152,10 @@ dependencies {
exclude group: 'com.android.support' exclude group: 'com.android.support'
} }
// All support libs must use the same version implementation "androidx.annotation:annotation:1.7.0"
implementation "androidx.annotation:annotation:1.1.0" implementation "androidx.core:core:1.9.0"
implementation "androidx.core:core:1.1.0" implementation "androidx.media:media:1.6.0"
implementation "androidx.media:media:1.1.0" implementation "androidx.activity:activity:1.6.0"
implementation "androidx.activity:activity:1.4.0"
implementation('com.google.android.exoplayer:extension-okhttp:2.18.1') { implementation('com.google.android.exoplayer:extension-okhttp:2.18.1') {
exclude group: 'com.squareup.okhttp3', module: 'okhttp' exclude group: 'com.squareup.okhttp3', module: 'okhttp'

View File

@ -2,6 +2,7 @@ package com.brentvatne.receiver;
import android.content.BroadcastReceiver; import android.content.BroadcastReceiver;
import android.content.Context; import android.content.Context;
import androidx.core.content.ContextCompat;
import android.content.Intent; import android.content.Intent;
import android.content.IntentFilter; import android.content.IntentFilter;
import android.media.AudioManager; import android.media.AudioManager;
@ -25,7 +26,7 @@ public class AudioBecomingNoisyReceiver extends BroadcastReceiver {
public void setListener(BecomingNoisyListener listener) { public void setListener(BecomingNoisyListener listener) {
this.listener = listener; this.listener = listener;
IntentFilter intentFilter = new IntentFilter(AudioManager.ACTION_AUDIO_BECOMING_NOISY); 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() { public void removeListener() {