Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when throwing exception in getChildren #1081

Open
dsst95 opened this issue Jul 14, 2024 · 0 comments · May be fixed by #1086
Open

Error when throwing exception in getChildren #1081

dsst95 opened this issue Jul 14, 2024 · 0 comments · May be fixed by #1086

Comments

@dsst95
Copy link

dsst95 commented Jul 14, 2024

Feature proposal

It should be possible to show an custom error in full screen in Android Auto. When an error occurs during AudioHandler.getChildren, result.sendError is used which leads to another exception:

java.lang.UnsupportedOperationException: It is not supported to send an error for root
E/MethodChannel#com.ryanheise.audio_service.handler.methods(24285): 	at androidx.media.MediaBrowserServiceCompat$Result.onErrorSent(MediaBrowserServiceCompat.java:945)
E/MethodChannel#com.ryanheise.audio_service.handler.methods(24285): 	at androidx.media.MediaBrowserServiceCompat$Result.sendError(MediaBrowserServiceCompat.java:890)
E/MethodChannel#com.ryanheise.audio_service.handler.methods(24285): 	at com.ryanheise.audioservice.AudioServicePlugin$AudioHandlerInterface$1.error(AudioServicePlugin.java:539)
E/MethodChannel#com.ryanheise.audio_service.handler.methods(24285): 	at io.flutter.plugin.common.MethodChannel$IncomingResultHandler.reply(MethodChannel.java:246)
E/MethodChannel#com.ryanheise.audio_service.handler.methods(24285): 	at io.flutter.embedding.engine.dart.DartMessenger.handlePlatformMessageResponse(DartMessenger.java:376)
E/MethodChannel#com.ryanheise.audio_service.handler.methods(24285): 	at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessageResponse(FlutterJNI.java:1076)
E/MethodChannel#com.ryanheise.audio_service.handler.methods(24285): 	at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#com.ryanheise.audio_service.handler.methods(24285): 	at android.os.MessageQueue.next(MessageQueue.java:343)
E/MethodChannel#com.ryanheise.audio_service.handler.methods(24285): 	at android.os.Looper.loop(Looper.java:188)
E/MethodChannel#com.ryanheise.audio_service.handler.methods(24285): 	at android.app.ActivityThread.main(ActivityThread.java:7617)
E/MethodChannel#com.ryanheise.audio_service.handler.methods(24285): 	at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#com.ryanheise.audio_service.handler.methods(24285): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
E/MethodChannel#com.ryanheise.audio_service.handler.methods(24285): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:941)

Setting the PlayerState to error and returning null from AudioHandler.getChildren is also not possible. But in order to show an full screen error message null must be returned from getChildren.

Motivating use case(s)

I am trying to show an custom full screen error to the user if he is not logged in the app in Android Auto, as described in https://developer.android.com/training/cars/media/automotive-os#-error-handling. But there is no possibility to show an custom error from AudioHandler.getChildren.

@dsst95 dsst95 linked a pull request Aug 9, 2024 that will close this issue
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant