playback: disable audio focus setting on api 31
Disable the ability to customize audio focus on Android 12 and up. Android 12 automatically regulates audio streams even further than it did in previous versions, to the point where the audio focus setting no longer makes sense on that version. I may extend the removal to all versions in the future.
This commit is contained in:
@@ -127,7 +127,6 @@ class PlaybackFragment : Fragment() {
|
||||
}
|
||||
|
||||
binding.playbackLoop.setImageResource(resId)
|
||||
binding.playbackLoop.isActivated = loopMode != LoopMode.NONE
|
||||
}
|
||||
|
||||
playbackModel.position.observe(viewLifecycleOwner) { pos ->
|
||||
|
||||
@@ -20,6 +20,7 @@ package org.oxycblt.auxio.playback.system
|
||||
|
||||
import android.content.Context
|
||||
import android.media.AudioManager
|
||||
import android.os.Build
|
||||
import androidx.core.math.MathUtils
|
||||
import androidx.media.AudioAttributesCompat
|
||||
import androidx.media.AudioFocusRequestCompat
|
||||
@@ -233,7 +234,7 @@ class AudioReactor(
|
||||
// --- INTERNAL AUDIO FOCUS ---
|
||||
|
||||
override fun onAudioFocusChange(focusChange: Int) {
|
||||
if (!settingsManager.doAudioFocus) {
|
||||
if (!settingsManager.doAudioFocus && Build.VERSION.SDK_INT < Build.VERSION_CODES.S) {
|
||||
// Don't do audio focus if its not enabled
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user