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.
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:
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.