mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-08-09 01:29:25 +00:00
Possible fix for AudioNoisyReceiver popping up 'App is not responding'.
This commit is contained in:
parent
8ba8e535bd
commit
b75217f789
1 changed files with 7 additions and 2 deletions
|
@ -4,14 +4,19 @@ import android.content.BroadcastReceiver
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import com.futo.platformplayer.logging.Logger
|
import com.futo.platformplayer.logging.Logger
|
||||||
|
import com.futo.platformplayer.states.StateApp
|
||||||
|
import kotlinx.coroutines.Dispatchers
|
||||||
|
import kotlinx.coroutines.launch
|
||||||
|
|
||||||
|
|
||||||
class AudioNoisyReceiver : BroadcastReceiver() {
|
class AudioNoisyReceiver : BroadcastReceiver() {
|
||||||
|
|
||||||
override fun onReceive(context: Context?, intent: Intent?) {
|
override fun onReceive(context: Context?, intent: Intent?) {
|
||||||
|
StateApp.instance.scopeOrNull?.launch(Dispatchers.Main) {
|
||||||
Logger.i(TAG, "Audio Noisy received");
|
Logger.i(TAG, "Audio Noisy received");
|
||||||
MediaControlReceiver.onPauseReceived.emit();
|
MediaControlReceiver.onPauseReceived.emit();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private val TAG = "AudioNoisyReceiver"
|
private val TAG = "AudioNoisyReceiver"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue