diff --git a/audio_service/CHANGELOG.md b/audio_service/CHANGELOG.md index ba3f1965..9538543f 100644 --- a/audio_service/CHANGELOG.md +++ b/audio_service/CHANGELOG.md @@ -1,3 +1,6 @@ +## 0.18.16 +* Fix error handling in onLoadChildren, onLoadItem and onSearch (@dsst95) + ## 0.18.15 * Add deep link support for FlutterFragmentActivity (@jan-milovanovic). diff --git a/audio_service/android/src/main/java/com/ryanheise/audioservice/AudioServicePlugin.java b/audio_service/android/src/main/java/com/ryanheise/audioservice/AudioServicePlugin.java index b776a840..1f49cea4 100644 --- a/audio_service/android/src/main/java/com/ryanheise/audioservice/AudioServicePlugin.java +++ b/audio_service/android/src/main/java/com/ryanheise/audioservice/AudioServicePlugin.java @@ -551,12 +551,13 @@ public void onLoadChildren(final String parentMediaId, final MediaBrowserService audioHandlerInterface.invokeMethod("getChildren", args, new MethodChannel.Result() { @Override public void error(String errorCode, String errorMessage, Object errorDetails) { - result.sendError(new Bundle()); + setErrorState(errorCode, errorMessage); + result.sendResult(null); } @Override public void notImplemented() { - result.sendError(new Bundle()); + result.sendResult(null); } @Override @@ -583,12 +584,13 @@ public void onLoadItem(String itemId, final MediaBrowserServiceCompat.Result(), + 0, + null, + AudioProcessingState.error, + false, + 0, + 0, + 0, + 0, + Integer.parseInt(errorCode), + errorMessage, + 0, + 0, + false, + null); + } } private static List> mediaItems2raw(List mediaItems) { diff --git a/audio_service/pubspec.yaml b/audio_service/pubspec.yaml index 0e394a12..7dba64b1 100644 --- a/audio_service/pubspec.yaml +++ b/audio_service/pubspec.yaml @@ -1,6 +1,6 @@ name: audio_service description: Flutter plugin to play audio in the background while the screen is off. -version: 0.18.15 +version: 0.18.16 repository: https://github.com/ryanheise/audio_service/tree/minor/audio_service issue_tracker: https://github.com/ryanheise/audio_service/issues topics: