Search in sources :

Example 6 with SettingsValues

use of com.android.inputmethod.latin.settings.SettingsValues in project android_packages_inputmethods_LatinIME by CyanogenMod.

the class LatinIME method dump.

@Override
protected void dump(final FileDescriptor fd, final PrintWriter fout, final String[] args) {
    super.dump(fd, fout, args);
    final Printer p = new PrintWriterPrinter(fout);
    p.println("LatinIME state :");
    p.println("  VersionCode = " + ApplicationUtils.getVersionCode(this));
    p.println("  VersionName = " + ApplicationUtils.getVersionName(this));
    final Keyboard keyboard = mKeyboardSwitcher.getKeyboard();
    final int keyboardMode = keyboard != null ? keyboard.mId.mMode : -1;
    p.println("  Keyboard mode = " + keyboardMode);
    final SettingsValues settingsValues = mSettings.getCurrent();
    p.println(settingsValues.dump());
    p.println(mDictionaryFacilitator.dump(this));
// TODO: Dump all settings values
}
Also used : PrintWriterPrinter(android.util.PrintWriterPrinter) SettingsValues(com.android.inputmethod.latin.settings.SettingsValues) Keyboard(com.android.inputmethod.keyboard.Keyboard) PrintWriterPrinter(android.util.PrintWriterPrinter) Printer(android.util.Printer)

Example 7 with SettingsValues

use of com.android.inputmethod.latin.settings.SettingsValues in project android_packages_inputmethods_LatinIME by CyanogenMod.

the class LatinIME method debugDumpStateAndCrashWithException.

public void debugDumpStateAndCrashWithException(final String context) {
    final SettingsValues settingsValues = mSettings.getCurrent();
    final StringBuilder s = new StringBuilder(settingsValues.toString());
    s.append("\nAttributes : ").append(settingsValues.mInputAttributes).append("\nContext : ").append(context);
    throw new RuntimeException(s.toString());
}
Also used : SettingsValues(com.android.inputmethod.latin.settings.SettingsValues)

Example 8 with SettingsValues

use of com.android.inputmethod.latin.settings.SettingsValues in project android_packages_inputmethods_LatinIME by CyanogenMod.

the class LatinIME method resetSuggestMainDict.

/**
 * Reset suggest by loading the main dictionary of the current locale.
 */
/* package private */
void resetSuggestMainDict() {
    final SettingsValues settingsValues = mSettings.getCurrent();
    mDictionaryFacilitator.resetDictionaries(this, /* context */
    mDictionaryFacilitator.getLocale(), settingsValues.mUseContactsDict, settingsValues.mUsePersonalizedDicts, true, /* forceReloadMainDictionary */
    settingsValues.mAccount, "", /* dictNamePrefix */
    this);
}
Also used : SettingsValues(com.android.inputmethod.latin.settings.SettingsValues)

Example 9 with SettingsValues

use of com.android.inputmethod.latin.settings.SettingsValues in project android_packages_inputmethods_LatinIME by CyanogenMod.

the class LatinIME method loadSettings.

// Has to be package-visible for unit tests
@UsedForTesting
void loadSettings() {
    final Locale locale = mRichImm.getCurrentSubtypeLocale();
    final EditorInfo editorInfo = getCurrentInputEditorInfo();
    final InputAttributes inputAttributes = new InputAttributes(editorInfo, isFullscreenMode(), getPackageName());
    mSettings.loadSettings(this, locale, inputAttributes);
    final SettingsValues currentSettingsValues = mSettings.getCurrent();
    AudioAndHapticFeedbackManager.getInstance().onSettingsChanged(currentSettingsValues);
    // asynchronously loaded.
    if (!mHandler.hasPendingReopenDictionaries()) {
        resetDictionaryFacilitator(locale);
    }
    refreshPersonalizationDictionarySession(currentSettingsValues);
    resetDictionaryFacilitatorIfNecessary();
    mStatsUtilsManager.onLoadSettings(this, /* context */
    currentSettingsValues);
}
Also used : Locale(java.util.Locale) EditorInfo(android.view.inputmethod.EditorInfo) SettingsValues(com.android.inputmethod.latin.settings.SettingsValues) UsedForTesting(com.android.inputmethod.annotations.UsedForTesting)

Example 10 with SettingsValues

use of com.android.inputmethod.latin.settings.SettingsValues in project android_packages_inputmethods_LatinIME by CyanogenMod.

the class KeyboardAccessibilityNodeProvider method getKeyDescription.

/**
 * Returns the context-specific description for a {@link Key}.
 *
 * @param key The key to describe.
 * @return The context-specific description of the key.
 */
private String getKeyDescription(final Key key) {
    final EditorInfo editorInfo = mKeyboard.mId.mEditorInfo;
    final boolean shouldObscure = mAccessibilityUtils.shouldObscureInput(editorInfo);
    final SettingsValues currentSettings = Settings.getInstance().getCurrent();
    final String keyCodeDescription = mKeyCodeDescriptionMapper.getDescriptionForKey(mKeyboardView.getContext(), mKeyboard, key, shouldObscure);
    if (currentSettings.isWordSeparator(key.getCode())) {
        return mAccessibilityUtils.getAutoCorrectionDescription(keyCodeDescription, shouldObscure);
    }
    return keyCodeDescription;
}
Also used : EditorInfo(android.view.inputmethod.EditorInfo) SettingsValues(com.android.inputmethod.latin.settings.SettingsValues)

Aggregations

SettingsValues (com.android.inputmethod.latin.settings.SettingsValues)19 EditorInfo (android.view.inputmethod.EditorInfo)3 UsedForTesting (com.android.inputmethod.annotations.UsedForTesting)2 MainKeyboardView (com.android.inputmethod.keyboard.MainKeyboardView)2 SpannableString (android.text.SpannableString)1 PrintWriterPrinter (android.util.PrintWriterPrinter)1 Printer (android.util.Printer)1 View (android.view.View)1 AccessibilityUtils (com.android.inputmethod.accessibility.AccessibilityUtils)1 Keyboard (com.android.inputmethod.keyboard.Keyboard)1 KeyboardSwitcher (com.android.inputmethod.keyboard.KeyboardSwitcher)1 SuggestionStripView (com.android.inputmethod.latin.suggestions.SuggestionStripView)1 Locale (java.util.Locale)1