Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sxychenjing
engine
提交
39593738
E
engine
项目概览
sxychenjing
/
engine
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
engine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
39593738
编写于
1月 14, 2019
作者:
J
Jason Simmons
提交者:
GitHub
1月 14, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Log errors returned from method channel invocations in the text input plugin (#7476)
See
https://github.com/flutter/flutter/issues/25715
上级
9004af13
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
55 addition
and
9 deletion
+55
-9
ci/licenses_golden/licenses_flutter
ci/licenses_golden/licenses_flutter
+1
-0
shell/platform/android/BUILD.gn
shell/platform/android/BUILD.gn
+1
-0
shell/platform/android/io/flutter/plugin/common/ErrorLogResult.java
...form/android/io/flutter/plugin/common/ErrorLogResult.java
+40
-0
shell/platform/android/io/flutter/plugin/editing/InputConnectionAdaptor.java
...oid/io/flutter/plugin/editing/InputConnectionAdaptor.java
+13
-9
未找到文件。
ci/licenses_golden/licenses_flutter
浏览文件 @
39593738
...
...
@@ -424,6 +424,7 @@ FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/common/ActivityL
FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/common/BasicMessageChannel.java
FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/common/BinaryCodec.java
FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/common/BinaryMessenger.java
FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/common/ErrorLogResult.java
FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/common/EventChannel.java
FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/common/FlutterException.java
FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/common/JSONMessageCodec.java
...
...
shell/platform/android/BUILD.gn
浏览文件 @
39593738
...
...
@@ -111,6 +111,7 @@ java_library("flutter_shell_java") {
"io/flutter/plugin/common/BasicMessageChannel.java",
"io/flutter/plugin/common/BinaryCodec.java",
"io/flutter/plugin/common/BinaryMessenger.java",
"io/flutter/plugin/common/ErrorLogResult.java",
"io/flutter/plugin/common/EventChannel.java",
"io/flutter/plugin/common/FlutterException.java",
"io/flutter/plugin/common/JSONMessageCodec.java",
...
...
shell/platform/android/io/flutter/plugin/common/ErrorLogResult.java
0 → 100644
浏览文件 @
39593738
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package
io.flutter.plugin.common
;
import
android.support.annotation.Nullable
;
import
android.util.Log
;
/**
* An implementation of {@link MethodChannel.Result} that writes error results
* to the Android log.
*/
public
class
ErrorLogResult
implements
MethodChannel
.
Result
{
private
String
tag
;
private
int
level
;
public
ErrorLogResult
(
String
tag
)
{
this
(
tag
,
Log
.
WARN
);
}
public
ErrorLogResult
(
String
tag
,
int
level
)
{
this
.
tag
=
tag
;
this
.
level
=
level
;
}
@Override
public
void
success
(
@Nullable
Object
result
)
{}
@Override
public
void
error
(
String
errorCode
,
@Nullable
String
errorMessage
,
@Nullable
Object
errorDetails
)
{
String
details
=
(
errorDetails
!=
null
)
?
" details: "
+
errorDetails
:
""
;
Log
.
println
(
level
,
tag
,
errorMessage
+
details
);
}
@Override
public
void
notImplemented
()
{
Log
.
println
(
level
,
tag
,
"method not implemented"
);
}
}
shell/platform/android/io/flutter/plugin/editing/InputConnectionAdaptor.java
浏览文件 @
39593738
...
...
@@ -11,6 +11,7 @@ import android.view.KeyEvent;
import
android.view.inputmethod.BaseInputConnection
;
import
android.view.inputmethod.EditorInfo
;
import
android.view.inputmethod.InputMethodManager
;
import
io.flutter.plugin.common.ErrorLogResult
;
import
io.flutter.plugin.common.MethodChannel
;
import
io.flutter.view.FlutterView
;
...
...
@@ -25,6 +26,9 @@ class InputConnectionAdaptor extends BaseInputConnection {
private
int
mBatchCount
;
private
InputMethodManager
mImm
;
private
static
final
MethodChannel
.
Result
logger
=
new
ErrorLogResult
(
"FlutterTextInput"
);
public
InputConnectionAdaptor
(
FlutterView
view
,
int
client
,
MethodChannel
flutterChannel
,
Editable
editable
)
{
super
(
view
,
true
);
...
...
@@ -58,7 +62,7 @@ class InputConnectionAdaptor extends BaseInputConnection {
state
.
put
(
"composingBase"
,
composingStart
);
state
.
put
(
"composingExtent"
,
composingEnd
);
mFlutterChannel
.
invokeMethod
(
"TextInputClient.updateEditingState"
,
Arrays
.
asList
(
mClient
,
state
));
Arrays
.
asList
(
mClient
,
state
)
,
logger
);
}
@Override
...
...
@@ -177,36 +181,36 @@ class InputConnectionAdaptor extends BaseInputConnection {
// TODO(mattcarroll): is newline an appropriate action for "none"?
case
EditorInfo
.
IME_ACTION_NONE
:
mFlutterChannel
.
invokeMethod
(
"TextInputClient.performAction"
,
Arrays
.
asList
(
mClient
,
"TextInputAction.newline"
)
);
Arrays
.
asList
(
mClient
,
"TextInputAction.newline"
),
logger
);
break
;
case
EditorInfo
.
IME_ACTION_UNSPECIFIED
:
mFlutterChannel
.
invokeMethod
(
"TextInputClient.performAction"
,
Arrays
.
asList
(
mClient
,
"TextInputAction.unspecified"
));
Arrays
.
asList
(
mClient
,
"TextInputAction.unspecified"
)
,
logger
);
break
;
case
EditorInfo
.
IME_ACTION_GO
:
mFlutterChannel
.
invokeMethod
(
"TextInputClient.performAction"
,
Arrays
.
asList
(
mClient
,
"TextInputAction.go"
));
Arrays
.
asList
(
mClient
,
"TextInputAction.go"
)
,
logger
);
break
;
case
EditorInfo
.
IME_ACTION_SEARCH
:
mFlutterChannel
.
invokeMethod
(
"TextInputClient.performAction"
,
Arrays
.
asList
(
mClient
,
"TextInputAction.search"
));
Arrays
.
asList
(
mClient
,
"TextInputAction.search"
)
,
logger
);
break
;
case
EditorInfo
.
IME_ACTION_SEND
:
mFlutterChannel
.
invokeMethod
(
"TextInputClient.performAction"
,
Arrays
.
asList
(
mClient
,
"TextInputAction.send"
));
Arrays
.
asList
(
mClient
,
"TextInputAction.send"
)
,
logger
);
break
;
case
EditorInfo
.
IME_ACTION_NEXT
:
mFlutterChannel
.
invokeMethod
(
"TextInputClient.performAction"
,
Arrays
.
asList
(
mClient
,
"TextInputAction.next"
));
Arrays
.
asList
(
mClient
,
"TextInputAction.next"
)
,
logger
);
break
;
case
EditorInfo
.
IME_ACTION_PREVIOUS
:
mFlutterChannel
.
invokeMethod
(
"TextInputClient.performAction"
,
Arrays
.
asList
(
mClient
,
"TextInputAction.previous"
));
Arrays
.
asList
(
mClient
,
"TextInputAction.previous"
)
,
logger
);
break
;
default
:
case
EditorInfo
.
IME_ACTION_DONE
:
mFlutterChannel
.
invokeMethod
(
"TextInputClient.performAction"
,
Arrays
.
asList
(
mClient
,
"TextInputAction.done"
));
Arrays
.
asList
(
mClient
,
"TextInputAction.done"
)
,
logger
);
break
;
}
return
true
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录