aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--java-overridable/src/com/android/inputmethod/compat/AppWorkaroundsHelper.java1
-rw-r--r--java-overridable/src/com/android/inputmethod/dictionarypack/MetadataUriGetter.java1
-rw-r--r--java-overridable/src/com/android/inputmethod/latin/accounts/LoginAccountUtils.java1
-rw-r--r--java-overridable/src/com/android/inputmethod/latin/define/ProductionFlags.java3
-rw-r--r--java-overridable/src/com/android/inputmethod/latin/personalization/ContextualDictionaryUpdater.java1
-rw-r--r--java-overridable/src/com/android/inputmethod/latin/personalization/PersonalizationDictionaryUpdater.java1
-rw-r--r--java-overridable/src/com/android/inputmethod/latin/settings/AdditionalFeaturesSettingUtils.java1
-rw-r--r--java-overridable/src/com/android/inputmethod/latin/touchinputconsumer/GestureConsumer.java2
-rw-r--r--java-overridable/src/com/android/inputmethod/latin/utils/FeedbackUtils.java1
-rw-r--r--java-overridable/src/com/android/inputmethod/latin/utils/MetadataFileUriGetter.java1
-rw-r--r--java-overridable/src/com/android/inputmethod/latin/utils/StatsUtils.java1
-rw-r--r--java-overridable/src/com/android/inputmethod/latin/utils/StatsUtilsManager.java1
-rw-r--r--java/res/values/attrs.xml62
-rw-r--r--java/res/values/donottranslate.xml2
-rw-r--r--java/res/values/keyboard-themes.xml3
-rw-r--r--java/res/values/themes-common.xml6
-rw-r--r--java/res/values/themes-ics.xml6
-rw-r--r--java/res/values/themes-klp.xml6
-rw-r--r--java/res/values/themes-lxx-dark.xml6
-rw-r--r--java/res/values/themes-lxx-light.xml6
-rw-r--r--java/src/com/android/inputmethod/compat/CursorAnchorInfoCompatWrapper.java2
-rw-r--r--java/src/com/android/inputmethod/compat/InputMethodSubtypeCompatUtils.java1
-rw-r--r--java/src/com/android/inputmethod/dictionarypack/DictionarySettingsActivity.java6
-rw-r--r--java/src/com/android/inputmethod/dictionarypack/DownloadOverMeteredDialog.java9
-rw-r--r--java/src/com/android/inputmethod/event/CombinerChain.java3
-rw-r--r--java/src/com/android/inputmethod/event/DeadKeyCombiner.java7
-rw-r--r--java/src/com/android/inputmethod/event/Event.java1
-rw-r--r--java/src/com/android/inputmethod/keyboard/TextDecorator.java6
-rw-r--r--java/src/com/android/inputmethod/keyboard/internal/AbstractDrawingPreview.java5
-rw-r--r--java/src/com/android/inputmethod/keyboard/internal/KeyboardBuilder.java4
-rw-r--r--java/src/com/android/inputmethod/keyboard/internal/MoreKeySpec.java3
-rw-r--r--java/src/com/android/inputmethod/keyboard/internal/TouchPositionCorrection.java2
-rw-r--r--java/src/com/android/inputmethod/latin/BinaryDictionary.java32
-rw-r--r--java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java4
-rw-r--r--java/src/com/android/inputmethod/latin/Constants.java8
-rw-r--r--java/src/com/android/inputmethod/latin/ContactsBinaryDictionary.java5
-rw-r--r--java/src/com/android/inputmethod/latin/Dictionary.java8
-rw-r--r--java/src/com/android/inputmethod/latin/DictionaryFacilitator.java9
-rw-r--r--java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java4
-rw-r--r--java/src/com/android/inputmethod/latin/InputView.java5
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java3
-rw-r--r--java/src/com/android/inputmethod/latin/NgramContext.java7
-rw-r--r--java/src/com/android/inputmethod/latin/PunctuationSuggestions.java6
-rw-r--r--java/src/com/android/inputmethod/latin/RichInputConnection.java3
-rw-r--r--java/src/com/android/inputmethod/latin/RichInputMethodManager.java5
-rw-r--r--java/src/com/android/inputmethod/latin/SubtypeSwitcher.java4
-rw-r--r--java/src/com/android/inputmethod/latin/UserBinaryDictionary.java5
-rw-r--r--java/src/com/android/inputmethod/latin/WordComposer.java2
-rw-r--r--java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java10
-rw-r--r--java/src/com/android/inputmethod/latin/network/HttpUrlConnectionBuilder.java4
-rw-r--r--java/src/com/android/inputmethod/latin/personalization/ContextualDictionary.java6
-rw-r--r--java/src/com/android/inputmethod/latin/personalization/PersonalizationDictionary.java6
-rw-r--r--java/src/com/android/inputmethod/latin/personalization/UserHistoryDictionary.java12
-rw-r--r--java/src/com/android/inputmethod/latin/settings/Settings.java4
-rw-r--r--java/src/com/android/inputmethod/latin/settings/SettingsValues.java12
-rw-r--r--java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerSession.java5
-rw-r--r--java/src/com/android/inputmethod/latin/spellcheck/SpellCheckerSettingsActivity.java6
-rw-r--r--java/src/com/android/inputmethod/latin/userdictionary/UserDictionaryList.java12
-rw-r--r--java/src/com/android/inputmethod/latin/userdictionary/UserDictionarySettings.java15
-rw-r--r--java/src/com/android/inputmethod/latin/utils/DistracterFilter.java11
-rw-r--r--java/src/com/android/inputmethod/latin/utils/NgramContextUtils.java9
-rw-r--r--java/src/com/android/inputmethod/latin/utils/ResourceUtils.java2
-rw-r--r--java/src/com/android/inputmethod/latin/utils/StringUtils.java6
-rw-r--r--tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderUtils.java2
-rw-r--r--tests/src/com/android/inputmethod/latin/makedict/BinaryDictEncoderUtils.java2
-rw-r--r--tests/src/com/android/inputmethod/latin/makedict/BinaryDictIOUtils.java4
-rw-r--r--tests/src/com/android/inputmethod/latin/makedict/Ver4DictDecoder.java7
-rw-r--r--tests/src/com/android/inputmethod/latin/utils/CollectionUtilsTests.java4
-rw-r--r--tools/dicttool/compat/android/test/MoreAsserts.java35
-rw-r--r--tools/dicttool/compat/com/android/inputmethod/keyboard/Keyboard.java1
-rw-r--r--tools/dicttool/src/com/android/inputmethod/latin/dicttool/Info.java5
-rw-r--r--tools/dicttool/src/com/android/inputmethod/latin/personalization/PersonalizationHelper.java1
72 files changed, 273 insertions, 179 deletions
diff --git a/java-overridable/src/com/android/inputmethod/compat/AppWorkaroundsHelper.java b/java-overridable/src/com/android/inputmethod/compat/AppWorkaroundsHelper.java
index 21535e421..f5e56eb4b 100644
--- a/java-overridable/src/com/android/inputmethod/compat/AppWorkaroundsHelper.java
+++ b/java-overridable/src/com/android/inputmethod/compat/AppWorkaroundsHelper.java
@@ -18,6 +18,7 @@ package com.android.inputmethod.compat;
import android.content.pm.PackageInfo;
+@SuppressWarnings("unused")
public class AppWorkaroundsHelper {
private AppWorkaroundsHelper() {
// This helper class is not publicly instantiable.
diff --git a/java-overridable/src/com/android/inputmethod/dictionarypack/MetadataUriGetter.java b/java-overridable/src/com/android/inputmethod/dictionarypack/MetadataUriGetter.java
index ed817658e..d8951df86 100644
--- a/java-overridable/src/com/android/inputmethod/dictionarypack/MetadataUriGetter.java
+++ b/java-overridable/src/com/android/inputmethod/dictionarypack/MetadataUriGetter.java
@@ -21,6 +21,7 @@ import android.content.Context;
/**
* Helper to get the metadata URI from its base URI and the additional ID, if any.
*/
+@SuppressWarnings("unused")
public class MetadataUriGetter {
private MetadataUriGetter() {
// This helper class is not instantiable.
diff --git a/java-overridable/src/com/android/inputmethod/latin/accounts/LoginAccountUtils.java b/java-overridable/src/com/android/inputmethod/latin/accounts/LoginAccountUtils.java
index e07a9f358..dcc64a223 100644
--- a/java-overridable/src/com/android/inputmethod/latin/accounts/LoginAccountUtils.java
+++ b/java-overridable/src/com/android/inputmethod/latin/accounts/LoginAccountUtils.java
@@ -40,6 +40,7 @@ public class LoginAccountUtils {
* @return an array of accounts. Empty (never null) if no accounts are available for login.
*/
@Nonnull
+ @SuppressWarnings("unused")
public static String[] getAccountsForLogin(final Context context) {
return new String[0];
}
diff --git a/java-overridable/src/com/android/inputmethod/latin/define/ProductionFlags.java b/java-overridable/src/com/android/inputmethod/latin/define/ProductionFlags.java
index 99b958952..f80625644 100644
--- a/java-overridable/src/com/android/inputmethod/latin/define/ProductionFlags.java
+++ b/java-overridable/src/com/android/inputmethod/latin/define/ProductionFlags.java
@@ -24,7 +24,8 @@ public final class ProductionFlags {
public static final boolean IS_HARDWARE_KEYBOARD_SUPPORTED = false;
/**
- * Include all suggestions from all dictionaries in {@link SuggestedWords#mRawSuggestions}.
+ * Include all suggestions from all dictionaries in
+ * {@link com.android.inputmethod.latin.SuggestedWords#mRawSuggestions}.
*/
public static final boolean INCLUDE_RAW_SUGGESTIONS = false;
diff --git a/java-overridable/src/com/android/inputmethod/latin/personalization/ContextualDictionaryUpdater.java b/java-overridable/src/com/android/inputmethod/latin/personalization/ContextualDictionaryUpdater.java
index 7dc120e06..fe1d846d8 100644
--- a/java-overridable/src/com/android/inputmethod/latin/personalization/ContextualDictionaryUpdater.java
+++ b/java-overridable/src/com/android/inputmethod/latin/personalization/ContextualDictionaryUpdater.java
@@ -20,6 +20,7 @@ import android.content.Context;
import com.android.inputmethod.latin.DictionaryFacilitator;
+@SuppressWarnings("unused")
public class ContextualDictionaryUpdater {
public ContextualDictionaryUpdater(final Context context,
final DictionaryFacilitator dictionaryFacilitator,
diff --git a/java-overridable/src/com/android/inputmethod/latin/personalization/PersonalizationDictionaryUpdater.java b/java-overridable/src/com/android/inputmethod/latin/personalization/PersonalizationDictionaryUpdater.java
index 8b66cff53..64bace35a 100644
--- a/java-overridable/src/com/android/inputmethod/latin/personalization/PersonalizationDictionaryUpdater.java
+++ b/java-overridable/src/com/android/inputmethod/latin/personalization/PersonalizationDictionaryUpdater.java
@@ -20,6 +20,7 @@ import android.content.Context;
import com.android.inputmethod.latin.DictionaryFacilitator;
+@SuppressWarnings("unused")
public class PersonalizationDictionaryUpdater {
final Context mContext;
final DictionaryFacilitator mDictionaryFacilitator;
diff --git a/java-overridable/src/com/android/inputmethod/latin/settings/AdditionalFeaturesSettingUtils.java b/java-overridable/src/com/android/inputmethod/latin/settings/AdditionalFeaturesSettingUtils.java
index 1dfaf259e..bd54238f8 100644
--- a/java-overridable/src/com/android/inputmethod/latin/settings/AdditionalFeaturesSettingUtils.java
+++ b/java-overridable/src/com/android/inputmethod/latin/settings/AdditionalFeaturesSettingUtils.java
@@ -29,6 +29,7 @@ import javax.annotation.Nonnull;
/**
* Utility class for managing additional features settings.
*/
+@SuppressWarnings("unused")
public class AdditionalFeaturesSettingUtils {
public static final int ADDITIONAL_FEATURES_SETTINGS_SIZE = 0;
diff --git a/java-overridable/src/com/android/inputmethod/latin/touchinputconsumer/GestureConsumer.java b/java-overridable/src/com/android/inputmethod/latin/touchinputconsumer/GestureConsumer.java
index 672d6d1a1..1d60e0cf5 100644
--- a/java-overridable/src/com/android/inputmethod/latin/touchinputconsumer/GestureConsumer.java
+++ b/java-overridable/src/com/android/inputmethod/latin/touchinputconsumer/GestureConsumer.java
@@ -17,6 +17,7 @@
package com.android.inputmethod.latin.touchinputconsumer;
import android.view.inputmethod.EditorInfo;
+
import com.android.inputmethod.keyboard.Keyboard;
import com.android.inputmethod.latin.InputPointers;
import com.android.inputmethod.latin.SuggestedWords;
@@ -31,6 +32,7 @@ import java.util.Locale;
* The methods of this class should only be called from a single thread, e.g.,
* the UI Thread.
*/
+@SuppressWarnings("unused")
public class GestureConsumer {
public static final GestureConsumer NULL_GESTURE_CONSUMER =
new GestureConsumer();
diff --git a/java-overridable/src/com/android/inputmethod/latin/utils/FeedbackUtils.java b/java-overridable/src/com/android/inputmethod/latin/utils/FeedbackUtils.java
index 0aed41ee4..67de8ba32 100644
--- a/java-overridable/src/com/android/inputmethod/latin/utils/FeedbackUtils.java
+++ b/java-overridable/src/com/android/inputmethod/latin/utils/FeedbackUtils.java
@@ -19,6 +19,7 @@ package com.android.inputmethod.latin.utils;
import android.content.Context;
import android.content.Intent;
+@SuppressWarnings("unused")
public class FeedbackUtils {
public static boolean isHelpAndFeedbackFormSupported() {
return false;
diff --git a/java-overridable/src/com/android/inputmethod/latin/utils/MetadataFileUriGetter.java b/java-overridable/src/com/android/inputmethod/latin/utils/MetadataFileUriGetter.java
index 9ad319da6..97fb17de3 100644
--- a/java-overridable/src/com/android/inputmethod/latin/utils/MetadataFileUriGetter.java
+++ b/java-overridable/src/com/android/inputmethod/latin/utils/MetadataFileUriGetter.java
@@ -23,6 +23,7 @@ import android.content.Context;
/**
* Helper class to get the metadata URI and the additional ID.
*/
+@SuppressWarnings("unused")
public class MetadataFileUriGetter {
private MetadataFileUriGetter() {
// This helper class is not instantiable.
diff --git a/java-overridable/src/com/android/inputmethod/latin/utils/StatsUtils.java b/java-overridable/src/com/android/inputmethod/latin/utils/StatsUtils.java
index fcaeca827..044970267 100644
--- a/java-overridable/src/com/android/inputmethod/latin/utils/StatsUtils.java
+++ b/java-overridable/src/com/android/inputmethod/latin/utils/StatsUtils.java
@@ -22,6 +22,7 @@ import com.android.inputmethod.latin.settings.SettingsValues;
import javax.annotation.Nullable;
+@SuppressWarnings("unused")
public final class StatsUtils {
private StatsUtils() {
diff --git a/java-overridable/src/com/android/inputmethod/latin/utils/StatsUtilsManager.java b/java-overridable/src/com/android/inputmethod/latin/utils/StatsUtilsManager.java
index 138f70f4c..c99dbf6a1 100644
--- a/java-overridable/src/com/android/inputmethod/latin/utils/StatsUtilsManager.java
+++ b/java-overridable/src/com/android/inputmethod/latin/utils/StatsUtilsManager.java
@@ -21,6 +21,7 @@ import android.content.Context;
import com.android.inputmethod.latin.settings.SettingsValues;
+@SuppressWarnings("unused")
public class StatsUtilsManager {
private static final StatsUtilsManager sInstance = new StatsUtilsManager();
diff --git a/java/res/values/attrs.xml b/java/res/values/attrs.xml
index be35d131d..bf36337a1 100644
--- a/java/res/values/attrs.xml
+++ b/java/res/values/attrs.xml
@@ -43,15 +43,18 @@
</declare-styleable>
<declare-styleable name="KeyboardView">
- <!-- Background image for the key. This image needs to be a {@link StateListDrawable},
- with the following possible states: normal, pressed, checkable, checkable+pressed,
- checkable+checked, checkable+checked+pressed. -->
+ <!-- Background image for the key. This image needs to be a
+ {@link android.graphics.drawable.StateListDrawable}, with the following possible states:
+ normal, pressed, checkable, checkable+pressed, checkable+checked,
+ checkable+checked+pressed. -->
<attr name="keyBackground" format="reference" />
<!-- Background image for the functional key. This image needs to be a
- {@link StateListDrawable}, with the following possible states: normal, pressed. -->
+ {@link android.graphics.drawable.StateListDrawable}, with the following possible
+ states: normal, pressed. -->
<attr name="functionalKeyBackground" format="reference" />
<!-- Background image for the spacebar. This image needs to be a
- {@link StateListDrawable}, with the following possible states: normal, pressed. -->
+ {@link android.graphics.drawable.StateListDrawable}, with the following possible
+ states: normal, pressed. -->
<attr name="spacebarBackground" format="reference" />
<attr name="spacebarIconWidthRatio" format="float" />
<!-- Right padding of hint letter to the edge of the key.-->
@@ -200,7 +203,8 @@
<declare-styleable name="SuggestionStripView">
<attr name="suggestionStripOptions" format="integer">
- <!-- This should be aligned with SuggestionStripLayoutHelper.AUTO_CORRECT_* and etc. -->
+ <!-- This should be aligned with
+ {@link com.android.inputmethod.latin.suggestions.SuggestionStripLayoutHelper.AUTO_CORRECT_BOLD} etc. -->
<flag name="autoCorrectBold" value="0x01" />
<flag name="autoCorrectUnderline" value="0x02" />
<flag name="validTypedWordBold" value="0x04" />
@@ -218,7 +222,8 @@
<declare-styleable name="Keyboard">
<attr name="themeId" format="enum">
- <!-- This should be aligned with KeyboardTheme.THEME_ID_*. -->
+ <!-- This should be aligned with
+ {@link com.android.inputmethod.keyboard.KeyboardTheme#THEME_ID_ICS} etc. -->
<enum name="ICS" value="0" />
<enum name="KLP" value="2" />
<enum name="LXXLight" value="3" />
@@ -240,8 +245,8 @@
<attr name="verticalGap" format="fraction" />
<!-- More keys keyboard layout template -->
<attr name="moreKeysTemplate" format="reference" />
- <!-- Icon set for key top and key preview.
- These should be aligned with KeyboardIconsSet.NAMES_AND_ATTR_IDS[] -->
+ <!-- Icon set for key top and key preview. These should be aligned with
+ {@link com.android.inputmethod.keyboard.internal.KeyboardIconsSet#NAMES_AND_ATTR_IDS} -->
<attr name="iconShiftKey" format="reference" />
<attr name="iconDeleteKey" format="reference" />
<attr name="iconSettingsKey" format="reference" />
@@ -287,7 +292,8 @@
<!-- Maximum column of more keys keyboard -->
<attr name="maxMoreKeysColumn" format="integer" />
<attr name="backgroundType" format="enum">
- <!-- This should be aligned with Key.BACKGROUND_TYPE_* -->
+ <!-- This should be aligned with
+ {@link com.android.inputmethod.keyboard.Key#BACKGROUND_TYPE_NORMAL} etc. -->
<enum name="empty" value="0" />
<enum name="normal" value="1" />
<enum name="functional" value="2" />
@@ -298,7 +304,8 @@
</attr>
<!-- The key action flags. -->
<attr name="keyActionFlags" format="integer">
- <!-- This should be aligned with Key.ACTION_FLAGS_* -->
+ <!-- This should be aligned with
+ {@link com.android.inputmethod.keyboard.Key#ACTION_FLAGS_IS_REPEATABLE} etc. -->
<flag name="isRepeatable" value="0x01" />
<flag name="noKeyPreview" value="0x02" />
<flag name="altCodeWhileTyping" value="0x04" />
@@ -312,7 +319,8 @@
<attr name="keyHintLabelVerticalAdjustment" format="fraction" />
<!-- The key label flags. -->
<attr name="keyLabelFlags" format="integer">
- <!-- This should be aligned with Key.LABEL_FLAGS__* -->
+ <!-- This should be aligned with
+ {@link com.android.inputmethod.keyboard.Key#LABEL_FLAGS_FONT_NORMAL} etc. -->
<flag name="alignHintLabelToBottom" value="0x02" />
<flag name="alignIconToBottom" value="0x04" />
<flag name="alignLabelOffCenter" value="0x08" />
@@ -357,7 +365,8 @@
<!-- Width of the key, in the proportion of keyboard width.
If the value is fillRight, the actual key width will be determined to fill out the
area up to the right edge of the keyboard. -->
- <!-- This should be aligned with KeyboardBuilder.Row.KEYWIDTH_* -->
+ <!-- This should be aligned with
+ {@link com.android.inputmethod.keyboard.internal.KeyboardRow#KEYWIDTH_FILL_RIGHT}. -->
<attr name="keyWidth" format="fraction|enum">
<enum name="fillRight" value="-1" />
</attr>
@@ -368,7 +377,7 @@
<!-- Key top visual attributes -->
<attr name="keyTypeface" format="enum">
- <!-- This should be aligned with Typeface.NORMAL etc. -->
+ <!-- This should be aligned with {@link android.graphics.Typeface#NORMAL} etc. -->
<enum name="normal" value="0" />
<enum name="bold" value="1" />
<enum name="italic" value="2" />
@@ -391,11 +400,11 @@
<attr name="keyShiftedLetterHintRatio" format="fraction" />
<!-- The label's horizontal offset to the center of the key. Negative is to left and
positive is to right. The value is in proportion of the width of
- TypefaceUtils.KEY_LABEL_REFERENCE_CHAR. -->
+ {@link com.android.inputmethod.latin.utils.TypefaceUtils#KEY_LABEL_REFERENCE_CHAR}. -->
<attr name="keyLabelOffCenterRatio" format="fraction" />
<!-- The hint label's horizontal offset to the center of the key. Negative is to left and
positive is to right. The value is in proportion of the width of
- TypefaceUtils.KEY_LABEL_REFERENCE_CHAR. -->
+ {@link com.android.inputmethod.latin.utils.TypefaceUtils#KEY_LABEL_REFERENCE_CHAR}. -->
<attr name="keyHintLabelOffCenterRatio" format="fraction" />
<!-- Color to use for the label in a key. -->
<attr name="keyTextColor" format="color" />
@@ -425,7 +434,8 @@
<declare-styleable name="Keyboard_Case">
<attr name="keyboardLayoutSet" format="string" />
- <!-- This should be aligned with KeyboardLayoutSet_Element's elementName. -->
+ <!-- This should be aligned with
+ {@link com.android.inputmethod.keyboard.KeyboardId#ELEMENT_ALPHABET} etc. -->
<attr name="keyboardLayoutSetElement" format="enum|string">
<enum name="alphabet" value="0" />
<enum name="alphabetManualShifted" value="1" />
@@ -445,14 +455,16 @@
<enum name="emojiCategory5" value="15" />
<enum name="emojiCategory6" value="16" />
</attr>
- <!-- This should be aligned with Keyboard.themeId and KeyboardTheme.THEME_ID_* -->
+ <!-- This should be aligned with Keyboard.themeId and
+ {@link com.android.inputmethod.keyboard.KeyboardTheme#THEME_ID_ICS} etc. -->
<attr name="keyboardTheme" format="enum|string">
<enum name="ICS" value="0" />
<enum name="KLP" value="2" />
<enum name="LXXLight" value="3" />
<enum name="LXXDark" value="4" />
</attr>
- <!-- This should be aligned with KeyboardId.MODE_* -->
+ <!-- This should be aligned with
+ {@link com.android.inputmethod.keyboard.KeyboardId#MODE_TEXT} etc. -->
<attr name="mode" format="enum|string">
<enum name="text" value="0" />
<enum name="url" value="1" />
@@ -469,7 +481,8 @@
<attr name="languageSwitchKeyEnabled" format="boolean" />
<attr name="isMultiLine" format="boolean" />
<attr name="imeAction" format="enum">
- <!-- This should be aligned with EditorInfo.IME_ACTION_* -->
+ <!-- This should be aligned with
+ {@link android.view.inputmethod.EditorInfo#IME_ACTION_GO} etc. -->
<enum name="actionUnspecified" value="0" />
<enum name="actionNone" value="1" />
<enum name="actionGo" value="2" />
@@ -478,7 +491,8 @@
<enum name="actionNext" value="5" />
<enum name="actionDone" value="6" />
<enum name="actionPrevious" value="7" />
- <!-- This should be aligned with KeyboardId.IME_ACTION_* -->
+ <!-- This should be aligned with
+ {@link com.android.inputmethod.latin.utils.InputTypeUtils#IME_ACTION_CUSTOM_LABEL}. -->
<enum name="actionCustomLabel" value="0x100" />
</attr>
<attr name="isIconDefined" format="string" />
@@ -495,7 +509,8 @@
</declare-styleable>
<declare-styleable name="KeyboardLayoutSet_Element">
- <!-- This should be aligned with KeyboardId.ELEMENT_* -->
+ <!-- This should be aligned with
+ {@link com.android.inputmethod.keyboard.KeyboardId#ELEMENT_ALPHABET} etc. -->
<attr name="elementName" format="enum">
<enum name="alphabet" value="0" />
<enum name="alphabetManualShifted" value="1" />
@@ -525,7 +540,8 @@
</declare-styleable>
<declare-styleable name="KeyboardLayoutSet_Feature">
- <!-- This should be aligned with ScriptUtils.SCRIPT_* -->
+ <!-- This should be aligned with
+ {@link com.android.inputmethod.latin.utils.ScriptUtils#SCRIPT_ARABIC} etc. -->
<attr name="supportedScript" format="enum">
<enum name="arabic" value="0" />
<enum name="armenian" value="1" />
diff --git a/java/res/values/donottranslate.xml b/java/res/values/donottranslate.xml
index 959fe833b..817bb5187 100644
--- a/java/res/values/donottranslate.xml
+++ b/java/res/values/donottranslate.xml
@@ -19,7 +19,7 @@
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- For backward compatibility.
- See {@link SettingsValues#needsToShowVoiceInputKey(SharedPreferences,Resources)} -->
+ @see com.android.inputmethod.latin.settings.SettingsValues#needsToShowVoiceInputKey(android.content.SharedPreferences,android.content.res.Resources) -->
<string name="voice_mode_main">0</string>
<!-- Subtype locale display name exceptions.
diff --git a/java/res/values/keyboard-themes.xml b/java/res/values/keyboard-themes.xml
index b0bae9647..26b258227 100644
--- a/java/res/values/keyboard-themes.xml
+++ b/java/res/values/keyboard-themes.xml
@@ -25,7 +25,8 @@
<item>@string/keyboard_theme_holo_white</item>
<item>@string/keyboard_theme_holo_blue</item>
</string-array>
- <!-- An element must be a keyboard theme id of {@link KeyboardTheme#THEME_ID_*}. -->
+ <!-- An element must be a keyboard theme id of
+ {@link com.android.inputmethod.keyboard.KeyboardTheme#THEME_ID_ICS} etc. -->
<integer-array name="keyboard_theme_ids" translatable="false">
<item>3</item>
<item>4</item>
diff --git a/java/res/values/themes-common.xml b/java/res/values/themes-common.xml
index f7cb10f93..2f768de71 100644
--- a/java/res/values/themes-common.xml
+++ b/java/res/values/themes-common.xml
@@ -105,8 +105,10 @@
<style
name="MainKeyboardView"
parent="KeyboardView" />
- <!-- Though {@link EmojiPalettesView} doesn't extend {@link KeyboardView}, some views inside it,
- for instance delete button, need themed {@link KeyboardView} attributes. -->
+ <!-- Though {@link com.android.inputmethod.keyboard.emoji.EmojiPalettesView} doesn't extend
+ {@link com.android.inputmethod.keyboard.KeyboardView}, some views inside it, for instance
+ delete button, need themed {@link com.android.inputmethod.keyboard.KeyboardView}
+ attributes. -->
<style name="EmojiPalettesView" />
<style name="MoreKeysKeyboard" />
<style name="MoreKeysKeyboardView" />
diff --git a/java/res/values/themes-ics.xml b/java/res/values/themes-ics.xml
index ecf40e4e6..26ebd2f03 100644
--- a/java/res/values/themes-ics.xml
+++ b/java/res/values/themes-ics.xml
@@ -73,8 +73,10 @@
<item name="languageOnSpacebarTextShadowRadius">1.0</item>
<item name="languageOnSpacebarTextShadowColor">@color/spacebar_text_shadow_color_holo</item>
</style>
- <!-- Though {@link EmojiPalettesView} doesn't extend {@link KeyboardView}, some views inside it,
- for instance delete button, need themed {@link KeyboardView} attributes. -->
+ <!-- Though {@link com.android.inputmethod.keyboard.emoji.EmojiPalettesView} doesn't extend
+ {@link com.android.inputmethod.keyboard.KeyboardView}, some views inside it, for instance
+ delete button, need themed {@link com.android.inputmethod.keyboard.KeyboardView}
+ attributes. -->
<style
name="EmojiPalettesView.ICS"
parent="MainKeyboardView.ICS"
diff --git a/java/res/values/themes-klp.xml b/java/res/values/themes-klp.xml
index de1cd9bf1..c8e11a97f 100644
--- a/java/res/values/themes-klp.xml
+++ b/java/res/values/themes-klp.xml
@@ -73,8 +73,10 @@
<item name="languageOnSpacebarTextShadowRadius">1.0</item>
<item name="languageOnSpacebarTextShadowColor">@color/spacebar_text_shadow_color_holo</item>
</style>
- <!-- Though {@link EmojiPalettesView} doesn't extend {@link KeyboardView}, some views inside it,
- for instance delete button, need themed {@link KeyboardView} attributes. -->
+ <!-- Though {@link com.android.inputmethod.keyboard.emoji.EmojiPalettesView} doesn't extend
+ {@link com.android.inputmethod.keyboard.KeyboardView}, some views inside it, for instance
+ delete button, need themed {@link com.android.inputmethod.keyboard.KeyboardView}
+ attributes. -->
<style
name="EmojiPalettesView.KLP"
parent="MainKeyboardView.KLP"
diff --git a/java/res/values/themes-lxx-dark.xml b/java/res/values/themes-lxx-dark.xml
index b081772e9..0535064d3 100644
--- a/java/res/values/themes-lxx-dark.xml
+++ b/java/res/values/themes-lxx-dark.xml
@@ -73,8 +73,10 @@
<!-- A negative value to disable text shadow layer. -->
<item name="languageOnSpacebarTextShadowRadius">-1.0</item>
</style>
- <!-- Though {@link EmojiPalettesView} doesn't extend {@link KeyboardView}, some views inside it,
- for instance delete button, need themed {@link KeyboardView} attributes. -->
+ <!-- Though {@link com.android.inputmethod.keyboard.emoji.EmojiPalettesView} doesn't extend
+ {@link com.android.inputmethod.keyboard.KeyboardView}, some views inside it, for instance
+ delete button, need themed {@link com.android.inputmethod.keyboard.KeyboardView}
+ attributes. -->
<style
name="EmojiPalettesView.LXX_Dark"
parent="MainKeyboardView.LXX_Dark"
diff --git a/java/res/values/themes-lxx-light.xml b/java/res/values/themes-lxx-light.xml
index 3d294e450..80e88b8f1 100644
--- a/java/res/values/themes-lxx-light.xml
+++ b/java/res/values/themes-lxx-light.xml
@@ -73,8 +73,10 @@
<!-- A negative value to disable text shadow layer. -->
<item name="languageOnSpacebarTextShadowRadius">-1.0</item>
</style>
- <!-- Though {@link EmojiPalettesView} doesn't extend {@link KeyboardView}, some views inside it,
- for instance delete button, need themed {@link KeyboardView} attributes. -->
+ <!-- Though {@link com.android.inputmethod.keyboard.emoji.EmojiPalettesView} doesn't extend
+ {@link com.android.inputmethod.keyboard.KeyboardView}, some views inside it, for instance
+ delete button, need themed {@link com.android.inputmethod.keyboard.KeyboardView}
+ attributes. -->
<style
name="EmojiPalettesView.LXX_Light"
parent="MainKeyboardView.LXX_Light"
diff --git a/java/src/com/android/inputmethod/compat/CursorAnchorInfoCompatWrapper.java b/java/src/com/android/inputmethod/compat/CursorAnchorInfoCompatWrapper.java
index 380f8d9b9..01a9e6712 100644
--- a/java/src/com/android/inputmethod/compat/CursorAnchorInfoCompatWrapper.java
+++ b/java/src/com/android/inputmethod/compat/CursorAnchorInfoCompatWrapper.java
@@ -82,10 +82,12 @@ public class CursorAnchorInfoCompatWrapper {
throw new UnsupportedOperationException("not supported.");
}
+ @SuppressWarnings("unused")
public RectF getCharacterBounds(final int index) {
throw new UnsupportedOperationException("not supported.");
}
+ @SuppressWarnings("unused")
public int getCharacterBoundsFlags(final int index) {
throw new UnsupportedOperationException("not supported.");
}
diff --git a/java/src/com/android/inputmethod/compat/InputMethodSubtypeCompatUtils.java b/java/src/com/android/inputmethod/compat/InputMethodSubtypeCompatUtils.java
index b9a536721..9e842e766 100644
--- a/java/src/com/android/inputmethod/compat/InputMethodSubtypeCompatUtils.java
+++ b/java/src/com/android/inputmethod/compat/InputMethodSubtypeCompatUtils.java
@@ -52,6 +52,7 @@ public final class InputMethodSubtypeCompatUtils {
// This utility class is not publicly instantiable.
}
+ @SuppressWarnings("deprecation")
public static InputMethodSubtype newInputMethodSubtype(int nameId, int iconId, String locale,
String mode, String extraValue, boolean isAuxiliary,
boolean overridesImplicitlyEnabledSubtype, int id) {
diff --git a/java/src/com/android/inputmethod/dictionarypack/DictionarySettingsActivity.java b/java/src/com/android/inputmethod/dictionarypack/DictionarySettingsActivity.java
index 4366348d5..284032beb 100644
--- a/java/src/com/android/inputmethod/dictionarypack/DictionarySettingsActivity.java
+++ b/java/src/com/android/inputmethod/dictionarypack/DictionarySettingsActivity.java
@@ -18,7 +18,9 @@ package com.android.inputmethod.dictionarypack;
import com.android.inputmethod.latin.utils.FragmentUtils;
+import android.annotation.TargetApi;
import android.content.Intent;
+import android.os.Build;
import android.os.Bundle;
import android.preference.PreferenceActivity;
@@ -44,8 +46,8 @@ public final class DictionarySettingsActivity extends PreferenceActivity {
return modIntent;
}
- // TODO: Uncomment the override annotation once we start using SDK version 19.
- // @Override
+ @TargetApi(Build.VERSION_CODES.KITKAT)
+ @Override
public boolean isValidFragment(String fragmentName) {
return FragmentUtils.isValidFragment(fragmentName);
}
diff --git a/java/src/com/android/inputmethod/dictionarypack/DownloadOverMeteredDialog.java b/java/src/com/android/inputmethod/dictionarypack/DownloadOverMeteredDialog.java
index d3c0a910f..f1633ff28 100644
--- a/java/src/com/android/inputmethod/dictionarypack/DownloadOverMeteredDialog.java
+++ b/java/src/com/android/inputmethod/dictionarypack/DownloadOverMeteredDialog.java
@@ -24,6 +24,7 @@ import android.view.View;
import android.widget.Button;
import android.widget.TextView;
+import com.android.inputmethod.annotations.ExternallyReferenced;
import com.android.inputmethod.latin.R;
import java.util.Locale;
@@ -63,11 +64,19 @@ public final class DownloadOverMeteredDialog extends Activity {
allowButton.setText(String.format(allowButtonFormat, ((float)size)/(1024*1024)));
}
+ // This method is externally referenced from layout/download_over_metered.xml using onClick
+ // attribute of Button.
+ @ExternallyReferenced
+ @SuppressWarnings("unused")
public void onClickDeny(final View v) {
UpdateHandler.setDownloadOverMeteredSetting(this, false);
finish();
}
+ // This method is externally referenced from layout/download_over_metered.xml using onClick
+ // attribute of Button.
+ @ExternallyReferenced
+ @SuppressWarnings("unused")
public void onClickAllow(final View v) {
UpdateHandler.setDownloadOverMeteredSetting(this, true);
UpdateHandler.installIfNeverRequested(this, mClientId, mWordListToDownload,
diff --git a/java/src/com/android/inputmethod/event/CombinerChain.java b/java/src/com/android/inputmethod/event/CombinerChain.java
index 2d2731f21..b5863ed2d 100644
--- a/java/src/com/android/inputmethod/event/CombinerChain.java
+++ b/java/src/com/android/inputmethod/event/CombinerChain.java
@@ -97,7 +97,8 @@ public class CombinerChain {
* new event. However it may never be null.
*/
@Nonnull
- public Event processEvent(final ArrayList<Event> previousEvents, final Event newEvent) {
+ public Event processEvent(final ArrayList<Event> previousEvents,
+ @Nonnull final Event newEvent) {
final ArrayList<Event> modifiablePreviousEvents = new ArrayList<>(previousEvents);
Event event = newEvent;
for (final Combiner combiner : mCombiners) {
diff --git a/java/src/com/android/inputmethod/event/DeadKeyCombiner.java b/java/src/com/android/inputmethod/event/DeadKeyCombiner.java
index 2e65a08fa..9d7cc0561 100644
--- a/java/src/com/android/inputmethod/event/DeadKeyCombiner.java
+++ b/java/src/com/android/inputmethod/event/DeadKeyCombiner.java
@@ -217,11 +217,8 @@ public class DeadKeyCombiner implements Combiner {
@Nonnull
private static Event createEventChainFromSequence(final @Nonnull CharSequence text,
- final Event originalEvent) {
- if (text.length() <= 0) {
- return originalEvent;
- }
- Event lastEvent = null;
+ @Nonnull final Event originalEvent) {
+ Event lastEvent = originalEvent;
int codePoint = 0;
for (int i = text.length(); i > 0; i -= Character.charCount(codePoint)) {
codePoint = Character.codePointBefore(text, i);
diff --git a/java/src/com/android/inputmethod/event/Event.java b/java/src/com/android/inputmethod/event/Event.java
index 3e3ff771c..0e6d733cd 100644
--- a/java/src/com/android/inputmethod/event/Event.java
+++ b/java/src/com/android/inputmethod/event/Event.java
@@ -223,6 +223,7 @@ public class Event {
* Creates an input event representing the manual pick of a punctuation suggestion.
* @return an event for this suggestion pick.
*/
+ @Nonnull
public static Event createPunctuationSuggestionPickedEvent(
final SuggestedWordInfo suggestedWordInfo) {
final int primaryCode = suggestedWordInfo.mWord.charAt(0);
diff --git a/java/src/com/android/inputmethod/keyboard/TextDecorator.java b/java/src/com/android/inputmethod/keyboard/TextDecorator.java
index 79e2206c2..892d36752 100644
--- a/java/src/com/android/inputmethod/keyboard/TextDecorator.java
+++ b/java/src/com/android/inputmethod/keyboard/TextDecorator.java
@@ -74,7 +74,7 @@ public class TextDecorator {
void onClickComposingTextToAddToDictionary(final String word);
}
- public TextDecorator(final Listener listener) {
+ public TextDecorator(@Nullable final Listener listener) {
mListener = (listener != null) ? listener : EMPTY_LISTENER;
}
@@ -83,7 +83,7 @@ public class TextDecorator {
* delegated to the associated UI operator.
* @param uiOperator the UI operator to be associated.
*/
- public void setUiOperator(final TextDecoratorUiOperator uiOperator) {
+ public void setUiOperator(@Nonnull final TextDecoratorUiOperator uiOperator) {
mUiOperator.disposeUi();
mUiOperator = uiOperator;
mUiOperator.setOnClickListener(getOnClickHandler());
@@ -347,12 +347,14 @@ public class TextDecorator {
}
}
+ @Nonnull
private final static Listener EMPTY_LISTENER = new Listener() {
@Override
public void onClickComposingTextToAddToDictionary(final String word) {
}
};
+ @Nonnull
private final static TextDecoratorUiOperator EMPTY_UI_OPERATOR = new TextDecoratorUiOperator() {
@Override
public void disposeUi() {
diff --git a/java/src/com/android/inputmethod/keyboard/internal/AbstractDrawingPreview.java b/java/src/com/android/inputmethod/keyboard/internal/AbstractDrawingPreview.java
index a194f3dfd..755a99a2c 100644
--- a/java/src/com/android/inputmethod/keyboard/internal/AbstractDrawingPreview.java
+++ b/java/src/com/android/inputmethod/keyboard/internal/AbstractDrawingPreview.java
@@ -19,6 +19,7 @@ package com.android.inputmethod.keyboard.internal;
import android.graphics.Canvas;
import android.view.View;
+import com.android.inputmethod.keyboard.MainKeyboardView;
import com.android.inputmethod.keyboard.PointerTracker;
/**
@@ -51,11 +52,11 @@ public abstract class AbstractDrawingPreview {
}
/**
- * Set {@link MainKeyboardView} geometry and position in the {@link SoftInputWindow}.
+ * Set {@link MainKeyboardView} geometry and position in the window of input method.
* The class that is overriding this method must call this super implementation.
*
* @param originCoords the top-left coordinates of the {@link MainKeyboardView} in
- * {@link SoftInputWindow} coordinate-system. This is unused but has a point in an
+ * the input method window coordinate-system. This is unused but has a point in an
* extended class, such as {@link GestureTrailsDrawingPreview}.
* @param width the width of {@link MainKeyboardView}.
* @param height the height of {@link MainKeyboardView}.
diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardBuilder.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardBuilder.java
index f581822d8..6277107e8 100644
--- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardBuilder.java
+++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardBuilder.java
@@ -47,6 +47,8 @@ import java.io.IOException;
import java.util.Arrays;
import java.util.Locale;
+import javax.annotation.Nonnull;
+
/**
* Keyboard Building helper.
*
@@ -859,7 +861,7 @@ public class KeyboardBuilder<KP extends KeyboardParams> {
mTopEdge = false;
}
- private void endKey(final Key key) {
+ private void endKey(@Nonnull final Key key) {
mParams.onAddKey(key);
if (mLeftEdge) {
key.markAsLeftEdge(mParams);
diff --git a/java/src/com/android/inputmethod/keyboard/internal/MoreKeySpec.java b/java/src/com/android/inputmethod/keyboard/internal/MoreKeySpec.java
index eed3cb6d2..81d4b8e73 100644
--- a/java/src/com/android/inputmethod/keyboard/internal/MoreKeySpec.java
+++ b/java/src/com/android/inputmethod/keyboard/internal/MoreKeySpec.java
@@ -31,6 +31,8 @@ import java.util.Arrays;
import java.util.HashSet;
import java.util.Locale;
+import javax.annotation.Nonnull;
+
/**
* The more key specification object. The more keys are an array of {@link MoreKeySpec}.
*
@@ -70,6 +72,7 @@ public final class MoreKeySpec {
mIconId = KeySpecParser.getIconId(moreKeySpec);
}
+ @Nonnull
public Key buildKey(final int x, final int y, final int labelFlags,
final KeyboardParams params) {
return new Key(mLabel, mIconId, mCode, mOutputText, null /* hintLabel */, labelFlags,
diff --git a/java/src/com/android/inputmethod/keyboard/internal/TouchPositionCorrection.java b/java/src/com/android/inputmethod/keyboard/internal/TouchPositionCorrection.java
index a2ebc9c4f..d8f0114e1 100644
--- a/java/src/com/android/inputmethod/keyboard/internal/TouchPositionCorrection.java
+++ b/java/src/com/android/inputmethod/keyboard/internal/TouchPositionCorrection.java
@@ -80,7 +80,7 @@ public final class TouchPositionCorrection {
return mRadii.length;
}
- @SuppressWarnings("static-method")
+ @SuppressWarnings({ "static-method", "unused" })
public float getX(final int row) {
return 0.0f;
// Touch position correction data for X coordinate is obsolete.
diff --git a/java/src/com/android/inputmethod/latin/BinaryDictionary.java b/java/src/com/android/inputmethod/latin/BinaryDictionary.java
index d8a94e9ce..cfe1ea6a7 100644
--- a/java/src/com/android/inputmethod/latin/BinaryDictionary.java
+++ b/java/src/com/android/inputmethod/latin/BinaryDictionary.java
@@ -351,15 +351,19 @@ public final class BinaryDictionary extends Dictionary {
@Override
public int getFrequency(final String word) {
- if (TextUtils.isEmpty(word)) return NOT_A_PROBABILITY;
- int[] codePoints = StringUtils.toCodePointArray(word);
+ if (TextUtils.isEmpty(word)) {
+ return NOT_A_PROBABILITY;
+ }
+ final int[] codePoints = StringUtils.toCodePointArray(word);
return getProbabilityNative(mNativeDict, codePoints);
}
@Override
public int getMaxFrequencyOfExactMatches(final String word) {
- if (TextUtils.isEmpty(word)) return NOT_A_PROBABILITY;
- int[] codePoints = StringUtils.toCodePointArray(word);
+ if (TextUtils.isEmpty(word)) {
+ return NOT_A_PROBABILITY;
+ }
+ final int[] codePoints = StringUtils.toCodePointArray(word);
return getMaxProbabilityOfExactMatchesNative(mNativeDict, codePoints);
}
@@ -523,7 +527,9 @@ public final class BinaryDictionary extends Dictionary {
@UsedForTesting
public void addMultipleDictionaryEntries(final LanguageModelParam[] languageModelParams) {
- if (!isValidDictionary()) return;
+ if (!isValidDictionary()) {
+ return;
+ }
int processedParamCount = 0;
while (processedParamCount < languageModelParams.length) {
if (needsToRunGC(true /* mindsBlockByGC */)) {
@@ -550,7 +556,9 @@ public final class BinaryDictionary extends Dictionary {
// Flush to dict file if the dictionary has been updated.
public boolean flush() {
- if (!isValidDictionary()) return false;
+ if (!isValidDictionary()) {
+ return false;
+ }
if (mHasUpdated) {
if (!flushNative(mNativeDict, mDictFilePath)) {
return false;
@@ -570,7 +578,9 @@ public final class BinaryDictionary extends Dictionary {
// Run GC and flush to dict file.
public boolean flushWithGC() {
- if (!isValidDictionary()) return false;
+ if (!isValidDictionary()) {
+ return false;
+ }
if (!flushWithGCNative(mNativeDict, mDictFilePath)) {
return false;
}
@@ -585,7 +595,9 @@ public final class BinaryDictionary extends Dictionary {
* @return whether GC is needed to run or not.
*/
public boolean needsToRunGC(final boolean mindsBlockByGC) {
- if (!isValidDictionary()) return false;
+ if (!isValidDictionary()) {
+ return false;
+ }
return needsToRunGCNative(mNativeDict, mindsBlockByGC);
}
@@ -630,7 +642,9 @@ public final class BinaryDictionary extends Dictionary {
@UsedForTesting
public String getPropertyForGettingStats(final String query) {
- if (!isValidDictionary()) return "";
+ if (!isValidDictionary()) {
+ return "";
+ }
return getPropertyNative(mNativeDict, query);
}
diff --git a/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java b/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java
index 974fb14e9..1570bdae0 100644
--- a/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java
+++ b/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java
@@ -223,7 +223,7 @@ final public class BinaryDictionaryGetter {
// ## HACK ## we prevent usage of a dictionary before version 18. The reason for this is, since
// those do not include whitelist entries, the new code with an old version of the dictionary
// would lose whitelist functionality.
- private static boolean hackCanUseDictionaryFile(final Locale locale, final File file) {
+ private static boolean hackCanUseDictionaryFile(final File file) {
try {
// Read the version of the file
final DictionaryHeader header = BinaryDictionaryUtils.getHeader(file);
@@ -275,7 +275,7 @@ final public class BinaryDictionaryGetter {
// cachedWordLists may not be null, see doc for getCachedDictionaryList
for (final File f : cachedWordLists) {
final String wordListId = DictionaryInfoUtils.getWordListIdFromFileName(f.getName());
- final boolean canUse = f.canRead() && hackCanUseDictionaryFile(locale, f);
+ final boolean canUse = f.canRead() && hackCanUseDictionaryFile(f);
if (canUse && DictionaryInfoUtils.isMainWordListId(wordListId)) {
foundMainDict = true;
}
diff --git a/java/src/com/android/inputmethod/latin/Constants.java b/java/src/com/android/inputmethod/latin/Constants.java
index fc7f95c7b..0fd5659ec 100644
--- a/java/src/com/android/inputmethod/latin/Constants.java
+++ b/java/src/com/android/inputmethod/latin/Constants.java
@@ -233,8 +233,8 @@ public final class Constants {
/**
* Special keys code. Must be negative.
- * These should be aligned with {@link KeyboardCodesSet#ID_TO_NAME},
- * {@link KeyboardCodesSet#DEFAULT}, and {@link KeyboardCodesSet#RTL}.
+ * These should be aligned with constants in
+ * {@link com.android.inputmethod.keyboard.internal.KeyboardCodesSet}.
*/
public static final int CODE_SHIFT = -1;
public static final int CODE_CAPSLOCK = -2;
@@ -309,8 +309,8 @@ public final class Constants {
/**
* Default capacity of gesture points container.
- * This constant is used by {@link BatchInputArbiter} and etc. to preallocate regions that
- * contain gesture event points.
+ * This constant is used by {@link com.android.inputmethod.keyboard.internal.BatchInputArbiter}
+ * and etc. to preallocate regions that contain gesture event points.
*/
public static final int DEFAULT_GESTURE_POINTS_CAPACITY = 128;
diff --git a/java/src/com/android/inputmethod/latin/ContactsBinaryDictionary.java b/java/src/com/android/inputmethod/latin/ContactsBinaryDictionary.java
index 19f4adc12..fcdcfeea1 100644
--- a/java/src/com/android/inputmethod/latin/ContactsBinaryDictionary.java
+++ b/java/src/com/android/inputmethod/latin/ContactsBinaryDictionary.java
@@ -28,7 +28,7 @@ import android.provider.ContactsContract;
import android.provider.ContactsContract.Contacts;
import android.util.Log;
-import com.android.inputmethod.annotations.UsedForTesting;
+import com.android.inputmethod.annotations.ExternallyReferenced;
import com.android.inputmethod.latin.personalization.AccountUtils;
import com.android.inputmethod.latin.utils.ExecutorUtils;
import com.android.inputmethod.latin.utils.StringUtils;
@@ -82,7 +82,8 @@ public class ContactsBinaryDictionary extends ExpandableBinaryDictionary {
reloadDictionaryIfRequired();
}
- @UsedForTesting
+ // Note: This method is called by {@link DictionaryFacilitator} using Java reflection.
+ @ExternallyReferenced
public static ContactsBinaryDictionary getDictionary(final Context context, final Locale locale,
final File dictFile, final String dictNamePrefix) {
return new ContactsBinaryDictionary(context, locale, dictFile, dictNamePrefix + NAME);
diff --git a/java/src/com/android/inputmethod/latin/Dictionary.java b/java/src/com/android/inputmethod/latin/Dictionary.java
index d8f1b2a20..28a62b283 100644
--- a/java/src/com/android/inputmethod/latin/Dictionary.java
+++ b/java/src/com/android/inputmethod/latin/Dictionary.java
@@ -120,10 +120,18 @@ public abstract class Dictionary {
*/
abstract public boolean isInDictionary(final String word);
+ /**
+ * Get the frequency of the word.
+ * @param word the word to get the frequency of.
+ */
public int getFrequency(final String word) {
return NOT_A_PROBABILITY;
}
+ /**
+ * Get the maximum frequency of the word.
+ * @param word the word to get the maximum frequency of.
+ */
public int getMaxFrequencyOfExactMatches(final String word) {
return NOT_A_PROBABILITY;
}
diff --git a/java/src/com/android/inputmethod/latin/DictionaryFacilitator.java b/java/src/com/android/inputmethod/latin/DictionaryFacilitator.java
index 7a17dcc56..25cbabfea 100644
--- a/java/src/com/android/inputmethod/latin/DictionaryFacilitator.java
+++ b/java/src/com/android/inputmethod/latin/DictionaryFacilitator.java
@@ -53,6 +53,9 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
// TODO: Consolidate dictionaries in native code.
public class DictionaryFacilitator {
public static final String TAG = DictionaryFacilitator.class.getSimpleName();
@@ -274,6 +277,7 @@ public class DictionaryFacilitator {
mMostProbableDictionaryGroup = newMostProbableDictionaryGroup;
}
+ @Nullable
private static ExpandableBinaryDictionary getSubDict(final String dictType,
final Context context, final Locale locale, final File dictFile,
final String dictNamePrefix) {
@@ -303,6 +307,7 @@ public class DictionaryFacilitator {
usePersonalizedDicts, forceReloadMainDictionary, listener, "" /* dictNamePrefix */);
}
+ @Nullable
static DictionaryGroup findDictionaryGroupWithLocale(final DictionaryGroup[] dictionaryGroups,
final Locale locale) {
for (int i = 0; i < dictionaryGroups.length; ++i) {
@@ -317,7 +322,7 @@ public class DictionaryFacilitator {
final Locale[] newLocales,
final boolean useContactsDict, final boolean usePersonalizedDicts,
final boolean forceReloadMainDictionary,
- final DictionaryInitializationListener listener,
+ @Nullable final DictionaryInitializationListener listener,
final String dictNamePrefix) {
final HashMap<Locale, ArrayList<String>> existingDictsToCleanup = new HashMap<>();
// TODO: Make subDictTypesToUse configurable by resource or a static final list.
@@ -593,7 +598,7 @@ public class DictionaryFacilitator {
}
public void addToUserHistory(final String suggestion, final boolean wasAutoCapitalized,
- final NgramContext ngramContext, final int timeStampInSeconds,
+ @Nonnull final NgramContext ngramContext, final int timeStampInSeconds,
final boolean blockPotentiallyOffensive) {
final DictionaryGroup dictionaryGroup = getDictionaryGroupForMostProbableLanguage();
final String[] words = suggestion.split(Constants.WORD_SEPARATOR);
diff --git a/java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java b/java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java
index ff05a2fcd..97af02f21 100644
--- a/java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java
+++ b/java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java
@@ -53,6 +53,10 @@ import javax.annotation.Nullable;
* Abstract base class for an expandable dictionary that can be created and updated dynamically
* during runtime. When updated it automatically generates a new binary dictionary to handle future
* queries in native code. This binary dictionary is written to internal storage.
+ *
+ * A class that extends this abstract class must have a static factory method named
+ * getDictionary(Context context, Locale locale, File dictFile, String dictNamePrefix)
+ * @see DictionaryFacilitator#getSubDict(String,Context,Locale,File,String)
*/
abstract public class ExpandableBinaryDictionary extends Dictionary {
private static final boolean DEBUG = false;
diff --git a/java/src/com/android/inputmethod/latin/InputView.java b/java/src/com/android/inputmethod/latin/InputView.java
index 7fa935413..f3a8ca169 100644
--- a/java/src/com/android/inputmethod/latin/InputView.java
+++ b/java/src/com/android/inputmethod/latin/InputView.java
@@ -139,7 +139,10 @@ public final class InputView extends FrameLayout {
return y - mEventReceivingRect.top;
}
- // Callback when a {@link MotionEvent} is forwarded.
+ /**
+ * Callback when a {@link MotionEvent} is forwarded.
+ * @param me the motion event to be forwarded.
+ */
protected void onForwardingEvent(final MotionEvent me) {}
// Returns true if a {@link MotionEvent} is needed to be forwarded to
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index e7a91c521..cd17ada89 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -1419,7 +1419,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
// This method is public for testability of LatinIME, but also in the future it should
// completely replace #onCodeInput.
- public void onEvent(final Event event) {
+ public void onEvent(@Nonnull final Event event) {
if (Constants.CODE_SHORTCUT == event.mKeyCode) {
mSubtypeSwitcher.switchToShortcutIME(this);
}
@@ -1434,6 +1434,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
// A helper method to split the code point and the key code. Ultimately, they should not be
// squashed into the same variable, and this method should be removed.
// public for testing, as we don't want to copy the same logic into test code
+ @Nonnull
public static Event createSoftwareKeypressEvent(final int keyCodeOrCodePoint, final int keyX,
final int keyY, final boolean isKeyRepeat) {
final int keyCode;
diff --git a/java/src/com/android/inputmethod/latin/NgramContext.java b/java/src/com/android/inputmethod/latin/NgramContext.java
index 2dc409f9f..4a3ac0fae 100644
--- a/java/src/com/android/inputmethod/latin/NgramContext.java
+++ b/java/src/com/android/inputmethod/latin/NgramContext.java
@@ -23,13 +23,17 @@ import com.android.inputmethod.latin.utils.StringUtils;
import java.util.Arrays;
+import javax.annotation.Nonnull;
+
/**
* Class to represent information of previous words. This class is used to add n-gram entries
* into binary dictionaries, to get predictions, and to get suggestions.
*/
public class NgramContext {
+ @Nonnull
public static final NgramContext EMPTY_PREV_WORDS_INFO =
new NgramContext(WordInfo.EMPTY_WORD_INFO);
+ @Nonnull
public static final NgramContext BEGINNING_OF_SENTENCE =
new NgramContext(WordInfo.BEGINNING_OF_SENTENCE_WORD_INFO);
@@ -37,7 +41,9 @@ public class NgramContext {
* Word information used to represent previous words information.
*/
public static class WordInfo {
+ @Nonnull
public static final WordInfo EMPTY_WORD_INFO = new WordInfo(null);
+ @Nonnull
public static final WordInfo BEGINNING_OF_SENTENCE_WORD_INFO = new WordInfo();
// This is an empty char sequence when mIsBeginningOfSentence is true.
@@ -97,6 +103,7 @@ public class NgramContext {
}
// Create next prevWordsInfo using current prevWordsInfo.
+ @Nonnull
public NgramContext getNextNgramContext(final WordInfo wordInfo) {
final int nextPrevWordCount = Math.min(Constants.MAX_PREV_WORD_COUNT_FOR_N_GRAM,
mPrevWordsCount + 1);
diff --git a/java/src/com/android/inputmethod/latin/PunctuationSuggestions.java b/java/src/com/android/inputmethod/latin/PunctuationSuggestions.java
index 56014cbad..6aacf3257 100644
--- a/java/src/com/android/inputmethod/latin/PunctuationSuggestions.java
+++ b/java/src/com/android/inputmethod/latin/PunctuationSuggestions.java
@@ -56,7 +56,7 @@ public final class PunctuationSuggestions extends SuggestedWords {
/**
* {@inheritDoc}
- * Note that {@link super#getWord(int)} returns a punctuation key specification text.
+ * Note that {@link SuggestedWords#getWord(int)} returns a punctuation key specification text.
* The suggested punctuation should be gotten by parsing the key specification.
*/
@Override
@@ -70,7 +70,7 @@ public final class PunctuationSuggestions extends SuggestedWords {
/**
* {@inheritDoc}
- * Note that {@link super#getWord(int)} returns a punctuation key specification text.
+ * Note that {@link SuggestedWords#getWord(int)} returns a punctuation key specification text.
* The displayed text should be gotten by parsing the key specification.
*/
@Override
@@ -82,7 +82,7 @@ public final class PunctuationSuggestions extends SuggestedWords {
/**
* {@inheritDoc}
* Note that {@link #getWord(int)} returns a suggested punctuation. We should create a
- * {@link SuggestedWordInfo} object that represents a hard coded word.
+ * {@link SuggestedWords.SuggestedWordInfo} object that represents a hard coded word.
*/
@Override
public SuggestedWordInfo getInfo(final int index) {
diff --git a/java/src/com/android/inputmethod/latin/RichInputConnection.java b/java/src/com/android/inputmethod/latin/RichInputConnection.java
index 2c17660d8..be1523f63 100644
--- a/java/src/com/android/inputmethod/latin/RichInputConnection.java
+++ b/java/src/com/android/inputmethod/latin/RichInputConnection.java
@@ -44,6 +44,8 @@ import com.android.inputmethod.latin.utils.SpannableStringUtils;
import com.android.inputmethod.latin.utils.StringUtils;
import com.android.inputmethod.latin.utils.TextRange;
+import javax.annotation.Nonnull;
+
/**
* Enrichment class for InputConnection to simplify interaction and add functionality.
*
@@ -591,6 +593,7 @@ public final class RichInputConnection implements PrivateCommandPerformer {
}
@SuppressWarnings("unused")
+ @Nonnull
public NgramContext getNgramContextFromNthPreviousWord(
final SpacingAndPunctuations spacingAndPunctuations, final int n) {
mIC = mParent.getCurrentInputConnection();
diff --git a/java/src/com/android/inputmethod/latin/RichInputMethodManager.java b/java/src/com/android/inputmethod/latin/RichInputMethodManager.java
index 113a20483..894c115d8 100644
--- a/java/src/com/android/inputmethod/latin/RichInputMethodManager.java
+++ b/java/src/com/android/inputmethod/latin/RichInputMethodManager.java
@@ -38,6 +38,8 @@ import java.util.Collections;
import java.util.HashMap;
import java.util.List;
+import javax.annotation.Nonnull;
+
/**
* Enrichment class for InputMethodManager to simplify interaction and add functionality.
*/
@@ -301,12 +303,13 @@ public class RichInputMethodManager {
return INDEX_NOT_FOUND;
}
+ @Nonnull
public InputMethodSubtype getCurrentRawSubtype() {
return mImmWrapper.mImm.getCurrentInputMethodSubtype();
}
public RichInputMethodSubtype createCurrentRichInputMethodSubtype(
- final InputMethodSubtype rawSubtype) {
+ @Nonnull final InputMethodSubtype rawSubtype) {
return AdditionalFeaturesSettingUtils.createRichInputMethodSubtype(this, rawSubtype,
mContext);
}
diff --git a/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java b/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java
index 794475048..abdfdfe84 100644
--- a/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java
+++ b/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java
@@ -44,6 +44,8 @@ import java.util.Locale;
import java.util.Map;
import java.util.Set;
+import javax.annotation.Nonnull;
+
public final class SubtypeSwitcher {
private static boolean DBG = DebugFlags.DEBUG_ENABLED;
private static final String TAG = SubtypeSwitcher.class.getSimpleName();
@@ -169,7 +171,7 @@ public final class SubtypeSwitcher {
}
// Update the current subtype. LatinIME.onCurrentInputMethodSubtypeChanged calls this function.
- public void onSubtypeChanged(final InputMethodSubtype newSubtype) {
+ public void onSubtypeChanged(@Nonnull final InputMethodSubtype newSubtype) {
final RichInputMethodSubtype richSubtype =
mRichImm.createCurrentRichInputMethodSubtype(newSubtype);
if (DBG) {
diff --git a/java/src/com/android/inputmethod/latin/UserBinaryDictionary.java b/java/src/com/android/inputmethod/latin/UserBinaryDictionary.java
index 37dd3846c..2b7fb1748 100644
--- a/java/src/com/android/inputmethod/latin/UserBinaryDictionary.java
+++ b/java/src/com/android/inputmethod/latin/UserBinaryDictionary.java
@@ -28,7 +28,7 @@ import android.provider.UserDictionary.Words;
import android.text.TextUtils;
import android.util.Log;
-import com.android.inputmethod.annotations.UsedForTesting;
+import com.android.inputmethod.annotations.ExternallyReferenced;
import com.android.inputmethod.compat.UserDictionaryCompatUtils;
import com.android.inputmethod.latin.utils.SubtypeLocaleUtils;
@@ -101,7 +101,8 @@ public class UserBinaryDictionary extends ExpandableBinaryDictionary {
reloadDictionaryIfRequired();
}
- @UsedForTesting
+ // Note: This method is called by {@link DictionaryFacilitator} using Java reflection.
+ @ExternallyReferenced
public static UserBinaryDictionary getDictionary(final Context context, final Locale locale,
final File dictFile, final String dictNamePrefix) {
return new UserBinaryDictionary(context, locale, false /* alsoUseMoreRestrictiveLocales */,
diff --git a/java/src/com/android/inputmethod/latin/WordComposer.java b/java/src/com/android/inputmethod/latin/WordComposer.java
index 6530e6bb9..8ccaafdb9 100644
--- a/java/src/com/android/inputmethod/latin/WordComposer.java
+++ b/java/src/com/android/inputmethod/latin/WordComposer.java
@@ -182,7 +182,7 @@ public final class WordComposer {
* @return the processed event. Never null, but may be marked as consumed.
*/
@Nonnull
- public Event processEvent(final Event event) {
+ public Event processEvent(@Nonnull final Event event) {
final Event processedEvent = mCombinerChain.processEvent(mEvents, event);
// The retained state of the combiner chain may have changed while processing the event,
// so we need to update our cache.
diff --git a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
index 359ea12b5..5cc4a67e1 100644
--- a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
+++ b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
@@ -68,6 +68,8 @@ import java.util.ArrayList;
import java.util.TreeSet;
import java.util.concurrent.TimeUnit;
+import javax.annotation.Nonnull;
+
/**
* This class manages the input logic.
*/
@@ -454,8 +456,8 @@ public final class InputLogic {
* {@link com.android.inputmethod.keyboard.KeyboardSwitcher#getKeyboardShiftMode()}
* @return the complete transaction object
*/
- public InputTransaction onCodeInput(final SettingsValues settingsValues, final Event event,
- final int keyboardShiftMode,
+ public InputTransaction onCodeInput(final SettingsValues settingsValues,
+ @Nonnull final Event event, final int keyboardShiftMode,
// TODO: remove these arguments
final int currentKeyboardScriptId, final LatinIME.UIHandler handler) {
final Event processedEvent = mWordComposer.processEvent(event);
@@ -1373,7 +1375,7 @@ public final class InputLogic {
}
private void performAdditionToUserHistoryDictionary(final SettingsValues settingsValues,
- final String suggestion, final NgramContext ngramContext) {
+ final String suggestion, @Nonnull final NgramContext ngramContext) {
// If correction is not enabled, we don't add words to the user history dictionary.
// That's to avoid unintended additions in some sensitive fields, or fields that
// expect to receive non-words.
@@ -2301,7 +2303,7 @@ public final class InputLogic {
* Sets the UI operator for {@link TextDecorator}.
* @param uiOperator the UI operator which should be associated with {@link TextDecorator}.
*/
- public void setTextDecoratorUi(final TextDecoratorUiOperator uiOperator) {
+ public void setTextDecoratorUi(@Nonnull final TextDecoratorUiOperator uiOperator) {
mTextDecorator.setUiOperator(uiOperator);
}
diff --git a/java/src/com/android/inputmethod/latin/network/HttpUrlConnectionBuilder.java b/java/src/com/android/inputmethod/latin/network/HttpUrlConnectionBuilder.java
index 502f72f17..df54bf464 100644
--- a/java/src/com/android/inputmethod/latin/network/HttpUrlConnectionBuilder.java
+++ b/java/src/com/android/inputmethod/latin/network/HttpUrlConnectionBuilder.java
@@ -95,7 +95,7 @@ public class HttpUrlConnectionBuilder {
}
/**
- * Sets the connect timeout. Defaults to {@value #DEFAULT_TIMEOUT} milliseconds.
+ * Sets the connect timeout. Defaults to {@value #DEFAULT_TIMEOUT_MILLIS} milliseconds.
*
* TODO: Remove @UsedForTesting after this method is actually used.
*/
@@ -110,7 +110,7 @@ public class HttpUrlConnectionBuilder {
}
/**
- * Sets the read timeout. Defaults to {@value #DEFAULT_TIMEOUT} milliseconds.
+ * Sets the read timeout. Defaults to {@value #DEFAULT_TIMEOUT_MILLIS} milliseconds.
*
* TODO: Remove @UsedForTesting after this method is actually used.
*/
diff --git a/java/src/com/android/inputmethod/latin/personalization/ContextualDictionary.java b/java/src/com/android/inputmethod/latin/personalization/ContextualDictionary.java
index ac55b9333..39d9596ef 100644
--- a/java/src/com/android/inputmethod/latin/personalization/ContextualDictionary.java
+++ b/java/src/com/android/inputmethod/latin/personalization/ContextualDictionary.java
@@ -18,7 +18,7 @@ package com.android.inputmethod.latin.personalization;
import android.content.Context;
-import com.android.inputmethod.annotations.UsedForTesting;
+import com.android.inputmethod.annotations.ExternallyReferenced;
import com.android.inputmethod.latin.Dictionary;
import com.android.inputmethod.latin.ExpandableBinaryDictionary;
@@ -36,7 +36,9 @@ public class ContextualDictionary extends ExpandableBinaryDictionary {
clear();
}
- @UsedForTesting
+ // Note: This method is called by {@link DictionaryFacilitator} using Java reflection.
+ @SuppressWarnings("unused")
+ @ExternallyReferenced
public static ContextualDictionary getDictionary(final Context context, final Locale locale,
final File dictFile, final String dictNamePrefix) {
return new ContextualDictionary(context, locale, dictFile);
diff --git a/java/src/com/android/inputmethod/latin/personalization/PersonalizationDictionary.java b/java/src/com/android/inputmethod/latin/personalization/PersonalizationDictionary.java
index f2ad22ac7..33d1273f7 100644
--- a/java/src/com/android/inputmethod/latin/personalization/PersonalizationDictionary.java
+++ b/java/src/com/android/inputmethod/latin/personalization/PersonalizationDictionary.java
@@ -18,7 +18,7 @@ package com.android.inputmethod.latin.personalization;
import android.content.Context;
-import com.android.inputmethod.annotations.UsedForTesting;
+import com.android.inputmethod.annotations.ExternallyReferenced;
import com.android.inputmethod.latin.Dictionary;
import java.io.File;
@@ -33,7 +33,9 @@ public class PersonalizationDictionary extends DecayingExpandableBinaryDictionar
Dictionary.TYPE_PERSONALIZATION, null /* dictFile */);
}
- @UsedForTesting
+ // Note: This method is called by {@link DictionaryFacilitator} using Java reflection.
+ @SuppressWarnings("unused")
+ @ExternallyReferenced
public static PersonalizationDictionary getDictionary(final Context context,
final Locale locale, final File dictFile, final String dictNamePrefix) {
return PersonalizationHelper.getPersonalizationDictionary(context, locale);
diff --git a/java/src/com/android/inputmethod/latin/personalization/UserHistoryDictionary.java b/java/src/com/android/inputmethod/latin/personalization/UserHistoryDictionary.java
index e777c0bfa..cf1c7ea69 100644
--- a/java/src/com/android/inputmethod/latin/personalization/UserHistoryDictionary.java
+++ b/java/src/com/android/inputmethod/latin/personalization/UserHistoryDictionary.java
@@ -18,7 +18,7 @@ package com.android.inputmethod.latin.personalization;
import android.content.Context;
-import com.android.inputmethod.annotations.UsedForTesting;
+import com.android.inputmethod.annotations.ExternallyReferenced;
import com.android.inputmethod.latin.Constants;
import com.android.inputmethod.latin.Dictionary;
import com.android.inputmethod.latin.ExpandableBinaryDictionary;
@@ -28,6 +28,8 @@ import com.android.inputmethod.latin.utils.DistracterFilter;
import java.io.File;
import java.util.Locale;
+import javax.annotation.Nonnull;
+
/**
* Locally gathers stats about the words user types and various other signals like auto-correction
* cancellation or manual picks. This allows the keyboard to adapt to the typist over time.
@@ -41,7 +43,9 @@ public class UserHistoryDictionary extends DecayingExpandableBinaryDictionaryBas
Dictionary.TYPE_USER_HISTORY, null /* dictFile */);
}
- @UsedForTesting
+ // Note: This method is called by {@link DictionaryFacilitator} using Java reflection.
+ @SuppressWarnings("unused")
+ @ExternallyReferenced
public static UserHistoryDictionary getDictionary(final Context context, final Locale locale,
final File dictFile, final String dictNamePrefix) {
return PersonalizationHelper.getUserHistoryDictionary(context, locale);
@@ -58,8 +62,8 @@ public class UserHistoryDictionary extends DecayingExpandableBinaryDictionaryBas
* @param distracterFilter the filter to check whether the word is a distracter
*/
public static void addToDictionary(final ExpandableBinaryDictionary userHistoryDictionary,
- final NgramContext ngramContext, final String word, final boolean isValid,
- final int timestamp, final DistracterFilter distracterFilter) {
+ @Nonnull final NgramContext ngramContext, final String word, final boolean isValid,
+ final int timestamp, @Nonnull final DistracterFilter distracterFilter) {
if (word.length() > Constants.DICTIONARY_MAX_WORD_LENGTH) {
return;
}
diff --git a/java/src/com/android/inputmethod/latin/settings/Settings.java b/java/src/com/android/inputmethod/latin/settings/Settings.java
index c40ffb653..5e23693d2 100644
--- a/java/src/com/android/inputmethod/latin/settings/Settings.java
+++ b/java/src/com/android/inputmethod/latin/settings/Settings.java
@@ -40,6 +40,8 @@ import java.util.Locale;
import java.util.Set;
import java.util.concurrent.locks.ReentrantLock;
+import javax.annotation.Nonnull;
+
public final class Settings implements SharedPreferences.OnSharedPreferenceChangeListener {
private static final String TAG = Settings.class.getSimpleName();
// Settings screens
@@ -175,7 +177,7 @@ public final class Settings implements SharedPreferences.OnSharedPreferenceChang
}
public void loadSettings(final Context context, final Locale locale,
- final InputAttributes inputAttributes) {
+ @Nonnull final InputAttributes inputAttributes) {
mSettingsValuesLock.lock();
mContext = context;
try {
diff --git a/java/src/com/android/inputmethod/latin/settings/SettingsValues.java b/java/src/com/android/inputmethod/latin/settings/SettingsValues.java
index 5b99652b8..da8810fae 100644
--- a/java/src/com/android/inputmethod/latin/settings/SettingsValues.java
+++ b/java/src/com/android/inputmethod/latin/settings/SettingsValues.java
@@ -37,6 +37,8 @@ import com.android.inputmethod.latin.utils.TargetPackageInfoGetterTask;
import java.util.Arrays;
import java.util.Locale;
+import javax.annotation.Nonnull;
+
/**
* When you call the constructor of this class, you may want to change the current system locale by
* using {@link com.android.inputmethod.latin.utils.RunInLocale}.
@@ -85,6 +87,7 @@ public class SettingsValues {
public final int mScreenMetrics;
// From the input box
+ @Nonnull
public final InputAttributes mInputAttributes;
// Deduced settings
@@ -115,7 +118,7 @@ public class SettingsValues {
public final float mKeyPreviewDismissEndYScale;
public SettingsValues(final Context context, final SharedPreferences prefs, final Resources res,
- final InputAttributes inputAttributes) {
+ @Nonnull final InputAttributes inputAttributes) {
mLocale = res.getConfiguration().locale;
// Get the resources
mDelayInMillisecondsToUpdateOldSuggestions =
@@ -123,12 +126,7 @@ public class SettingsValues {
mSpacingAndPunctuations = new SpacingAndPunctuations(res);
// Store the input attributes
- if (null == inputAttributes) {
- mInputAttributes = new InputAttributes(
- null, false /* isFullscreenMode */, context.getPackageName());
- } else {
- mInputAttributes = inputAttributes;
- }
+ mInputAttributes = inputAttributes;
// Get the settings preferences
mAutoCap = prefs.getBoolean(Settings.PREF_AUTO_CAP, true);
diff --git a/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerSession.java b/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerSession.java
index 8393b306c..ac395bf02 100644
--- a/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerSession.java
+++ b/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerSession.java
@@ -16,8 +16,10 @@
package com.android.inputmethod.latin.spellcheck;
+import android.annotation.TargetApi;
import android.content.res.Resources;
import android.os.Binder;
+import android.os.Build;
import android.text.TextUtils;
import android.util.Log;
import android.view.textservice.SentenceSuggestionsInfo;
@@ -42,6 +44,7 @@ public final class AndroidSpellCheckerSession extends AndroidWordLevelSpellCheck
mResources = service.getResources();
}
+ @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
private SentenceSuggestionsInfo fixWronglyInvalidatedWordWithSingleQuote(TextInfo ti,
SentenceSuggestionsInfo ssi) {
final CharSequence typedText = TextInfoCompatUtils.getCharSequenceOrString(ti);
@@ -149,7 +152,7 @@ public final class AndroidSpellCheckerSession extends AndroidWordLevelSpellCheck
* @param textInfos an array of the text metadata
* @param suggestionsLimit the maximum number of suggestions to be returned
* @return an array of {@link SentenceSuggestionsInfo} returned by
- * {@link SpellCheckerService.Session#onGetSuggestions(TextInfo, int)}
+ * {@link android.service.textservice.SpellCheckerService.Session#onGetSuggestions(TextInfo, int)}
*/
private SentenceSuggestionsInfo[] splitAndSuggest(TextInfo[] textInfos, int suggestionsLimit) {
if (textInfos == null || textInfos.length == 0) {
diff --git a/java/src/com/android/inputmethod/latin/spellcheck/SpellCheckerSettingsActivity.java b/java/src/com/android/inputmethod/latin/spellcheck/SpellCheckerSettingsActivity.java
index df9a76119..294666b8b 100644
--- a/java/src/com/android/inputmethod/latin/spellcheck/SpellCheckerSettingsActivity.java
+++ b/java/src/com/android/inputmethod/latin/spellcheck/SpellCheckerSettingsActivity.java
@@ -18,7 +18,9 @@ package com.android.inputmethod.latin.spellcheck;
import com.android.inputmethod.latin.utils.FragmentUtils;
+import android.annotation.TargetApi;
import android.content.Intent;
+import android.os.Build;
import android.os.Bundle;
import android.preference.PreferenceActivity;
@@ -41,8 +43,8 @@ public final class SpellCheckerSettingsActivity extends PreferenceActivity {
return modIntent;
}
- // TODO: Uncomment the override annotation once we start using SDK version 19.
- // @Override
+ @TargetApi(Build.VERSION_CODES.KITKAT)
+ @Override
public boolean isValidFragment(String fragmentName) {
return FragmentUtils.isValidFragment(fragmentName);
}
diff --git a/java/src/com/android/inputmethod/latin/userdictionary/UserDictionaryList.java b/java/src/com/android/inputmethod/latin/userdictionary/UserDictionaryList.java
index 624783a70..90e4faafd 100644
--- a/java/src/com/android/inputmethod/latin/userdictionary/UserDictionaryList.java
+++ b/java/src/com/android/inputmethod/latin/userdictionary/UserDictionaryList.java
@@ -47,12 +47,12 @@ public class UserDictionaryList extends PreferenceFragment {
"android.settings.USER_DICTIONARY_SETTINGS";
@Override
- public void onCreate(Bundle icicle) {
+ public void onCreate(final Bundle icicle) {
super.onCreate(icicle);
setPreferenceScreen(getPreferenceManager().createPreferenceScreen(getActivity()));
}
- public static TreeSet<String> getUserDictionaryLocalesSet(Activity activity) {
+ public static TreeSet<String> getUserDictionaryLocalesSet(final Activity activity) {
final Cursor cursor = activity.getContentResolver().query(UserDictionary.Words.CONTENT_URI,
new String[] { UserDictionary.Words.LOCALE },
null, null, null);
@@ -108,7 +108,7 @@ public class UserDictionaryList extends PreferenceFragment {
* Creates the entries that allow the user to go into the user dictionary for each locale.
* @param userDictGroup The group to put the settings in.
*/
- protected void createUserDictSettings(PreferenceGroup userDictGroup) {
+ protected void createUserDictSettings(final PreferenceGroup userDictGroup) {
final Activity activity = getActivity();
userDictGroup.removeAll();
final TreeSet<String> localeSet =
@@ -121,10 +121,10 @@ public class UserDictionaryList extends PreferenceFragment {
}
if (localeSet.isEmpty()) {
- userDictGroup.addPreference(createUserDictionaryPreference(null, activity));
+ userDictGroup.addPreference(createUserDictionaryPreference(null));
} else {
for (String locale : localeSet) {
- userDictGroup.addPreference(createUserDictionaryPreference(locale, activity));
+ userDictGroup.addPreference(createUserDictionaryPreference(locale));
}
}
}
@@ -134,7 +134,7 @@ public class UserDictionaryList extends PreferenceFragment {
* @param locale The locale for which this user dictionary is for.
* @return The corresponding preference.
*/
- protected Preference createUserDictionaryPreference(String locale, Activity activity) {
+ protected Preference createUserDictionaryPreference(final String locale) {
final Preference newPref = new Preference(getActivity());
final Intent intent = new Intent(USER_DICTIONARY_SETTINGS_INTENT_ACTION);
if (null == locale) {
diff --git a/java/src/com/android/inputmethod/latin/userdictionary/UserDictionarySettings.java b/java/src/com/android/inputmethod/latin/userdictionary/UserDictionarySettings.java
index 9d89d57bc..727485724 100644
--- a/java/src/com/android/inputmethod/latin/userdictionary/UserDictionarySettings.java
+++ b/java/src/com/android/inputmethod/latin/userdictionary/UserDictionarySettings.java
@@ -186,7 +186,7 @@ public class UserDictionarySettings extends ListFragment {
private ListAdapter createAdapter() {
return new MyAdapter(getActivity(), R.layout.user_dictionary_item, mCursor,
- ADAPTER_FROM, ADAPTER_TO, this);
+ ADAPTER_FROM, ADAPTER_TO);
}
@Override
@@ -288,7 +288,7 @@ public class UserDictionarySettings extends ListFragment {
private ViewBinder mViewBinder = new ViewBinder() {
@Override
- public boolean setViewValue(View v, Cursor c, int columnIndex) {
+ public boolean setViewValue(final View v, final Cursor c, final int columnIndex) {
if (!IS_SHORTCUT_API_SUPPORTED) {
// just let SimpleCursorAdapter set the view values
return false;
@@ -309,10 +309,9 @@ public class UserDictionarySettings extends ListFragment {
}
};
- @SuppressWarnings("deprecation")
- public MyAdapter(Context context, int layout, Cursor c, String[] from, int[] to,
- UserDictionarySettings settings) {
- super(context, layout, c, from, to);
+ public MyAdapter(final Context context, final int layout, final Cursor c,
+ final String[] from, final int[] to) {
+ super(context, layout, c, from, to, 0 /* flags */);
if (null != c) {
final String alphabet = context.getString(R.string.user_dict_fast_scroll_alphabet);
@@ -323,12 +322,12 @@ public class UserDictionarySettings extends ListFragment {
}
@Override
- public int getPositionForSection(int section) {
+ public int getPositionForSection(final int section) {
return null == mIndexer ? 0 : mIndexer.getPositionForSection(section);
}
@Override
- public int getSectionForPosition(int position) {
+ public int getSectionForPosition(final int position) {
return null == mIndexer ? 0 : mIndexer.getSectionForPosition(position);
}
diff --git a/java/src/com/android/inputmethod/latin/utils/DistracterFilter.java b/java/src/com/android/inputmethod/latin/utils/DistracterFilter.java
index 355d00dac..525212c96 100644
--- a/java/src/com/android/inputmethod/latin/utils/DistracterFilter.java
+++ b/java/src/com/android/inputmethod/latin/utils/DistracterFilter.java
@@ -16,14 +16,16 @@
package com.android.inputmethod.latin.utils;
-import java.util.List;
-import java.util.Locale;
-
import android.view.inputmethod.InputMethodSubtype;
import com.android.inputmethod.annotations.UsedForTesting;
import com.android.inputmethod.latin.NgramContext;
+import java.util.List;
+import java.util.Locale;
+
+import javax.annotation.Nonnull;
+
public interface DistracterFilter {
/**
* Determine whether a word is a distracter to words in dictionaries.
@@ -68,8 +70,9 @@ public interface DistracterFilter {
public static boolean shouldBeHandledAsOov(final int handlingType) {
return (handlingType & SHOULD_BE_HANDLED_AS_OOV) != 0;
}
- };
+ }
+ @Nonnull
public static final DistracterFilter EMPTY_DISTRACTER_FILTER = new DistracterFilter() {
@Override
public boolean isDistracterToWordsInDictionaries(NgramContext ngramContext,
diff --git a/java/src/com/android/inputmethod/latin/utils/NgramContextUtils.java b/java/src/com/android/inputmethod/latin/utils/NgramContextUtils.java
index 95a1f0fb2..ba436777d 100644
--- a/java/src/com/android/inputmethod/latin/utils/NgramContextUtils.java
+++ b/java/src/com/android/inputmethod/latin/utils/NgramContextUtils.java
@@ -16,14 +16,16 @@
package com.android.inputmethod.latin.utils;
-import java.util.Arrays;
-import java.util.regex.Pattern;
-
import com.android.inputmethod.latin.Constants;
import com.android.inputmethod.latin.NgramContext;
import com.android.inputmethod.latin.NgramContext.WordInfo;
import com.android.inputmethod.latin.settings.SpacingAndPunctuations;
+import java.util.Arrays;
+import java.util.regex.Pattern;
+
+import javax.annotation.Nonnull;
+
public final class NgramContextUtils {
private NgramContextUtils() {
// Intentional empty constructor for utility class.
@@ -52,6 +54,7 @@ public final class NgramContextUtils {
// (n = 2) "abc|" -> beginning-of-sentence
// (n = 2) "abc |" -> beginning-of-sentence
// (n = 2) "abc. def|" -> beginning-of-sentence
+ @Nonnull
public static NgramContext getNgramContextFromNthPreviousWord(final CharSequence prev,
final SpacingAndPunctuations spacingAndPunctuations, final int n) {
if (prev == null) return NgramContext.EMPTY_PREV_WORDS_INFO;
diff --git a/java/src/com/android/inputmethod/latin/utils/ResourceUtils.java b/java/src/com/android/inputmethod/latin/utils/ResourceUtils.java
index 093c5a6c1..d1fc642f3 100644
--- a/java/src/com/android/inputmethod/latin/utils/ResourceUtils.java
+++ b/java/src/com/android/inputmethod/latin/utils/ResourceUtils.java
@@ -110,7 +110,6 @@ public final class ResourceUtils {
* are true for the specified key value pairs.
*
* For example, "condition,constant" has the following format.
- * (See {@link ResourceUtilsTests#testFindConstantForKeyValuePairsRegexp()})
* - HARDWARE=mako,constantForNexus4
* - MODEL=Nexus 4:MANUFACTURER=LGE,constantForNexus4
* - ,defaultConstant
@@ -119,6 +118,7 @@ public final class ResourceUtils {
* @param conditionConstantArray an array of "condition,constant" elements to be searched.
* @return the constant part of the matched "condition,constant" element. Returns null if no
* condition matches.
+ * @see com.android.inputmethod.latin.utils.ResourceUtilsTests#testFindConstantForKeyValuePairsRegexp()
*/
@UsedForTesting
static String findConstantForKeyValuePairs(final HashMap<String, String> keyValuePairs,
diff --git a/java/src/com/android/inputmethod/latin/utils/StringUtils.java b/java/src/com/android/inputmethod/latin/utils/StringUtils.java
index bbcef990d..bc068ac53 100644
--- a/java/src/com/android/inputmethod/latin/utils/StringUtils.java
+++ b/java/src/com/android/inputmethod/latin/utils/StringUtils.java
@@ -521,12 +521,12 @@ public final class StringUtils {
* {@code charSequence.toString().split(regex, preserveTrailingEmptySegments ? -1 : 0)}
* except that the spans are preserved in the result array.
* </p>
- * @param input the character sequence to be split.
+ * @param charSequence the character sequence to be split.
* @param regex the regex pattern to be used as the separator.
* @param preserveTrailingEmptySegments {@code true} to preserve the trailing empty
* segments. Otherwise, trailing empty segments will be removed before being returned.
- * @return the array which contains the result. All the spans in the {@param input} is
- * preserved.
+ * @return the array which contains the result. All the spans in the <code>charSequence</code>
+ * is preserved.
*/
@UsedForTesting
public static CharSequence[] split(final CharSequence charSequence, final String regex,
diff --git a/tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderUtils.java b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderUtils.java
index 21411f24c..120b96bc6 100644
--- a/tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderUtils.java
+++ b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderUtils.java
@@ -165,7 +165,7 @@ public final class BinaryDictDecoderUtils {
*
* @param codePoints the code point array to write.
* @param buffer the byte buffer to write to.
- * @param index the index in buffer to write the character array to.
+ * @param fromIndex the index in buffer to write the character array to.
* @param codePointToOneByteCodeMap the map to convert the code point.
* @return the index after the last character.
*/
diff --git a/tests/src/com/android/inputmethod/latin/makedict/BinaryDictEncoderUtils.java b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictEncoderUtils.java
index a3a71a45e..60e38250f 100644
--- a/tests/src/com/android/inputmethod/latin/makedict/BinaryDictEncoderUtils.java
+++ b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictEncoderUtils.java
@@ -535,7 +535,7 @@ public class BinaryDictEncoderUtils {
* Helper method to write a children position to a file.
*
* @param buffer the buffer to write to.
- * @param index the index in the buffer to write the address to.
+ * @param fromIndex the index in the buffer to write the address to.
* @param position the position to write.
* @return the size in bytes the address actually took.
*/
diff --git a/tests/src/com/android/inputmethod/latin/makedict/BinaryDictIOUtils.java b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictIOUtils.java
index 5e90387f7..0ff4c21fb 100644
--- a/tests/src/com/android/inputmethod/latin/makedict/BinaryDictIOUtils.java
+++ b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictIOUtils.java
@@ -44,7 +44,7 @@ public final class BinaryDictIOUtils {
public static DictDecoder getDictDecoder(final File dictFile, final long offset,
final long length, final int bufferType) {
if (dictFile.isDirectory()) {
- return new Ver4DictDecoder(dictFile, bufferType);
+ return new Ver4DictDecoder(dictFile);
} else if (dictFile.isFile()) {
return new Ver2DictDecoder(dictFile, offset, length, bufferType);
}
@@ -54,7 +54,7 @@ public final class BinaryDictIOUtils {
public static DictDecoder getDictDecoder(final File dictFile, final long offset,
final long length, final DictionaryBufferFactory factory) {
if (dictFile.isDirectory()) {
- return new Ver4DictDecoder(dictFile, factory);
+ return new Ver4DictDecoder(dictFile);
} else if (dictFile.isFile()) {
return new Ver2DictDecoder(dictFile, offset, length, factory);
}
diff --git a/tests/src/com/android/inputmethod/latin/makedict/Ver4DictDecoder.java b/tests/src/com/android/inputmethod/latin/makedict/Ver4DictDecoder.java
index 7c1ae2fde..7e54ce986 100644
--- a/tests/src/com/android/inputmethod/latin/makedict/Ver4DictDecoder.java
+++ b/tests/src/com/android/inputmethod/latin/makedict/Ver4DictDecoder.java
@@ -33,12 +33,7 @@ public class Ver4DictDecoder extends AbstractDictDecoder {
final File mDictDirectory;
@UsedForTesting
- /* package */ Ver4DictDecoder(final File dictDirectory, final int factoryFlag) {
- this(dictDirectory, null /* factory */);
- }
-
- @UsedForTesting
- /* package */ Ver4DictDecoder(final File dictDirectory, final DictionaryBufferFactory factory) {
+ /* package */ Ver4DictDecoder(final File dictDirectory) {
mDictDirectory = dictDirectory;
}
diff --git a/tests/src/com/android/inputmethod/latin/utils/CollectionUtilsTests.java b/tests/src/com/android/inputmethod/latin/utils/CollectionUtilsTests.java
index 8bda6726e..3feb60ec7 100644
--- a/tests/src/com/android/inputmethod/latin/utils/CollectionUtilsTests.java
+++ b/tests/src/com/android/inputmethod/latin/utils/CollectionUtilsTests.java
@@ -29,7 +29,7 @@ import java.util.Collections;
@SmallTest
public class CollectionUtilsTests extends AndroidTestCase {
/**
- * Tests that {@link CollectionUtils#arrayAsList(E[],int,int)} gives the expected
+ * Tests that {@link CollectionUtils#arrayAsList(Object[],int,int)} gives the expected
* results for a few valid inputs.
*/
public void testArrayAsList() {
@@ -42,7 +42,7 @@ public class CollectionUtilsTests extends AndroidTestCase {
}
/**
- * Tests that {@link CollectionUtils#isEmpty(java.util.Collection)} gives the expected
+ * Tests that {@link CollectionUtils#isNullOrEmpty(java.util.Collection)} gives the expected
* results for a few cases.
*/
public void testIsNullOrEmpty() {
diff --git a/tools/dicttool/compat/android/test/MoreAsserts.java b/tools/dicttool/compat/android/test/MoreAsserts.java
deleted file mode 100644
index f56420b9c..000000000
--- a/tools/dicttool/compat/android/test/MoreAsserts.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2013 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.test;
-
-import junit.framework.Assert;
-
-/**
- * This is a compatibility class that aims at emulating android.test.MoreAsserts from the
- * Android library as simply as possible, and only to the extent that is used by the client classes.
- * Its purpose is to provide compatibility without having to pull the whole Android library.
- */
-public class MoreAsserts {
- public static void assertNotEqual(Object unexpected, Object actual) {
- if (equal(unexpected, actual)) {
- Assert.fail("expected not to be:<" + unexpected + ">");
- }
- }
- private static boolean equal(Object a, Object b) {
- return a == b || (a != null && a.equals(b));
- }
-}
diff --git a/tools/dicttool/compat/com/android/inputmethod/keyboard/Keyboard.java b/tools/dicttool/compat/com/android/inputmethod/keyboard/Keyboard.java
index 61b209f4d..3d6bfd0a9 100644
--- a/tools/dicttool/compat/com/android/inputmethod/keyboard/Keyboard.java
+++ b/tools/dicttool/compat/com/android/inputmethod/keyboard/Keyboard.java
@@ -16,6 +16,7 @@
package com.android.inputmethod.keyboard;
+@SuppressWarnings("unused")
public class Keyboard {
private final Key KEY = new Key();
public final Key getKey(final int i) { return KEY; }
diff --git a/tools/dicttool/src/com/android/inputmethod/latin/dicttool/Info.java b/tools/dicttool/src/com/android/inputmethod/latin/dicttool/Info.java
index 3df37373a..b8a64e31a 100644
--- a/tools/dicttool/src/com/android/inputmethod/latin/dicttool/Info.java
+++ b/tools/dicttool/src/com/android/inputmethod/latin/dicttool/Info.java
@@ -64,8 +64,7 @@ public class Info extends Dicttool.Command {
+ " whitelist entries)");
}
- private static void showWordInfo(final FusionDictionary dict, final String word,
- final boolean plumbing) {
+ private static void showWordInfo(final FusionDictionary dict, final String word) {
final PtNode ptNode = FusionDictionary.findWordInTree(dict.mRootNodeArray, word);
if (null == ptNode) {
System.out.println(word + " is not in the dictionary");
@@ -124,7 +123,7 @@ public class Info extends Dicttool.Command {
showInfo(dict, plumbing);
} else {
for (int i = 1; i < mArgs.length; ++i) {
- showWordInfo(dict, mArgs[i], plumbing);
+ showWordInfo(dict, mArgs[i]);
}
}
}
diff --git a/tools/dicttool/src/com/android/inputmethod/latin/personalization/PersonalizationHelper.java b/tools/dicttool/src/com/android/inputmethod/latin/personalization/PersonalizationHelper.java
index a4ad6b514..dcc4e1972 100644
--- a/tools/dicttool/src/com/android/inputmethod/latin/personalization/PersonalizationHelper.java
+++ b/tools/dicttool/src/com/android/inputmethod/latin/personalization/PersonalizationHelper.java
@@ -16,6 +16,7 @@
package com.android.inputmethod.latin.personalization;
+@SuppressWarnings("unused")
public class PersonalizationHelper {
public static void currentTimeChangedForTesting(final int currentTimestamp) {
}