am bab69d09: Merge "Remove redundant EditorInfo member from KeyboardLayoutSet.Builder"
* commit 'bab69d09f98030634ce2dd22c34a39154b437c24': Remove redundant EditorInfo member from KeyboardLayoutSet.Buildermain
commit
fffd71fcbb
|
@ -213,7 +213,6 @@ public final class KeyboardLayoutSet {
|
||||||
private final Context mContext;
|
private final Context mContext;
|
||||||
private final String mPackageName;
|
private final String mPackageName;
|
||||||
private final Resources mResources;
|
private final Resources mResources;
|
||||||
private final EditorInfo mEditorInfo;
|
|
||||||
|
|
||||||
private final Params mParams = new Params();
|
private final Params mParams = new Params();
|
||||||
|
|
||||||
|
@ -223,13 +222,12 @@ public final class KeyboardLayoutSet {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
mPackageName = context.getPackageName();
|
mPackageName = context.getPackageName();
|
||||||
mResources = context.getResources();
|
mResources = context.getResources();
|
||||||
mEditorInfo = editorInfo;
|
|
||||||
final Params params = mParams;
|
final Params params = mParams;
|
||||||
|
|
||||||
params.mMode = getKeyboardMode(editorInfo);
|
params.mMode = getKeyboardMode(editorInfo);
|
||||||
params.mEditorInfo = (editorInfo != null) ? editorInfo : EMPTY_EDITOR_INFO;
|
params.mEditorInfo = (editorInfo != null) ? editorInfo : EMPTY_EDITOR_INFO;
|
||||||
params.mNoSettingsKey = InputAttributes.inPrivateImeOptions(
|
params.mNoSettingsKey = InputAttributes.inPrivateImeOptions(
|
||||||
mPackageName, NO_SETTINGS_KEY, mEditorInfo);
|
mPackageName, NO_SETTINGS_KEY, params.mEditorInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder setKeyboardGeometry(final int keyboardWidth, final int keyboardHeight) {
|
public Builder setKeyboardGeometry(final int keyboardWidth, final int keyboardHeight) {
|
||||||
|
@ -242,7 +240,7 @@ public final class KeyboardLayoutSet {
|
||||||
final boolean asciiCapable = subtype.containsExtraValueKey(ASCII_CAPABLE);
|
final boolean asciiCapable = subtype.containsExtraValueKey(ASCII_CAPABLE);
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
final boolean deprecatedForceAscii = InputAttributes.inPrivateImeOptions(
|
final boolean deprecatedForceAscii = InputAttributes.inPrivateImeOptions(
|
||||||
mPackageName, FORCE_ASCII, mEditorInfo);
|
mPackageName, FORCE_ASCII, mParams.mEditorInfo);
|
||||||
final boolean forceAscii = EditorInfoCompatUtils.hasFlagForceAscii(
|
final boolean forceAscii = EditorInfoCompatUtils.hasFlagForceAscii(
|
||||||
mParams.mEditorInfo.imeOptions)
|
mParams.mEditorInfo.imeOptions)
|
||||||
|| deprecatedForceAscii;
|
|| deprecatedForceAscii;
|
||||||
|
@ -264,9 +262,9 @@ public final class KeyboardLayoutSet {
|
||||||
final boolean languageSwitchKeyEnabled) {
|
final boolean languageSwitchKeyEnabled) {
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
final boolean deprecatedNoMicrophone = InputAttributes.inPrivateImeOptions(
|
final boolean deprecatedNoMicrophone = InputAttributes.inPrivateImeOptions(
|
||||||
null, NO_MICROPHONE_COMPAT, mEditorInfo);
|
null, NO_MICROPHONE_COMPAT, mParams.mEditorInfo);
|
||||||
final boolean noMicrophone = InputAttributes.inPrivateImeOptions(
|
final boolean noMicrophone = InputAttributes.inPrivateImeOptions(
|
||||||
mPackageName, NO_MICROPHONE, mEditorInfo)
|
mPackageName, NO_MICROPHONE, mParams.mEditorInfo)
|
||||||
|| deprecatedNoMicrophone;
|
|| deprecatedNoMicrophone;
|
||||||
mParams.mVoiceKeyEnabled = voiceKeyEnabled && !noMicrophone;
|
mParams.mVoiceKeyEnabled = voiceKeyEnabled && !noMicrophone;
|
||||||
mParams.mVoiceKeyOnMain = voiceKeyOnMain;
|
mParams.mVoiceKeyOnMain = voiceKeyOnMain;
|
||||||
|
|
Loading…
Reference in New Issue