From b90961e0a3081f03a9b542a049864e8352d61aee Mon Sep 17 00:00:00 2001 From: Amir Hardon Date: Tue, 4 Jun 2019 12:38:38 -0700 Subject: [PATCH] Fix platform views channel regression (flutter/engine#9185) This regression was introduced in #7847. The PlatformViewsChannel method call handler was always setting the result to `notImplemented` even after handling a result, this resulted in a "Reply already submitted" exception being thrown. Note that the method channel code is swallowing this exception and logging an error, so we didn't crash instead we were logging an error(this is why the integration test didn't fail). Filed https://github.com/flutter/flutter/issues/33863 to make sure tests fail when such exceptions are thrown. This PR also cleans up an unused `NoSuchPlatformViewException` that was introduced in #7847. https://github.com/flutter/flutter/issues/33866 --- .../engine/systemchannels/PlatformViewsChannel.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/systemchannels/PlatformViewsChannel.java b/engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/systemchannels/PlatformViewsChannel.java index bccb2fcf9d..2a470011c8 100644 --- a/engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/systemchannels/PlatformViewsChannel.java +++ b/engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/systemchannels/PlatformViewsChannel.java @@ -51,8 +51,9 @@ public class PlatformViewsChannel { case "setDirection": setDirection(call, result); break; + default: + result.notImplemented(); } - result.notImplemented(); } private void create(MethodCall call, MethodChannel.Result result) { @@ -429,9 +430,4 @@ public class PlatformViewsChannel { this.flags = flags; } } - - /** - * The provided platform view ID does not correspond to any existing platform view. - */ - public static class NoSuchPlatformViewException extends IllegalStateException {} }