Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 53212fc

Browse files
committed
Use jsonmethodcodec
1 parent 00621e2 commit 53212fc

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

shell/platform/android/io/flutter/embedding/engine/systemchannels/ScribeChannel.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
import androidx.annotation.VisibleForTesting;
1515
import io.flutter.Log;
1616
import io.flutter.embedding.engine.dart.DartExecutor;
17+
import io.flutter.plugin.common.JSONMethodCodec;
1718
import io.flutter.plugin.common.MethodCall;
1819
import io.flutter.plugin.common.MethodChannel;
19-
import io.flutter.plugin.common.StandardMethodCodec;
2020

2121
/**
2222
* {@link ScribeChannel} is a platform channel that is used by the framework to facilitate the
@@ -45,7 +45,6 @@ public void onMethodCall(@NonNull MethodCall call, @NonNull MethodChannel.Result
4545
return;
4646
}
4747
String method = call.method;
48-
Object args = call.arguments;
4948
Log.v(TAG, "Received '" + method + "' message.");
5049
switch (method) {
5150
case METHOD_IS_STYLUS_HANDWRITING_AVAILABLE:
@@ -92,7 +91,7 @@ private void startStylusHandwriting(
9291
}
9392

9493
public ScribeChannel(@NonNull DartExecutor dartExecutor) {
95-
channel = new MethodChannel(dartExecutor, "flutter/scribe", StandardMethodCodec.INSTANCE);
94+
channel = new MethodChannel(dartExecutor, "flutter/scribe", JSONMethodCodec.INSTANCE);
9695
channel.setMethodCallHandler(parsingMethodHandler);
9796
}
9897

shell/platform/android/test/io/flutter/embedding/engine/systemchannels/ScribeChannelTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
import androidx.test.ext.junit.runners.AndroidJUnit4;
1616
import io.flutter.embedding.engine.dart.DartExecutor;
1717
import io.flutter.plugin.common.BinaryMessenger;
18+
import io.flutter.plugin.common.JSONMethodCodec;
1819
import io.flutter.plugin.common.MethodCall;
19-
import io.flutter.plugin.common.StandardMethodCodec;
2020
import java.nio.ByteBuffer;
2121
import org.junit.Before;
2222
import org.junit.Test;
@@ -29,7 +29,7 @@ public class ScribeChannelTest {
2929
private static BinaryMessenger.BinaryReply sendToBinaryMessageHandler(
3030
BinaryMessenger.BinaryMessageHandler binaryMessageHandler, String method) {
3131
MethodCall methodCall = new MethodCall(method, null);
32-
ByteBuffer encodedMethodCall = StandardMethodCodec.INSTANCE.encodeMethodCall(methodCall);
32+
ByteBuffer encodedMethodCall = JSONMethodCodec.INSTANCE.encodeMethodCall(methodCall);
3333
BinaryMessenger.BinaryReply mockReply = mock(BinaryMessenger.BinaryReply.class);
3434
binaryMessageHandler.onMessage((ByteBuffer) encodedMethodCall.flip(), mockReply);
3535
return mockReply;

0 commit comments

Comments
 (0)