mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-05-16 15:02:48 +00:00
deal with some warnings, remove unused code, formatting
This commit is contained in:
parent
30201f91ba
commit
3da9f67940
2 changed files with 37 additions and 78 deletions
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
package org.dslul.openboard.inputmethod.keyboard;
|
package org.dslul.openboard.inputmethod.keyboard;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
|
@ -63,6 +64,7 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions {
|
||||||
private Context mThemeContext;
|
private Context mThemeContext;
|
||||||
private int mCurrentUiMode;
|
private int mCurrentUiMode;
|
||||||
|
|
||||||
|
@SuppressLint("StaticFieldLeak") // this is a keyboard, we want to keep it alive in background
|
||||||
private static final KeyboardSwitcher sInstance = new KeyboardSwitcher();
|
private static final KeyboardSwitcher sInstance = new KeyboardSwitcher();
|
||||||
|
|
||||||
public static KeyboardSwitcher getInstance() {
|
public static KeyboardSwitcher getInstance() {
|
||||||
|
@ -103,7 +105,6 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions {
|
||||||
final KeyboardTheme keyboardTheme) {
|
final KeyboardTheme keyboardTheme) {
|
||||||
final boolean nightModeChanged = (mCurrentUiMode & Configuration.UI_MODE_NIGHT_MASK)
|
final boolean nightModeChanged = (mCurrentUiMode & Configuration.UI_MODE_NIGHT_MASK)
|
||||||
!= (context.getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK);
|
!= (context.getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK);
|
||||||
Log.d(TAG, "old ui mode "+ mCurrentUiMode+", new ui mode "+context.getResources().getConfiguration().uiMode);
|
|
||||||
if (mThemeContext == null || !keyboardTheme.equals(mKeyboardTheme) || nightModeChanged
|
if (mThemeContext == null || !keyboardTheme.equals(mKeyboardTheme) || nightModeChanged
|
||||||
|| !mThemeContext.getResources().equals(context.getResources())
|
|| !mThemeContext.getResources().equals(context.getResources())
|
||||||
|| Settings.getInstance().getCurrent().mColors.haveColorsChanged(context)) {
|
|| Settings.getInstance().getCurrent().mColors.haveColorsChanged(context)) {
|
||||||
|
@ -152,9 +153,7 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setKeyboard(
|
private void setKeyboard(final int keyboardId, @NonNull final KeyboardSwitchState toggleState) {
|
||||||
@NonNull final int keyboardId,
|
|
||||||
@NonNull final KeyboardSwitchState toggleState) {
|
|
||||||
// Make {@link MainKeyboardView} visible and hide {@link EmojiPalettesView}.
|
// Make {@link MainKeyboardView} visible and hide {@link EmojiPalettesView}.
|
||||||
final SettingsValues currentSettingsValues = Settings.getInstance().getCurrent();
|
final SettingsValues currentSettingsValues = Settings.getInstance().getCurrent();
|
||||||
setMainKeyboardFrame(currentSettingsValues, toggleState);
|
setMainKeyboardFrame(currentSettingsValues, toggleState);
|
||||||
|
@ -166,14 +165,10 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions {
|
||||||
mCurrentInputView.setKeyboardTopPadding(newKeyboard.mTopPadding);
|
mCurrentInputView.setKeyboardTopPadding(newKeyboard.mTopPadding);
|
||||||
keyboardView.setKeyPreviewPopupEnabled(currentSettingsValues.mKeyPreviewPopupOn);
|
keyboardView.setKeyPreviewPopupEnabled(currentSettingsValues.mKeyPreviewPopupOn);
|
||||||
keyboardView.updateShortcutKey(mRichImm.isShortcutImeReady());
|
keyboardView.updateShortcutKey(mRichImm.isShortcutImeReady());
|
||||||
final boolean subtypeChanged = (oldKeyboard == null)
|
final boolean subtypeChanged = (oldKeyboard == null) || !newKeyboard.mId.mSubtype.equals(oldKeyboard.mId.mSubtype);
|
||||||
|| !newKeyboard.mId.mSubtype.equals(oldKeyboard.mId.mSubtype);
|
final int languageOnSpacebarFormatType = LanguageOnSpacebarUtils.getLanguageOnSpacebarFormatType(newKeyboard.mId.mSubtype);
|
||||||
final int languageOnSpacebarFormatType = LanguageOnSpacebarUtils
|
final boolean hasMultipleEnabledIMEsOrSubtypes = mRichImm.hasMultipleEnabledIMEsOrSubtypes(true);
|
||||||
.getLanguageOnSpacebarFormatType(newKeyboard.mId.mSubtype);
|
keyboardView.startDisplayLanguageOnSpacebar(subtypeChanged, languageOnSpacebarFormatType, hasMultipleEnabledIMEsOrSubtypes);
|
||||||
final boolean hasMultipleEnabledIMEsOrSubtypes = mRichImm
|
|
||||||
.hasMultipleEnabledIMEsOrSubtypes(true /* shouldIncludeAuxiliarySubtypes */);
|
|
||||||
keyboardView.startDisplayLanguageOnSpacebar(subtypeChanged, languageOnSpacebarFormatType,
|
|
||||||
hasMultipleEnabledIMEsOrSubtypes);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Keyboard getKeyboard() {
|
public Keyboard getKeyboard() {
|
||||||
|
|
|
@ -18,7 +18,6 @@ import android.media.AudioManager;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Debug;
|
import android.os.Debug;
|
||||||
import android.os.Handler;
|
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
import android.os.Process;
|
import android.os.Process;
|
||||||
|
@ -123,14 +122,12 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
/**
|
/**
|
||||||
* A broadcast intent action to hide the software keyboard.
|
* A broadcast intent action to hide the software keyboard.
|
||||||
*/
|
*/
|
||||||
static final String ACTION_HIDE_SOFT_INPUT =
|
static final String ACTION_HIDE_SOFT_INPUT = "org.dslul.openboard.inputmethod.latin.HIDE_SOFT_INPUT";
|
||||||
"org.dslul.openboard.inputmethod.latin.HIDE_SOFT_INPUT";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A custom permission for external apps to send {@link #ACTION_HIDE_SOFT_INPUT}.
|
* A custom permission for external apps to send {@link #ACTION_HIDE_SOFT_INPUT}.
|
||||||
*/
|
*/
|
||||||
static final String PERMISSION_HIDE_SOFT_INPUT =
|
static final String PERMISSION_HIDE_SOFT_INPUT = "org.dslul.openboard.inputmethod.latin.HIDE_SOFT_INPUT";
|
||||||
"org.dslul.openboard.inputmethod.latin.HIDE_SOFT_INPUT";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The name of the scheme used by the Package Manager to warn of a new package installation,
|
* The name of the scheme used by the Package Manager to warn of a new package installation,
|
||||||
|
@ -142,10 +139,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
private int mOriginalNavBarColor = 0;
|
private int mOriginalNavBarColor = 0;
|
||||||
private int mOriginalNavBarFlags = 0;
|
private int mOriginalNavBarFlags = 0;
|
||||||
private final DictionaryFacilitator mDictionaryFacilitator =
|
private final DictionaryFacilitator mDictionaryFacilitator =
|
||||||
DictionaryFacilitatorProvider.getDictionaryFacilitator(
|
DictionaryFacilitatorProvider.getDictionaryFacilitator(false);
|
||||||
false /* isNeededForSpellChecking */);
|
final InputLogic mInputLogic = new InputLogic(this, this, mDictionaryFacilitator);
|
||||||
final InputLogic mInputLogic = new InputLogic(this /* LatinIME */,
|
|
||||||
this /* SuggestionStripViewAccessor */, mDictionaryFacilitator);
|
|
||||||
// We expect to have only one decoder in almost all cases, hence the default capacity of 1.
|
// We expect to have only one decoder in almost all cases, hence the default capacity of 1.
|
||||||
// If it turns out we need several, it will get grown seamlessly.
|
// If it turns out we need several, it will get grown seamlessly.
|
||||||
final SparseArray<HardwareEventDecoder> mHardwareEventDecoders = new SparseArray<>(1);
|
final SparseArray<HardwareEventDecoder> mHardwareEventDecoders = new SparseArray<>(1);
|
||||||
|
@ -264,7 +259,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handleMessage(final Message msg) {
|
public void handleMessage(@NonNull final Message msg) {
|
||||||
final LatinIME latinIme = getOwnerInstance();
|
final LatinIME latinIme = getOwnerInstance();
|
||||||
if (latinIme == null) {
|
if (latinIme == null) {
|
||||||
return;
|
return;
|
||||||
|
@ -645,7 +640,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
null /* scheduler */, ContextCompat.RECEIVER_EXPORTED);
|
null /* scheduler */, ContextCompat.RECEIVER_EXPORTED);
|
||||||
|
|
||||||
final IntentFilter restartAfterUnlockFilter = new IntentFilter();
|
final IntentFilter restartAfterUnlockFilter = new IntentFilter();
|
||||||
restartAfterUnlockFilter.addAction(Intent.ACTION_USER_UNLOCKED);
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
||||||
|
restartAfterUnlockFilter.addAction(Intent.ACTION_USER_UNLOCKED);
|
||||||
registerReceiver(mRestartAfterDeviceUnlockReceiver, restartAfterUnlockFilter);
|
registerReceiver(mRestartAfterDeviceUnlockReceiver, restartAfterUnlockFilter);
|
||||||
|
|
||||||
StatsUtils.onCreate(mSettings.getCurrent(), mRichImm);
|
StatsUtils.onCreate(mSettings.getCurrent(), mRichImm);
|
||||||
|
@ -726,11 +722,9 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
// TODO: make sure the current settings always have the right locales, and read from them.
|
// TODO: make sure the current settings always have the right locales, and read from them.
|
||||||
private void resetDictionaryFacilitator(@NonNull final Locale locale) {
|
private void resetDictionaryFacilitator(@NonNull final Locale locale) {
|
||||||
final SettingsValues settingsValues = mSettings.getCurrent();
|
final SettingsValues settingsValues = mSettings.getCurrent();
|
||||||
mDictionaryFacilitator.resetDictionaries(this /* context */, locale,
|
mDictionaryFacilitator.resetDictionaries(this, locale,
|
||||||
settingsValues.mUseContactsDictionary, settingsValues.mUsePersonalizedDicts,
|
settingsValues.mUseContactsDictionary, settingsValues.mUsePersonalizedDicts,
|
||||||
false /* forceReloadMainDictionary */,
|
false, settingsValues.mAccount, "", this);
|
||||||
settingsValues.mAccount, "" /* dictNamePrefix */,
|
|
||||||
this /* DictionaryInitializationListener */);
|
|
||||||
if (settingsValues.mAutoCorrectionEnabledPerUserSettings) {
|
if (settingsValues.mAutoCorrectionEnabledPerUserSettings) {
|
||||||
mInputLogic.mSuggest.setAutoCorrectionThreshold(settingsValues.mAutoCorrectionThreshold);
|
mInputLogic.mSuggest.setAutoCorrectionThreshold(settingsValues.mAutoCorrectionThreshold);
|
||||||
}
|
}
|
||||||
|
@ -821,14 +815,14 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the context object whose resources are adjusted to match the metrics of the display.
|
* Returns the context object whose resources are adjusted to match the metrics of the display.
|
||||||
*
|
* <p>
|
||||||
* Note that before {@link android.os.Build.VERSION_CODES#KITKAT}, there is no way to support
|
* Note that before {@link android.os.Build.VERSION_CODES#KITKAT}, there is no way to support
|
||||||
* multi-display scenarios, so the context object will just return the IME context itself.
|
* multi-display scenarios, so the context object will just return the IME context itself.
|
||||||
*
|
* <p>
|
||||||
* With initiating multi-display APIs from {@link android.os.Build.VERSION_CODES#KITKAT}, the
|
* With initiating multi-display APIs from {@link android.os.Build.VERSION_CODES#KITKAT}, the
|
||||||
* context object has to return with re-creating the display context according the metrics
|
* context object has to return with re-creating the display context according the metrics
|
||||||
* of the display in runtime.
|
* of the display in runtime.
|
||||||
*
|
* <p>
|
||||||
* Starts from {@link android.os.Build.VERSION_CODES#S_V2}, the returning context object has
|
* Starts from {@link android.os.Build.VERSION_CODES#S_V2}, the returning context object has
|
||||||
* became to IME context self since it ends up capable of updating its resources internally.
|
* became to IME context self since it ends up capable of updating its resources internally.
|
||||||
*/
|
*/
|
||||||
|
@ -1382,6 +1376,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
// See {@link InputMethodService#setinputView(View)} and
|
// See {@link InputMethodService#setinputView(View)} and
|
||||||
// {@link SoftInputWindow#updateWidthHeight(WindowManager.LayoutParams)}.
|
// {@link SoftInputWindow#updateWidthHeight(WindowManager.LayoutParams)}.
|
||||||
final Window window = getWindow().getWindow();
|
final Window window = getWindow().getWindow();
|
||||||
|
if (window == null) return;
|
||||||
ViewLayoutUtils.updateLayoutHeightOf(window, LayoutParams.MATCH_PARENT);
|
ViewLayoutUtils.updateLayoutHeightOf(window, LayoutParams.MATCH_PARENT);
|
||||||
// This method may be called before {@link #setInputView(View)}.
|
// This method may be called before {@link #setInputView(View)}.
|
||||||
if (mInputView != null) {
|
if (mInputView != null) {
|
||||||
|
@ -1546,10 +1541,13 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
mSubtypeState.switchSubtype(mRichImm);
|
mSubtypeState.switchSubtype(mRichImm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
private boolean switchInputMethod() {
|
private boolean switchInputMethod() {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P)
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P)
|
||||||
return switchToNextInputMethod(false);
|
return switchToNextInputMethod(false);
|
||||||
final IBinder token = getWindow().getWindow().getAttributes().token;
|
final Window window = getWindow().getWindow();
|
||||||
|
if (window == null) return false;
|
||||||
|
final IBinder token = window.getAttributes().token;
|
||||||
return mRichImm.getInputMethodManager().switchToNextInputMethod(token, false);
|
return mRichImm.getInputMethodManager().switchToNextInputMethod(token, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1557,7 +1555,10 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
public boolean shouldSwitchToOtherInputMethods() {
|
public boolean shouldSwitchToOtherInputMethods() {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P)
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P)
|
||||||
return shouldOfferSwitchingToNextInputMethod();
|
return shouldOfferSwitchingToNextInputMethod();
|
||||||
final IBinder token = getWindow().getWindow().getAttributes().token;
|
final Window window = getWindow().getWindow();
|
||||||
|
if (window == null)
|
||||||
|
return mSettings.getCurrent().mLanguageSwitchKeyToOtherImes;
|
||||||
|
final IBinder token = window.getAttributes().token;
|
||||||
if (token == null) {
|
if (token == null) {
|
||||||
return mSettings.getCurrent().mLanguageSwitchKeyToOtherImes;
|
return mSettings.getCurrent().mLanguageSwitchKeyToOtherImes;
|
||||||
}
|
}
|
||||||
|
@ -1568,7 +1569,9 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||||
switchInputMethod(imi.getId(), subtype);
|
switchInputMethod(imi.getId(), subtype);
|
||||||
} else {
|
} else {
|
||||||
final IBinder token = getWindow().getWindow().getAttributes().token;
|
final Window window = getWindow().getWindow();
|
||||||
|
if (window == null) return;
|
||||||
|
final IBinder token = window.getAttributes().token;
|
||||||
mRichImm.getInputMethodManager().setInputMethodAndSubtype(token, imi.getId(), subtype);
|
mRichImm.getInputMethodManager().setInputMethodAndSubtype(token, imi.getId(), subtype);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1588,8 +1591,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
|
|
||||||
// Implementation of {@link KeyboardActionListener}.
|
// Implementation of {@link KeyboardActionListener}.
|
||||||
@Override
|
@Override
|
||||||
public void onCodeInput(final int codePoint, final int x, final int y,
|
public void onCodeInput(final int codePoint, final int x, final int y, final boolean isKeyRepeat) {
|
||||||
final boolean isKeyRepeat) {
|
|
||||||
// TODO: this processing does not belong inside LatinIME, the caller should be doing this.
|
// TODO: this processing does not belong inside LatinIME, the caller should be doing this.
|
||||||
final MainKeyboardView mainKeyboardView = mKeyboardSwitcher.getMainKeyboardView();
|
final MainKeyboardView mainKeyboardView = mKeyboardSwitcher.getMainKeyboardView();
|
||||||
// x and y include some padding, but everything down the line (especially native
|
// x and y include some padding, but everything down the line (especially native
|
||||||
|
@ -1599,8 +1601,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
// this transformation, it should be done already before calling onEvent.
|
// this transformation, it should be done already before calling onEvent.
|
||||||
final int keyX = mainKeyboardView.getKeyX(x);
|
final int keyX = mainKeyboardView.getKeyX(x);
|
||||||
final int keyY = mainKeyboardView.getKeyY(y);
|
final int keyY = mainKeyboardView.getKeyY(y);
|
||||||
final Event event = createSoftwareKeypressEvent(getCodePointForKeyboard(codePoint),
|
final Event event = createSoftwareKeypressEvent(getCodePointForKeyboard(codePoint), keyX, keyY, isKeyRepeat);
|
||||||
keyX, keyY, isKeyRepeat);
|
|
||||||
onEvent(event);
|
onEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1651,9 +1652,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
@Override
|
@Override
|
||||||
public void onStartBatchInput() {
|
public void onStartBatchInput() {
|
||||||
mInputLogic.onStartBatchInput(mSettings.getCurrent(), mKeyboardSwitcher, mHandler);
|
mInputLogic.onStartBatchInput(mSettings.getCurrent(), mKeyboardSwitcher, mHandler);
|
||||||
mGestureConsumer.onGestureStarted(
|
mGestureConsumer.onGestureStarted(mRichImm.getCurrentSubtypeLocale(), mKeyboardSwitcher.getKeyboard());
|
||||||
mRichImm.getCurrentSubtypeLocale(),
|
|
||||||
mKeyboardSwitcher.getKeyboard());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1941,7 +1940,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
if (!ProductionFlags.IS_HARDWARE_KEYBOARD_SUPPORTED) {
|
if (!ProductionFlags.IS_HARDWARE_KEYBOARD_SUPPORTED) {
|
||||||
return super.onKeyUp(keyCode, keyEvent);
|
return super.onKeyUp(keyCode, keyEvent);
|
||||||
}
|
}
|
||||||
final long keyIdentifier = keyEvent.getDeviceId() << 32 + keyEvent.getKeyCode();
|
final long keyIdentifier = (long) keyEvent.getDeviceId() << 32 + keyEvent.getKeyCode();
|
||||||
if (mInputLogic.mCurrentlyPressedHardwareKeys.remove(keyIdentifier)) {
|
if (mInputLogic.mCurrentlyPressedHardwareKeys.remove(keyIdentifier)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1958,7 +1957,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
@Override
|
@Override
|
||||||
public void onReceive(final Context context, final Intent intent) {
|
public void onReceive(final Context context, final Intent intent) {
|
||||||
final String action = intent.getAction();
|
final String action = intent.getAction();
|
||||||
if (action.equals(AudioManager.RINGER_MODE_CHANGED_ACTION)) {
|
if (AudioManager.RINGER_MODE_CHANGED_ACTION.equals(action)) {
|
||||||
AudioAndHapticFeedbackManager.getInstance().onRingerModeChanged();
|
AudioAndHapticFeedbackManager.getInstance().onRingerModeChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1983,42 +1982,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
@UsedForTesting
|
|
||||||
SuggestedWords getSuggestedWordsForTest() {
|
|
||||||
// You may not use this method for anything else than debug
|
|
||||||
return DebugFlags.DEBUG_ENABLED ? mInputLogic.mSuggestedWords : null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// DO NOT USE THIS for any other purpose than testing. This is information private to LatinIME.
|
|
||||||
@UsedForTesting
|
|
||||||
void waitForLoadingDictionaries(final long timeout, final TimeUnit unit)
|
|
||||||
throws InterruptedException {
|
|
||||||
mDictionaryFacilitator.waitForLoadingDictionariesForTesting(timeout, unit);
|
|
||||||
}
|
|
||||||
|
|
||||||
// DO NOT USE THIS for any other purpose than testing. This can break the keyboard badly.
|
|
||||||
@UsedForTesting
|
|
||||||
void replaceDictionariesForTest(final Locale locale) {
|
|
||||||
final SettingsValues settingsValues = mSettings.getCurrent();
|
|
||||||
mDictionaryFacilitator.resetDictionaries(this, locale,
|
|
||||||
settingsValues.mUseContactsDictionary, settingsValues.mUsePersonalizedDicts,
|
|
||||||
false /* forceReloadMainDictionary */,
|
|
||||||
settingsValues.mAccount, "", /* dictionaryNamePrefix */
|
|
||||||
this /* DictionaryInitializationListener */);
|
|
||||||
}
|
|
||||||
|
|
||||||
// DO NOT USE THIS for any other purpose than testing.
|
|
||||||
@UsedForTesting
|
|
||||||
void clearPersonalizedDictionariesForTest() {
|
|
||||||
mDictionaryFacilitator.clearUserHistoryDictionary(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@UsedForTesting
|
|
||||||
List<InputMethodSubtype> getEnabledSubtypesForTest() {
|
|
||||||
return (mRichImm != null) ? mRichImm.getMyEnabledInputMethodSubtypeList(
|
|
||||||
true /* allowsImplicitlySelectedSubtypes */) : new ArrayList<InputMethodSubtype>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void dumpDictionaryForDebug(final String dictName) {
|
public void dumpDictionaryForDebug(final String dictName) {
|
||||||
if (!mDictionaryFacilitator.isActive()) {
|
if (!mDictionaryFacilitator.isActive()) {
|
||||||
resetDictionaryFacilitatorIfNecessary();
|
resetDictionaryFacilitatorIfNecessary();
|
||||||
|
@ -2073,6 +2036,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
private void clearNavigationBarColor() {
|
private void clearNavigationBarColor() {
|
||||||
final SettingsValues settingsValues = mSettings.getCurrent();
|
final SettingsValues settingsValues = mSettings.getCurrent();
|
||||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP || !settingsValues.mCustomNavBarColor)
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP || !settingsValues.mCustomNavBarColor)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue