Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3ca65c8f authored by Tadashi G. Takaoka's avatar Tadashi G. Takaoka
Browse files

Remove unused supportsSwitchingToShortcutIme attribute

Change-Id: I51c5247ac925a158facb79057f704b763b903552
parent b7206b6b
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -437,7 +437,6 @@
        <attr name="navigatePrevious" format="boolean" />
        <attr name="passwordInput" format="boolean" />
        <attr name="clobberSettingsKey" format="boolean" />
        <attr name="supportsSwitchingToShortcutIme" format="boolean" />
        <attr name="hasShortcutKey" format="boolean" />
        <attr name="languageSwitchKeyEnabled" format="boolean" />
        <attr name="isMultiLine" format="boolean" />
+2 −7
Original line number Diff line number Diff line
@@ -70,7 +70,6 @@ public final class KeyboardId {
    public final int mElementId;
    public final EditorInfo mEditorInfo;
    public final boolean mClobberSettingsKey;
    public final boolean mSupportsSwitchingToShortcutIme;
    public final boolean mLanguageSwitchKeyEnabled;
    public final String mCustomActionLabel;
    public final boolean mHasShortcutKey;
@@ -86,11 +85,10 @@ public final class KeyboardId {
        mElementId = elementId;
        mEditorInfo = params.mEditorInfo;
        mClobberSettingsKey = params.mNoSettingsKey;
        mSupportsSwitchingToShortcutIme = params.mSupportsSwitchingToShortcutIme;
        mLanguageSwitchKeyEnabled = params.mLanguageSwitchKeyEnabled;
        mCustomActionLabel = (mEditorInfo.actionLabel != null)
                ? mEditorInfo.actionLabel.toString() : null;
        mHasShortcutKey = mSupportsSwitchingToShortcutIme && params.mShowsVoiceInputKey;
        mHasShortcutKey = params.mVoiceInputKeyEnabled;

        mHashCode = computeHashCode(this);
    }
@@ -103,7 +101,6 @@ public final class KeyboardId {
                id.mHeight,
                id.passwordInput(),
                id.mClobberSettingsKey,
                id.mSupportsSwitchingToShortcutIme,
                id.mHasShortcutKey,
                id.mLanguageSwitchKeyEnabled,
                id.isMultiLine(),
@@ -124,7 +121,6 @@ public final class KeyboardId {
                && other.mHeight == mHeight
                && other.passwordInput() == passwordInput()
                && other.mClobberSettingsKey == mClobberSettingsKey
                && other.mSupportsSwitchingToShortcutIme == mSupportsSwitchingToShortcutIme
                && other.mHasShortcutKey == mHasShortcutKey
                && other.mLanguageSwitchKeyEnabled == mLanguageSwitchKeyEnabled
                && other.isMultiLine() == isMultiLine()
@@ -179,7 +175,7 @@ public final class KeyboardId {

    @Override
    public String toString() {
        return String.format(Locale.ROOT, "[%s %s:%s %dx%d %s %s%s%s%s%s%s%s%s%s]",
        return String.format(Locale.ROOT, "[%s %s:%s %dx%d %s %s%s%s%s%s%s%s%s]",
                elementIdToName(mElementId),
                mLocale, mSubtype.getExtraValueOf(KEYBOARD_LAYOUT_SET),
                mWidth, mHeight,
@@ -189,7 +185,6 @@ public final class KeyboardId {
                (navigatePrevious() ? " navigatePrevious" : ""),
                (mClobberSettingsKey ? " clobberSettingsKey" : ""),
                (passwordInput() ? " passwordInput" : ""),
                (mSupportsSwitchingToShortcutIme ? " supportsSwitchingToShortcutIme" : ""),
                (mHasShortcutKey ? " hasShortcutKey" : ""),
                (mLanguageSwitchKeyEnabled ? " languageSwitchKeyEnabled" : ""),
                (isMultiLine() ? " isMultiLine" : "")
+12 −18
Original line number Diff line number Diff line
@@ -17,8 +17,6 @@
package com.android.inputmethod.keyboard;

import static com.android.inputmethod.latin.Constants.ImeOption.FORCE_ASCII;
import static com.android.inputmethod.latin.Constants.ImeOption.NO_MICROPHONE;
import static com.android.inputmethod.latin.Constants.ImeOption.NO_MICROPHONE_COMPAT;
import static com.android.inputmethod.latin.Constants.ImeOption.NO_SETTINGS_KEY;

import android.content.Context;
@@ -102,12 +100,11 @@ public final class KeyboardLayoutSet {
    public static final class Params {
        String mKeyboardLayoutSetName;
        int mMode;
        EditorInfo mEditorInfo;
        boolean mDisableTouchPositionCorrectionDataForTest;
        // TODO: Use {@link InputAttributes} instead of these variables.
        EditorInfo mEditorInfo;
        boolean mIsPasswordField;
        boolean mSupportsSwitchingToShortcutIme;
        boolean mShowsVoiceInputKey;
        boolean mNoMicrophoneKey;
        boolean mVoiceInputKeyEnabled;
        boolean mNoSettingsKey;
        boolean mLanguageSwitchKeyEnabled;
        InputMethodSubtype mSubtype;
@@ -228,14 +225,9 @@ public final class KeyboardLayoutSet {

            final EditorInfo editorInfo = (ei != null) ? ei : EMPTY_EDITOR_INFO;
            params.mMode = getKeyboardMode(editorInfo);
            // TODO: Consolidate those with {@link InputAttributes}.
            params.mEditorInfo = editorInfo;
            params.mIsPasswordField = InputTypeUtils.isPasswordInputType(editorInfo.inputType);
            @SuppressWarnings("deprecation")
            final boolean deprecatedNoMicrophone = InputAttributes.inPrivateImeOptions(
                    null, NO_MICROPHONE_COMPAT, editorInfo);
            params.mNoMicrophoneKey = InputAttributes.inPrivateImeOptions(
                    mPackageName, NO_MICROPHONE, editorInfo)
                    || deprecatedNoMicrophone;
            params.mNoSettingsKey = InputAttributes.inPrivateImeOptions(
                    mPackageName, NO_SETTINGS_KEY, editorInfo);
        }
@@ -248,6 +240,7 @@ public final class KeyboardLayoutSet {

        public Builder setSubtype(final InputMethodSubtype subtype) {
            final boolean asciiCapable = InputMethodSubtypeCompatUtils.isAsciiCapable(subtype);
            // TODO: Consolidate with {@link InputAttributes}.
            @SuppressWarnings("deprecation")
            final boolean deprecatedForceAscii = InputAttributes.inPrivateImeOptions(
                    mPackageName, FORCE_ASCII, mParams.mEditorInfo);
@@ -268,12 +261,13 @@ public final class KeyboardLayoutSet {
            return this;
        }

        public Builder setOptions(final boolean isShortcutImeEnabled,
                final boolean showsVoiceInputKey, final boolean languageSwitchKeyEnabled) {
            mParams.mSupportsSwitchingToShortcutIme =
                    isShortcutImeEnabled && !mParams.mNoMicrophoneKey && !mParams.mIsPasswordField;
            mParams.mShowsVoiceInputKey = showsVoiceInputKey;
            mParams.mLanguageSwitchKeyEnabled = languageSwitchKeyEnabled;
        public Builder setVoiceInputKeyEnabled(final boolean enabled) {
            mParams.mVoiceInputKeyEnabled = enabled;
            return this;
        }

        public Builder setLanguageSwitchKeyEnabled(final boolean enabled) {
            mParams.mLanguageSwitchKeyEnabled = enabled;
            return this;
        }

+4 −4
Original line number Diff line number Diff line
@@ -115,10 +115,10 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions {
        final int keyboardHeight = ResourceUtils.getDefaultKeyboardHeight(res);
        builder.setKeyboardGeometry(keyboardWidth, keyboardHeight);
        builder.setSubtype(mSubtypeSwitcher.getCurrentSubtype());
        builder.setOptions(
                mSubtypeSwitcher.isShortcutImeEnabled(),
                settingsValues.mShowsVoiceInputKey,
                mLatinIME.shouldShowLanguageSwitchKey());
        builder.setVoiceInputKeyEnabled(mSubtypeSwitcher.isShortcutImeEnabled()
                && settingsValues.mShowsVoiceInputKey
                && !settingsValues.mInputAttributes.hasNoMicrophoneKeyOption());
        builder.setLanguageSwitchKeyEnabled(mLatinIME.shouldShowLanguageSwitchKey());
        mKeyboardLayoutSet = builder.build();
        mCurrentSettingsValues = settingsValues;
        try {
+0 −2
Original line number Diff line number Diff line
@@ -115,8 +115,6 @@ public final class EmojiPalettesView extends LinearLayout implements OnTabChange
        builder.setSubtype(SubtypeSwitcher.getInstance().getEmojiSubtype());
        builder.setKeyboardGeometry(ResourceUtils.getDefaultKeyboardWidth(res),
                mEmojiLayoutParams.mEmojiKeyboardHeight);
        builder.setOptions(false /* shortcutImeEnabled */, false /* showsVoiceInputKey */,
                false /* languageSwitchKeyEnabled */);
        final KeyboardLayoutSet layoutSet = builder.build();
        final TypedArray emojiPalettesViewAttr = context.obtainStyledAttributes(attrs,
                R.styleable.EmojiPalettesView, defStyle, R.style.EmojiPalettesView);
Loading