Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.2.5

* Fix crash "Methods marked with @UiThread must be executed on the main thread" on Android TV devices by dispatching method channel invocations on the main looper.

## 0.2.4

* Support AGP 9.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -715,9 +715,16 @@ private class AudioManagerSingleton(applicationContext: Context) {
}

fun invokeMethod(method: String, vararg args: Any?) {
if (Looper.myLooper() == Looper.getMainLooper()) {
invokeMethodOnMain(method, args)
} else {
handler.post { invokeMethodOnMain(method, args) }
}
}

private fun invokeMethodOnMain(method: String, args: Array<out Any?>) {
for (instance in instances) {
val list = args.toMutableList()
instance.channel!!.invokeMethod(method, list)
instance.channel!!.invokeMethod(method, args.toMutableList())
}
}

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: audio_session
description: Sets the iOS audio session category and Android audio attributes for your app, and manages your app's audio focus, mixing and ducking behaviour.
version: 0.2.4
version: 0.2.5
homepage: https://github.com/ryanheise/audio_session
topics:
- audio
Expand Down