SamsungDAP: Clamp DolbyCore.getProfile()'s returned value

When dolby was never enabled before this would return -1 resulting in a
crash when adding the QS Tile.

Change-Id: I9ce49309aa54f4e954bd3917bfc737811a152a55
tirimbino
Tim Zimmermann 3 years ago committed by LuK1337
parent 577494c66a
commit 0178b292e1
  1. 2
      dap/src/org/lineageos/dap/DolbyCore.kt

@ -46,7 +46,7 @@ object DolbyCore {
fun getProfile(): Int {
val out = intArrayOf(PROFILE_AUTO)
audioEffect?.getParameter(EFFECT_PARAM_PROFILE, out)
return out.first()
return out.first().coerceIn(PROFILE_AUTO, PROFILE_SPACIAL_AUDIO)
}
fun getProfileName(context: Context): String {

Loading…
Cancel
Save