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
}
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());
}
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);
}
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);
}
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;
}
Aggregations