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
This commit is contained in:
Amir Hardon
2019-06-04 12:38:38 -07:00
committed by GitHub
parent 118b06b2fa
commit b90961e0a3

View File

@@ -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 {}
}