mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-04-20 03:24:50 +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,13 +4,18 @@ import android.content.BroadcastReceiver
|
|||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import com.futo.platformplayer.logging.Logger
|
||||
import com.futo.platformplayer.states.StateApp
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
|
||||
class AudioNoisyReceiver : BroadcastReceiver() {
|
||||
|
||||
override fun onReceive(context: Context?, intent: Intent?) {
|
||||
Logger.i(TAG, "Audio Noisy received");
|
||||
MediaControlReceiver.onPauseReceived.emit();
|
||||
StateApp.instance.scopeOrNull?.launch(Dispatchers.Main) {
|
||||
Logger.i(TAG, "Audio Noisy received");
|
||||
MediaControlReceiver.onPauseReceived.emit();
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
|
Loading…
Add table
Reference in a new issue