Commit e9606715 authored by aelias's avatar aelias Committed by Commit bot

Revert of Remember previous keyboard type and use that when switching to...

Revert of Remember previous keyboard type and use that when switching to "none" type. (patchset #2 id:20001 of https://codereview.chromium.org/1138103003/)

Reason for revert:
Patch landed despite rejection from code reviewers.

Original issue's description:
> Remember previous keyboard type and use that when switching to "none" type.
>
> BUG=484139
>
> Committed: https://crrev.com/e8e5d60be5f3b36634a1b012ec21874a4abe0ef0
> Cr-Commit-Position: refs/heads/master@{#330551}

TBR=aurimas@chromium.org,bcwhite@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=484139

Review URL: https://codereview.chromium.org/1148503003

Cr-Commit-Position: refs/heads/master@{#330625}
parent 7b579276
......@@ -100,7 +100,6 @@ public class ImeAdapter {
static char[] sSingleCharArray = new char[1];
static KeyCharacterMap sKeyCharacterMap;
private static EditorInfo sPreviousOutAttrs;
private long mNativeImeAdapterAndroid;
private InputMethodManagerWrapper mInputMethodManagerWrapper;
......@@ -134,20 +133,7 @@ public class ImeAdapter {
public static class AdapterInputConnectionFactory {
public AdapterInputConnection get(View view, ImeAdapter imeAdapter,
Editable editable, EditorInfo outAttrs) {
AdapterInputConnection conn = new AdapterInputConnection(
view, imeAdapter, editable, outAttrs);
// When switching between fields, the keyboard first reverts to a "none" type
// before changing to the type of the new field. This can cause the keyboard
// layout to flicker back to the default layout on older Android versions (<5.0).
// To avoid this, we remember the previous settings and return those instead.
// http://crbug.com/484139
if (imeAdapter.getTextInputType() == TextInputType.NONE && sPreviousOutAttrs != null) {
outAttrs.inputType = sPreviousOutAttrs.inputType;
outAttrs.imeOptions = sPreviousOutAttrs.imeOptions;
} else {
sPreviousOutAttrs = outAttrs;
}
return conn;
return new AdapterInputConnection(view, imeAdapter, editable, outAttrs);
}
}
......@@ -301,7 +287,6 @@ public class ImeAdapter {
unzoomIfNeeded ? mViewEmbedder.getNewShowKeyboardReceiver() : null);
}
mViewEmbedder.onDismissInput();
sPreviousOutAttrs = null;
}
private boolean hasInputType() {
......
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