Skip to content

AudioService.addToQueue generates exception: "This session doesn't support queue management operations". #9

@BeMacized

Description

@BeMacized

Hello!

While experimenting with this plugin, I ran into the issue that whenever I call AudioService.addQueueItem, the following exception is thrown:

E/MethodChannel#ryanheise.com/audioService(11872): Failed to handle method call
E/MethodChannel#ryanheise.com/audioService(11872): java.lang.UnsupportedOperationException: This session doesn't support queue management operations
E/MethodChannel#ryanheise.com/audioService(11872): 	at android.support.v4.media.session.MediaControllerCompat$MediaControllerImplApi21.addQueueItem(MediaControllerCompat.java:1988)
E/MethodChannel#ryanheise.com/audioService(11872): 	at android.support.v4.media.session.MediaControllerCompat.addQueueItem(MediaControllerCompat.java:316)
E/MethodChannel#ryanheise.com/audioService(11872): 	at com.ryanheise.audioservice.AudioServicePlugin$ClientHandler.onMethodCall(AudioServicePlugin.java:316)
E/MethodChannel#ryanheise.com/audioService(11872): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:200)
E/MethodChannel#ryanheise.com/audioService(11872): 	at io.flutter.view.FlutterNativeView.handlePlatformMessage(FlutterNativeView.java:163)
E/MethodChannel#ryanheise.com/audioService(11872): 	at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#ryanheise.com/audioService(11872): 	at android.os.MessageQueue.next(MessageQueue.java:326)
E/MethodChannel#ryanheise.com/audioService(11872): 	at android.os.Looper.loop(Looper.java:160)
E/MethodChannel#ryanheise.com/audioService(11872): 	at android.app.ActivityThread.main(ActivityThread.java:6863)
E/MethodChannel#ryanheise.com/audioService(11872): 	at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#ryanheise.com/audioService(11872): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:537)
E/MethodChannel#ryanheise.com/audioService(11872): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

This error was produced with the following code, based off the example in this repo:
https://gist.github.com/BeMacized/5ccc11f43c4b18bd1e40a1e539082721

Any idea what might cause this?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions