diff --git a/engine/src/flutter/shell/platform/android/io/flutter/plugin/common/BasicMessageChannel.java b/engine/src/flutter/shell/platform/android/io/flutter/plugin/common/BasicMessageChannel.java index fa21c71e95..ea6612d782 100644 --- a/engine/src/flutter/shell/platform/android/io/flutter/plugin/common/BasicMessageChannel.java +++ b/engine/src/flutter/shell/platform/android/io/flutter/plugin/common/BasicMessageChannel.java @@ -144,11 +144,11 @@ public final class BasicMessageChannel { /** * Toggles whether the channel should show warning messages when discarding messages due to - * overflow. When 'allowed' is true the channel is expected to overflow and warning messages will + * overflow. When 'warns' is false the channel is expected to overflow and warning messages will * not be shown. */ - public void allowChannelBufferOverflow(boolean allowed) { - allowChannelBufferOverflow(messenger, name, allowed); + public void setWarnsOnChannelOverflow(boolean warns) { + setWarnsOnChannelOverflow(messenger, name, warns); } private static ByteBuffer packetFromEncodedMessage(ByteBuffer message) { @@ -182,13 +182,13 @@ public final class BasicMessageChannel { /** * Toggles whether the channel should show warning messages when discarding messages due to - * overflow. When 'allowed' is true the channel is expected to overflow and warning messages will + * overflow. When 'warns' is false the channel is expected to overflow and warning messages will * not be shown. */ - public static void allowChannelBufferOverflow( - @NonNull BinaryMessenger messenger, @NonNull String channel, boolean allowed) { + public static void setWarnsOnChannelOverflow( + @NonNull BinaryMessenger messenger, @NonNull String channel, boolean warns) { final StandardMethodCodec codec = StandardMethodCodec.INSTANCE; - Object[] arguments = {channel, allowed}; + Object[] arguments = {channel, !warns}; MethodCall methodCall = new MethodCall("overflow", Arrays.asList(arguments)); ByteBuffer message = codec.encodeMethodCall(methodCall); ByteBuffer packet = packetFromEncodedMessage(message); diff --git a/engine/src/flutter/shell/platform/android/io/flutter/plugin/common/MethodChannel.java b/engine/src/flutter/shell/platform/android/io/flutter/plugin/common/MethodChannel.java index 3aa2698ad4..3191aa4e3a 100644 --- a/engine/src/flutter/shell/platform/android/io/flutter/plugin/common/MethodChannel.java +++ b/engine/src/flutter/shell/platform/android/io/flutter/plugin/common/MethodChannel.java @@ -159,11 +159,11 @@ public class MethodChannel { /** * Toggles whether the channel should show warning messages when discarding messages due to - * overflow. When 'allowed' is true the channel is expected to overflow and warning messages will + * overflow. When 'warns' is false the channel is expected to overflow and warning messages will * not be shown. */ - public void allowChannelBufferOverflow(boolean allowed) { - BasicMessageChannel.allowChannelBufferOverflow(messenger, name, allowed); + public void setWarnsOnChannelOverflow(boolean warns) { + BasicMessageChannel.setWarnsOnChannelOverflow(messenger, name, warns); } /** A handler of incoming method calls. */ diff --git a/engine/src/flutter/shell/platform/android/test/io/flutter/plugin/common/MethodChannelTest.java b/engine/src/flutter/shell/platform/android/test/io/flutter/plugin/common/MethodChannelTest.java index 8f8836f614..df1fa2108c 100644 --- a/engine/src/flutter/shell/platform/android/test/io/flutter/plugin/common/MethodChannelTest.java +++ b/engine/src/flutter/shell/platform/android/test/io/flutter/plugin/common/MethodChannelTest.java @@ -56,7 +56,7 @@ public class MethodChannelTest { String channel = "flutter/test"; MethodChannel rawChannel = new MethodChannel(dartExecutor, channel); - rawChannel.allowChannelBufferOverflow(true); + rawChannel.setWarnsOnChannelOverflow(false); // Created from the following Dart code: // MethodCall methodCall = const MethodCall('overflow', ['flutter/test', true]);