diff --git a/android/src/main/java/io/openim/flutter_openim_sdk/listener/OnBaseListener.java b/android/src/main/java/io/openim/flutter_openim_sdk/listener/OnBaseListener.java index 82fef79..ca906b1 100644 --- a/android/src/main/java/io/openim/flutter_openim_sdk/listener/OnBaseListener.java +++ b/android/src/main/java/io/openim/flutter_openim_sdk/listener/OnBaseListener.java @@ -19,13 +19,15 @@ public class OnBaseListener implements Base { @Override public void onError(int l, String s) { - Log.i("F-OpenIMSDK(native call flutter)", "method: 【 " + call.method + " 】, onError: { code:" + l + ", message:" + s + "}"); + String threadName = Thread.currentThread().getName(); + Log.i("F-OpenIMSDK(native call flutter)", "thread: " + threadName + " method: 【 " + call.method + " 】, onError: { code:" + l + ", message:" + s + "}"); CommonUtil.runMainThreadReturnError(result, l, s, null); } @Override public void onSuccess(String s) { - Log.i("F-OpenIMSDK(native call flutter)", "method: 【 " + call.method + " 】, onSuccess: " + s); + String threadName = Thread.currentThread().getName(); + Log.i("F-OpenIMSDK(native call flutter)", "thread: " + threadName + " method: 【 " + call.method + " 】, onSuccess: " + s); CommonUtil.runMainThreadReturn(result, s); } } diff --git a/android/src/main/java/io/openim/flutter_openim_sdk/util/CommonUtil.java b/android/src/main/java/io/openim/flutter_openim_sdk/util/CommonUtil.java index fb3a1bb..91bff39 100644 --- a/android/src/main/java/io/openim/flutter_openim_sdk/util/CommonUtil.java +++ b/android/src/main/java/io/openim/flutter_openim_sdk/util/CommonUtil.java @@ -33,6 +33,7 @@ public class CommonUtil { } public synchronized static void emitEvent(String method, String type, Object errCode, String errMsg, T data) { + String threadName = Thread.currentThread().getName(); runMainThread(() -> { Map res = new ArrayMap<>(); if (null != type) { @@ -47,7 +48,7 @@ public class CommonUtil { if (null != errMsg) { res.put("errMsg", errMsg); } - Log.i("F-OpenIMSDK(native call flutter)", "{ method:" + method + ", type:" + type + " }"); + Log.i("F-OpenIMSDK(native call flutter)", "thread: " + threadName + " { method:" + method + ", type:" + type + " }"); FlutterOpenimSdkPlugin.channel.invokeMethod(method, res); }); }