am b6c314e4: Merge "Clean up some compiler warnings" into jb-dev
* commit 'b6c314e4caf3b86c2bafcea865dc2cdd9aa38735': Clean up some compiler warningsmain
commit
41cf0ced38
|
@ -452,12 +452,6 @@ public class PointerTracker {
|
||||||
return newKey;
|
return newKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Key onUpKey(int x, int y, long eventTime) {
|
|
||||||
mUpTime = eventTime;
|
|
||||||
mCurrentKey = null;
|
|
||||||
return onMoveKeyInternal(x, y);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void processMotionEvent(int action, int x, int y, long eventTime,
|
public void processMotionEvent(int action, int x, int y, long eventTime,
|
||||||
KeyEventHandler handler) {
|
KeyEventHandler handler) {
|
||||||
switch (action) {
|
switch (action) {
|
||||||
|
|
|
@ -34,6 +34,7 @@ import com.android.inputmethod.keyboard.Keyboard;
|
||||||
*
|
*
|
||||||
* @deprecated Use {@link ContactsBinaryDictionary}.
|
* @deprecated Use {@link ContactsBinaryDictionary}.
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public class ContactsDictionary extends ExpandableDictionary {
|
public class ContactsDictionary extends ExpandableDictionary {
|
||||||
|
|
||||||
private static final String[] PROJECTION = {
|
private static final String[] PROJECTION = {
|
||||||
|
|
|
@ -33,7 +33,7 @@ public abstract class Dictionary {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface to be implemented by classes requesting words to be fetched from the dictionary.
|
* Interface to be implemented by classes requesting words to be fetched from the dictionary.
|
||||||
* @see #getWords(WordComposer, WordCallback, ProximityInfo)
|
* @see #getWords(WordComposer, CharSequence, WordCallback, ProximityInfo)
|
||||||
*/
|
*/
|
||||||
public interface WordCallback {
|
public interface WordCallback {
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -89,7 +89,6 @@ public class DictionaryFactory {
|
||||||
/**
|
/**
|
||||||
* Initializes a dictionary from a raw resource file
|
* Initializes a dictionary from a raw resource file
|
||||||
* @param context application context for reading resources
|
* @param context application context for reading resources
|
||||||
* @param resId the resource containing the raw binary dictionary
|
|
||||||
* @param locale the locale to use for the resource
|
* @param locale the locale to use for the resource
|
||||||
* @return an initialized instance of BinaryDictionary
|
* @return an initialized instance of BinaryDictionary
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -309,7 +309,8 @@ public class ExpandableDictionary extends Dictionary {
|
||||||
* @param word the word to insert, as an array of code points
|
* @param word the word to insert, as an array of code points
|
||||||
* @param depth the depth of the node in the tree
|
* @param depth the depth of the node in the tree
|
||||||
* @param finalFreq the frequency for this word
|
* @param finalFreq the frequency for this word
|
||||||
* @return whether there is still space for more words. {@see Dictionary.WordCallback#addWord}.
|
* @return whether there is still space for more words.
|
||||||
|
* @see Dictionary.WordCallback#addWord(char[], int, int, int, int, int)
|
||||||
*/
|
*/
|
||||||
private boolean addWordAndShortcutsFromNode(final Node node, final char[] word, final int depth,
|
private boolean addWordAndShortcutsFromNode(final Node node, final char[] word, final int depth,
|
||||||
final int finalFreq, final WordCallback callback) {
|
final int finalFreq, final WordCallback callback) {
|
||||||
|
|
|
@ -54,7 +54,7 @@ import java.util.Map;
|
||||||
* This class logs operations on the IME keyboard, including what the user has typed.
|
* This class logs operations on the IME keyboard, including what the user has typed.
|
||||||
* Data is stored locally in a file in app-specific storage.
|
* Data is stored locally in a file in app-specific storage.
|
||||||
*
|
*
|
||||||
* This functionality is off by default. See {@link ProductionFlag.IS_EXPERIMENTAL}.
|
* This functionality is off by default. See {@link ProductionFlag#IS_EXPERIMENTAL}.
|
||||||
*/
|
*/
|
||||||
public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChangeListener {
|
public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChangeListener {
|
||||||
private static final String TAG = ResearchLogger.class.getSimpleName();
|
private static final String TAG = ResearchLogger.class.getSimpleName();
|
||||||
|
|
|
@ -35,6 +35,7 @@ import java.util.Arrays;
|
||||||
*
|
*
|
||||||
* @deprecated Use {@link UserBinaryDictionary}.
|
* @deprecated Use {@link UserBinaryDictionary}.
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public class UserDictionary extends ExpandableDictionary {
|
public class UserDictionary extends ExpandableDictionary {
|
||||||
|
|
||||||
// TODO: use Words.SHORTCUT when it's public in the SDK
|
// TODO: use Words.SHORTCUT when it's public in the SDK
|
||||||
|
|
|
@ -882,9 +882,9 @@ public class BinaryDictInputOutput {
|
||||||
final int indexOfShortcutByteSize = index;
|
final int indexOfShortcutByteSize = index;
|
||||||
index += GROUP_SHORTCUT_LIST_SIZE_SIZE;
|
index += GROUP_SHORTCUT_LIST_SIZE_SIZE;
|
||||||
groupAddress += GROUP_SHORTCUT_LIST_SIZE_SIZE;
|
groupAddress += GROUP_SHORTCUT_LIST_SIZE_SIZE;
|
||||||
final Iterator shortcutIterator = group.mShortcutTargets.iterator();
|
final Iterator<WeightedString> shortcutIterator = group.mShortcutTargets.iterator();
|
||||||
while (shortcutIterator.hasNext()) {
|
while (shortcutIterator.hasNext()) {
|
||||||
final WeightedString target = (WeightedString)shortcutIterator.next();
|
final WeightedString target = shortcutIterator.next();
|
||||||
++groupAddress;
|
++groupAddress;
|
||||||
int shortcutFlags = makeShortcutFlags(shortcutIterator.hasNext(),
|
int shortcutFlags = makeShortcutFlags(shortcutIterator.hasNext(),
|
||||||
target.mFrequency);
|
target.mFrequency);
|
||||||
|
@ -902,9 +902,9 @@ public class BinaryDictInputOutput {
|
||||||
}
|
}
|
||||||
// Write bigrams
|
// Write bigrams
|
||||||
if (null != group.mBigrams) {
|
if (null != group.mBigrams) {
|
||||||
final Iterator bigramIterator = group.mBigrams.iterator();
|
final Iterator<WeightedString> bigramIterator = group.mBigrams.iterator();
|
||||||
while (bigramIterator.hasNext()) {
|
while (bigramIterator.hasNext()) {
|
||||||
final WeightedString bigram = (WeightedString)bigramIterator.next();
|
final WeightedString bigram = bigramIterator.next();
|
||||||
final CharGroup target =
|
final CharGroup target =
|
||||||
FusionDictionary.findWordInTree(dict.mRoot, bigram.mWord);
|
FusionDictionary.findWordInTree(dict.mRoot, bigram.mWord);
|
||||||
final int addressOfBigram = target.mCachedAddress;
|
final int addressOfBigram = target.mCachedAddress;
|
||||||
|
|
|
@ -296,7 +296,6 @@ public class FusionDictionary implements Iterable<Word> {
|
||||||
* @param word the word to add.
|
* @param word the word to add.
|
||||||
* @param frequency the frequency of the word, in the range [0..255].
|
* @param frequency the frequency of the word, in the range [0..255].
|
||||||
* @param shortcutTargets a list of shortcut targets for this word, or null.
|
* @param shortcutTargets a list of shortcut targets for this word, or null.
|
||||||
* @param bigrams a list of bigrams, or null.
|
|
||||||
*/
|
*/
|
||||||
public void add(final String word, final int frequency,
|
public void add(final String word, final int frequency,
|
||||||
final ArrayList<WeightedString> shortcutTargets) {
|
final ArrayList<WeightedString> shortcutTargets) {
|
||||||
|
@ -435,6 +434,8 @@ public class FusionDictionary implements Iterable<Word> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static int ARRAYS_ARE_EQUAL = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Custom comparison of two int arrays taken to contain character codes.
|
* Custom comparison of two int arrays taken to contain character codes.
|
||||||
*
|
*
|
||||||
|
@ -450,7 +451,6 @@ public class FusionDictionary implements Iterable<Word> {
|
||||||
* @param dstOffset the offset in the right-hand side string.
|
* @param dstOffset the offset in the right-hand side string.
|
||||||
* @return the index at which the strings differ, or ARRAYS_ARE_EQUAL = 0 if they don't.
|
* @return the index at which the strings differ, or ARRAYS_ARE_EQUAL = 0 if they don't.
|
||||||
*/
|
*/
|
||||||
private static int ARRAYS_ARE_EQUAL = 0;
|
|
||||||
private static int compareArrays(final int[] src, final int[] dst, int dstOffset) {
|
private static int compareArrays(final int[] src, final int[] dst, int dstOffset) {
|
||||||
// We do NOT test the first char, because we come from a method that already
|
// We do NOT test the first char, because we come from a method that already
|
||||||
// tested it.
|
// tested it.
|
||||||
|
@ -469,6 +469,7 @@ public class FusionDictionary implements Iterable<Word> {
|
||||||
* This comparator imposes orderings that are inconsistent with equals.
|
* This comparator imposes orderings that are inconsistent with equals.
|
||||||
*/
|
*/
|
||||||
static private class CharGroupComparator implements java.util.Comparator<CharGroup> {
|
static private class CharGroupComparator implements java.util.Comparator<CharGroup> {
|
||||||
|
@Override
|
||||||
public int compare(CharGroup c1, CharGroup c2) {
|
public int compare(CharGroup c1, CharGroup c2) {
|
||||||
if (c1.mChars[0] == c2.mChars[0]) return 0;
|
if (c1.mChars[0] == c2.mChars[0]) return 0;
|
||||||
return c1.mChars[0] < c2.mChars[0] ? -1 : 1;
|
return c1.mChars[0] < c2.mChars[0] ? -1 : 1;
|
||||||
|
@ -487,6 +488,8 @@ public class FusionDictionary implements Iterable<Word> {
|
||||||
return result >= 0 ? result : -result - 1;
|
return result >= 0 ? result : -result - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static int CHARACTER_NOT_FOUND = -1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find the index of a char in a node, if it exists.
|
* Find the index of a char in a node, if it exists.
|
||||||
*
|
*
|
||||||
|
@ -494,7 +497,6 @@ public class FusionDictionary implements Iterable<Word> {
|
||||||
* @param character the character to search for.
|
* @param character the character to search for.
|
||||||
* @return the position of the character if it's there, or CHARACTER_NOT_FOUND = -1 else.
|
* @return the position of the character if it's there, or CHARACTER_NOT_FOUND = -1 else.
|
||||||
*/
|
*/
|
||||||
private static int CHARACTER_NOT_FOUND = -1;
|
|
||||||
private static int findIndexOfChar(final Node node, int character) {
|
private static int findIndexOfChar(final Node node, int character) {
|
||||||
final int insertionIndex = findInsertionIndex(node, character);
|
final int insertionIndex = findInsertionIndex(node, character);
|
||||||
if (node.mData.size() <= insertionIndex) return CHARACTER_NOT_FOUND;
|
if (node.mData.size() <= insertionIndex) return CHARACTER_NOT_FOUND;
|
||||||
|
|
|
@ -499,10 +499,6 @@ public class AndroidSpellCheckerService extends SpellCheckerService
|
||||||
}
|
}
|
||||||
mUnigramSuggestionsInfoCache.put(query, new SuggestionsParams(suggestions, flags));
|
mUnigramSuggestionsInfoCache.put(query, new SuggestionsParams(suggestions, flags));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void remove(String key) {
|
|
||||||
mUnigramSuggestionsInfoCache.remove(key);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AndroidSpellCheckerSession(final AndroidSpellCheckerService service) {
|
AndroidSpellCheckerSession(final AndroidSpellCheckerService service) {
|
||||||
|
|
Loading…
Reference in New Issue