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:
parent
30ad7f99db
commit
5b57d77d02
6 changed files with 8 additions and 2 deletions
|
@ -9,6 +9,9 @@
|
||||||
#### What's Fixed
|
#### What's Fixed
|
||||||
- Fixed issue where playback would start unexpectedly when opening the app
|
- Fixed issue where playback would start unexpectedly when opening the app
|
||||||
|
|
||||||
|
#### What's Changed
|
||||||
|
- Disabled audio focus customization on Android 12 [#75]
|
||||||
|
|
||||||
## v2.2.0
|
## v2.2.0
|
||||||
#### What's New:
|
#### What's New:
|
||||||
- Added Arabic translations [Courtesy of hasanpasha]
|
- Added Arabic translations [Courtesy of hasanpasha]
|
||||||
|
|
|
@ -127,7 +127,6 @@ class PlaybackFragment : Fragment() {
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.playbackLoop.setImageResource(resId)
|
binding.playbackLoop.setImageResource(resId)
|
||||||
binding.playbackLoop.isActivated = loopMode != LoopMode.NONE
|
|
||||||
}
|
}
|
||||||
|
|
||||||
playbackModel.position.observe(viewLifecycleOwner) { pos ->
|
playbackModel.position.observe(viewLifecycleOwner) { pos ->
|
||||||
|
|
|
@ -20,6 +20,7 @@ package org.oxycblt.auxio.playback.system
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.media.AudioManager
|
import android.media.AudioManager
|
||||||
|
import android.os.Build
|
||||||
import androidx.core.math.MathUtils
|
import androidx.core.math.MathUtils
|
||||||
import androidx.media.AudioAttributesCompat
|
import androidx.media.AudioAttributesCompat
|
||||||
import androidx.media.AudioFocusRequestCompat
|
import androidx.media.AudioFocusRequestCompat
|
||||||
|
@ -233,7 +234,7 @@ class AudioReactor(
|
||||||
// --- INTERNAL AUDIO FOCUS ---
|
// --- INTERNAL AUDIO FOCUS ---
|
||||||
|
|
||||||
override fun onAudioFocusChange(focusChange: Int) {
|
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
|
// Don't do audio focus if its not enabled
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<bool name="enable_theme_settings">false</bool>
|
<bool name="enable_theme_settings">false</bool>
|
||||||
|
<bool name="enable_audio_focus_setting">false</bool>
|
||||||
</resources>
|
</resources>
|
|
@ -1,5 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<bool name="enable_theme_settings">true</bool>
|
<bool name="enable_theme_settings">true</bool>
|
||||||
|
<bool name="enable_audio_focus_setting">true</bool>
|
||||||
<integer name="recycler_spans">1</integer>
|
<integer name="recycler_spans">1</integer>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -82,6 +82,7 @@
|
||||||
app:defaultValue="true"
|
app:defaultValue="true"
|
||||||
app:iconSpaceReserved="false"
|
app:iconSpaceReserved="false"
|
||||||
app:key="KEY_AUDIO_FOCUS"
|
app:key="KEY_AUDIO_FOCUS"
|
||||||
|
app:isPreferenceVisible="@bool/enable_audio_focus_setting"
|
||||||
app:summary="@string/set_focus_desc"
|
app:summary="@string/set_focus_desc"
|
||||||
app:title="@string/set_focus" />
|
app:title="@string/set_focus" />
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue