Commit f70d2f25 authored by Changwan Ryu's avatar Changwan Ryu Committed by Commit Bot

Fix for a crash in HTC mail

For some reason, InputConnection#beginBatchEdit() is called on UI thread,
only after
https://chromium-review.googlesource.com/c/chromium/src/+/894499
has landed. One theory is that HTC mail has been doing this the entire
time, but beginBatchEdit() and some other methods were being ignored at
the beginning while delayed onCreateInputConnection was running.

Since this is observed only on HTC mail, let me land a temporary fix
for HTC mail for now, and investigate this further as necessary.

TBR: tedchoc@chromium.org
Bug: 820756
Change-Id: Ib33dfa57372b0d914ccc294d91a9e00899366c1b
Reviewed-on: https://chromium-review.googlesource.com/961276Reviewed-by: default avatarChangwan Ryu <changwan@chromium.org>
Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
Commit-Queue: Changwan Ryu <changwan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#542926}
parent f2750048
...@@ -122,7 +122,10 @@ public class ThreadedInputConnectionFactory implements ChromiumBaseInputConnecti ...@@ -122,7 +122,10 @@ public class ThreadedInputConnectionFactory implements ChromiumBaseInputConnecti
Log.i(TAG, "initializeAndGet. outAttr: " + ImeUtils.getEditorInfoDebugString(outAttrs)); Log.i(TAG, "initializeAndGet. outAttr: " + ImeUtils.getEditorInfoDebugString(outAttrs));
} }
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) { // https://crbug.com/820756
final String htcMailPackageId = "com.htc.android.mail";
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N
|| htcMailPackageId.equals(view.getContext().getPackageName())) {
// IMM can internally ignore subsequent activation requests, e.g., by checking // IMM can internally ignore subsequent activation requests, e.g., by checking
// mServedConnecting. // mServedConnecting.
if (mCheckInvalidator != null) mCheckInvalidator.invalidate(); if (mCheckInvalidator != null) mCheckInvalidator.invalidate();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment