Fix Player Controls in Notif

This commit is contained in:
2026-05-21 02:59:11 +10:00
parent c0600e44f4
commit d2933af2ca
@@ -89,16 +89,13 @@ object ManifestPatcher {
} }
} }
"uses-sdk" -> object : NodeVisitor(nv) { // Preserve the original targetSdkVersion. Downgrading it (e.g. to 30)
override fun attr(ns: String?, name: String?, resourceId: Int, type: Int, value: Any?) { // makes Android render MediaStyle notifications with the legacy
if (name == "targetSdkVersion") { // compact-row layout instead of the modern auto-rendered controls,
val version = if (Build.VERSION.SDK_INT >= 31) 30 else 28 // because TIDAL's notification builder skips addAction() on API 33+
super.attr(ns, name, resourceId, type, version) // expecting the system to auto-infer buttons from the MediaSession —
} else { // which only happens for apps targeting SDK >= 31.
super.attr(ns, name, resourceId, type, value) "uses-sdk" -> nv
}
}
}
"permission" -> object : NodeVisitor(nv) { "permission" -> object : NodeVisitor(nv) {
override fun attr(ns: String?, name: String, resourceId: Int, type: Int, value: Any?) { override fun attr(ns: String?, name: String, resourceId: Int, type: Int, value: Any?) {