am ab72a97d: Cleanup unused import

* commit 'ab72a97d7ce44230a0c824797d1675a5ca354a56':
  Cleanup unused import
This commit is contained in:
Tadashi G. Takaoka 2011-10-03 22:11:31 -07:00 committed by Android Git Automerger
commit b2200511e8
17 changed files with 32 additions and 64 deletions

View file

@ -30,7 +30,6 @@ import android.view.inputmethod.EditorInfo;
import com.android.inputmethod.compat.AccessibilityEventCompatUtils; import com.android.inputmethod.compat.AccessibilityEventCompatUtils;
import com.android.inputmethod.compat.AudioManagerCompatWrapper; import com.android.inputmethod.compat.AudioManagerCompatWrapper;
import com.android.inputmethod.compat.EditorInfoCompatUtils;
import com.android.inputmethod.compat.InputTypeCompatUtils; import com.android.inputmethod.compat.InputTypeCompatUtils;
import com.android.inputmethod.compat.MotionEventCompatUtils; import com.android.inputmethod.compat.MotionEventCompatUtils;
import com.android.inputmethod.keyboard.Key; import com.android.inputmethod.keyboard.Key;

View file

@ -317,6 +317,7 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
} }
final boolean settingsKeyEnabled = settingsValues.isSettingsKeyEnabled(); final boolean settingsKeyEnabled = settingsValues.isSettingsKeyEnabled();
@SuppressWarnings("deprecation")
final boolean noMicrophone = Utils.inPrivateImeOptions( final boolean noMicrophone = Utils.inPrivateImeOptions(
mPackageName, LatinIME.IME_OPTION_NO_MICROPHONE, editorInfo) mPackageName, LatinIME.IME_OPTION_NO_MICROPHONE, editorInfo)
|| Utils.inPrivateImeOptions( || Utils.inPrivateImeOptions(

View file

@ -18,9 +18,7 @@ package com.android.inputmethod.keyboard;
import android.graphics.Rect; import android.graphics.Rect;
import com.android.inputmethod.keyboard.Key;
import com.android.inputmethod.keyboard.internal.KeyboardParams.TouchPositionCorrection; import com.android.inputmethod.keyboard.internal.KeyboardParams.TouchPositionCorrection;
import com.android.inputmethod.latin.SubtypeSwitcher;
import com.android.inputmethod.latin.Utils; import com.android.inputmethod.latin.Utils;
import com.android.inputmethod.latin.spellcheck.SpellCheckerProximityInfo; import com.android.inputmethod.latin.spellcheck.SpellCheckerProximityInfo;

View file

@ -37,16 +37,16 @@ class AssetFileAddress {
public static AssetFileAddress makeFromFileName(final String filename) { public static AssetFileAddress makeFromFileName(final String filename) {
if (null == filename) return null; if (null == filename) return null;
File f = new File(filename); final File f = new File(filename);
if (null == f || !f.isFile()) return null; if (!f.isFile()) return null;
return new AssetFileAddress(filename, 0l, f.length()); return new AssetFileAddress(filename, 0l, f.length());
} }
public static AssetFileAddress makeFromFileNameAndOffset(final String filename, public static AssetFileAddress makeFromFileNameAndOffset(final String filename,
final long offset, final long length) { final long offset, final long length) {
if (null == filename) return null; if (null == filename) return null;
File f = new File(filename); final File f = new File(filename);
if (null == f || !f.isFile()) return null; if (!f.isFile()) return null;
return new AssetFileAddress(filename, offset, length); return new AssetFileAddress(filename, offset, length);
} }
} }

View file

@ -16,12 +16,10 @@
package com.android.inputmethod.latin; package com.android.inputmethod.latin;
import com.android.inputmethod.keyboard.Keyboard;
import com.android.inputmethod.keyboard.KeyboardSwitcher;
import com.android.inputmethod.keyboard.ProximityInfo;
import android.content.Context; import android.content.Context;
import com.android.inputmethod.keyboard.ProximityInfo;
import java.util.Arrays; import java.util.Arrays;
/** /**
@ -41,7 +39,6 @@ public class BinaryDictionary extends Dictionary {
public static final int MAX_WORD_LENGTH = 48; public static final int MAX_WORD_LENGTH = 48;
public static final int MAX_WORDS = 18; public static final int MAX_WORDS = 18;
@SuppressWarnings("unused")
private static final String TAG = "BinaryDictionary"; private static final String TAG = "BinaryDictionary";
private static final int MAX_PROXIMITY_CHARS_SIZE = ProximityInfo.MAX_PROXIMITY_CHARS_SIZE; private static final int MAX_PROXIMITY_CHARS_SIZE = ProximityInfo.MAX_PROXIMITY_CHARS_SIZE;
private static final int MAX_BIGRAMS = 60; private static final int MAX_BIGRAMS = 60;
@ -56,8 +53,6 @@ public class BinaryDictionary extends Dictionary {
private final int[] mScores = new int[MAX_WORDS]; private final int[] mScores = new int[MAX_WORDS];
private final int[] mBigramScores = new int[MAX_BIGRAMS]; private final int[] mBigramScores = new int[MAX_BIGRAMS];
private final KeyboardSwitcher mKeyboardSwitcher = KeyboardSwitcher.getInstance();
public static final Flag FLAG_REQUIRES_GERMAN_UMLAUT_PROCESSING = public static final Flag FLAG_REQUIRES_GERMAN_UMLAUT_PROCESSING =
new Flag(R.bool.config_require_umlaut_processing, 0x1); new Flag(R.bool.config_require_umlaut_processing, 0x1);

View file

@ -19,7 +19,6 @@ package com.android.inputmethod.latin;
import android.content.ContentResolver; import android.content.ContentResolver;
import android.content.Context; import android.content.Context;
import android.content.res.AssetFileDescriptor; import android.content.res.AssetFileDescriptor;
import android.content.res.Resources;
import android.database.Cursor; import android.database.Cursor;
import android.net.Uri; import android.net.Uri;
import android.text.TextUtils; import android.text.TextUtils;
@ -27,7 +26,6 @@ import android.util.Log;
import java.io.BufferedInputStream; import java.io.BufferedInputStream;
import java.io.File; import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;

View file

@ -24,9 +24,6 @@ import android.content.res.Resources;
import android.util.Log; import android.util.Log;
import java.io.File; import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Arrays;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;

View file

@ -17,7 +17,6 @@
package com.android.inputmethod.latin; package com.android.inputmethod.latin;
import android.content.Context; import android.content.Context;
import android.os.AsyncTask;
import com.android.inputmethod.keyboard.Keyboard; import com.android.inputmethod.keyboard.Keyboard;
import com.android.inputmethod.keyboard.ProximityInfo; import com.android.inputmethod.keyboard.ProximityInfo;
@ -166,15 +165,14 @@ public class ExpandableDictionary extends Dictionary {
// Does children have the current character? // Does children have the current character?
final int childrenLength = children.mLength; final int childrenLength = children.mLength;
Node childNode = null; Node childNode = null;
boolean found = false;
for (int i = 0; i < childrenLength; i++) { for (int i = 0; i < childrenLength; i++) {
childNode = children.mData[i]; final Node node = children.mData[i];
if (childNode.mCode == c) { if (node.mCode == c) {
found = true; childNode = node;
break; break;
} }
} }
if (!found) { if (childNode == null) {
childNode = new Node(); childNode = new Node();
childNode.mCode = c; childNode.mCode = c;
childNode.mParent = parentNode; childNode.mParent = parentNode;
@ -206,7 +204,7 @@ public class ExpandableDictionary extends Dictionary {
} }
protected final void getWordsInner(final WordComposer codes, final WordCallback callback, protected final void getWordsInner(final WordComposer codes, final WordCallback callback,
final ProximityInfo proximityInfo) { @SuppressWarnings("unused") final ProximityInfo proximityInfo) {
mInputLength = codes.size(); mInputLength = codes.size();
if (mCodes.length < mInputLength) mCodes = new int[mInputLength][]; if (mCodes.length < mInputLength) mCodes = new int[mInputLength][];
// Cache the codes so that we don't have to lookup an array list // Cache the codes so that we don't have to lookup an array list
@ -270,7 +268,7 @@ public class ExpandableDictionary extends Dictionary {
*/ */
// TODO: Share this routine with the native code for BinaryDictionary // TODO: Share this routine with the native code for BinaryDictionary
protected void getWordsRec(NodeArray roots, final WordComposer codes, final char[] word, protected void getWordsRec(NodeArray roots, final WordComposer codes, final char[] word,
final int depth, boolean completion, int snr, int inputIndex, int skipPos, final int depth, final boolean completion, int snr, int inputIndex, int skipPos,
WordCallback callback) { WordCallback callback) {
final int count = roots.mLength; final int count = roots.mLength;
final int codeSize = mInputLength; final int codeSize = mInputLength;
@ -278,9 +276,9 @@ public class ExpandableDictionary extends Dictionary {
if (depth > mMaxDepth) { if (depth > mMaxDepth) {
return; return;
} }
int[] currentChars = null; final int[] currentChars;
if (codeSize <= inputIndex) { if (codeSize <= inputIndex) {
completion = true; currentChars = null;
} else { } else {
currentChars = mCodes[inputIndex]; currentChars = mCodes[inputIndex];
} }
@ -292,7 +290,7 @@ public class ExpandableDictionary extends Dictionary {
final boolean terminal = node.mTerminal; final boolean terminal = node.mTerminal;
final NodeArray children = node.mChildren; final NodeArray children = node.mChildren;
final int freq = node.mFrequency; final int freq = node.mFrequency;
if (completion) { if (completion || currentChars == null) {
word[depth] = c; word[depth] = c;
if (terminal) { if (terminal) {
final int finalFreq; final int finalFreq;
@ -307,7 +305,7 @@ public class ExpandableDictionary extends Dictionary {
} }
} }
if (children != null) { if (children != null) {
getWordsRec(children, codes, word, depth + 1, completion, snr, inputIndex, getWordsRec(children, codes, word, depth + 1, true, snr, inputIndex,
skipPos, callback); skipPos, callback);
} }
} else if ((c == Keyboard.CODE_SINGLE_QUOTE } else if ((c == Keyboard.CODE_SINGLE_QUOTE
@ -412,15 +410,14 @@ public class ExpandableDictionary extends Dictionary {
// Does children have the current character? // Does children have the current character?
final int childrenLength = children.mLength; final int childrenLength = children.mLength;
Node childNode = null; Node childNode = null;
boolean found = false;
for (int i = 0; i < childrenLength; i++) { for (int i = 0; i < childrenLength; i++) {
childNode = children.mData[i]; final Node node = children.mData[i];
if (childNode.mCode == c) { if (node.mCode == c) {
found = true; childNode = node;
break; break;
} }
} }
if (!found) { if (childNode == null) {
childNode = new Node(); childNode = new Node();
childNode.mCode = c; childNode.mCode = c;
childNode.mParent = parentNode; childNode.mParent = parentNode;

View file

@ -16,8 +16,6 @@
package com.android.inputmethod.latin; package com.android.inputmethod.latin;
import android.util.Log;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.OutputStream; import java.io.OutputStream;

View file

@ -32,9 +32,6 @@ import java.util.Locale;
* dictionary pack. * dictionary pack.
*/ */
public class LocaleUtils { public class LocaleUtils {
private final static String TAG = LocaleUtils.class.getSimpleName();
private LocaleUtils() { private LocaleUtils() {
// Intentional empty constructor for utility class. // Intentional empty constructor for utility class.
} }

View file

@ -32,7 +32,7 @@ public class SynchronouslyLoadedUserDictionary extends UserDictionary {
} }
@Override @Override
public void getWords(final WordComposer codes, final WordCallback callback, public synchronized void getWords(final WordComposer codes, final WordCallback callback,
final ProximityInfo proximityInfo) { final ProximityInfo proximityInfo) {
blockingReloadDictionaryIfRequired(); blockingReloadDictionaryIfRequired();
getWordsInner(codes, callback, proximityInfo); getWordsInner(codes, callback, proximityInfo);

View file

@ -104,12 +104,12 @@ public class UserBigramDictionary extends ExpandableDictionary {
private static class Bigram { private static class Bigram {
public final String mWord1; public final String mWord1;
public final String mWord2; public final String mWord2;
public final int frequency; public final int mFrequency;
Bigram(String word1, String word2, int frequency) { Bigram(String word1, String word2, int frequency) {
this.mWord1 = word1; this.mWord1 = word1;
this.mWord2 = word2; this.mWord2 = word2;
this.frequency = frequency; this.mFrequency = frequency;
} }
@Override @Override
@ -190,7 +190,7 @@ public class UserBigramDictionary extends ExpandableDictionary {
// Nothing pending? Return // Nothing pending? Return
if (mPendingWrites.isEmpty()) return; if (mPendingWrites.isEmpty()) return;
// Create a background thread to write the pending entries // Create a background thread to write the pending entries
new UpdateDbTask(getContext(), sOpenHelper, mPendingWrites, mLocale).execute(); new UpdateDbTask(sOpenHelper, mPendingWrites, mLocale).execute();
// Create a new map for writing new entries into while the old one is written to db // Create a new map for writing new entries into while the old one is written to db
mPendingWrites = new HashSet<Bigram>(); mPendingWrites = new HashSet<Bigram>();
} }
@ -302,8 +302,8 @@ public class UserBigramDictionary extends ExpandableDictionary {
private final DatabaseHelper mDbHelper; private final DatabaseHelper mDbHelper;
private final String mLocale; private final String mLocale;
public UpdateDbTask(Context context, DatabaseHelper openHelper, public UpdateDbTask(DatabaseHelper openHelper, HashSet<Bigram> pendingWrites,
HashSet<Bigram> pendingWrites, String locale) { String locale) {
mMap = pendingWrites; mMap = pendingWrites;
mLocale = locale; mLocale = locale;
mDbHelper = openHelper; mDbHelper = openHelper;
@ -372,7 +372,7 @@ public class UserBigramDictionary extends ExpandableDictionary {
c.close(); c.close();
// insert new frequency // insert new frequency
db.insert(FREQ_TABLE_NAME, null, getFrequencyContentValues(pairId, bi.frequency)); db.insert(FREQ_TABLE_NAME, null, getFrequencyContentValues(pairId, bi.mFrequency));
} }
checkPruneData(db); checkPruneData(db);
sUpdatingDB = false; sUpdatingDB = false;

View file

@ -19,14 +19,12 @@ package com.android.inputmethod.latin.spellcheck;
import android.content.Intent; import android.content.Intent;
import android.content.res.Resources; import android.content.res.Resources;
import android.service.textservice.SpellCheckerService; import android.service.textservice.SpellCheckerService;
import android.service.textservice.SpellCheckerService.Session; import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import android.view.textservice.SuggestionsInfo; import android.view.textservice.SuggestionsInfo;
import android.view.textservice.TextInfo; import android.view.textservice.TextInfo;
import android.text.TextUtils;
import com.android.inputmethod.compat.ArraysCompatUtils; import com.android.inputmethod.compat.ArraysCompatUtils;
import com.android.inputmethod.keyboard.Key;
import com.android.inputmethod.keyboard.ProximityInfo; import com.android.inputmethod.keyboard.ProximityInfo;
import com.android.inputmethod.latin.BinaryDictionary; import com.android.inputmethod.latin.BinaryDictionary;
import com.android.inputmethod.latin.Dictionary; import com.android.inputmethod.latin.Dictionary;
@ -38,7 +36,6 @@ import com.android.inputmethod.latin.Flag;
import com.android.inputmethod.latin.LocaleUtils; import com.android.inputmethod.latin.LocaleUtils;
import com.android.inputmethod.latin.R; import com.android.inputmethod.latin.R;
import com.android.inputmethod.latin.SynchronouslyLoadedUserDictionary; import com.android.inputmethod.latin.SynchronouslyLoadedUserDictionary;
import com.android.inputmethod.latin.UserDictionary;
import com.android.inputmethod.latin.Utils; import com.android.inputmethod.latin.Utils;
import com.android.inputmethod.latin.WordComposer; import com.android.inputmethod.latin.WordComposer;
@ -111,7 +108,6 @@ public class AndroidSpellCheckerService extends SpellCheckerService {
} }
} }
private final int DEFAULT_SUGGESTION_LENGTH = 16;
private final ArrayList<CharSequence> mSuggestions; private final ArrayList<CharSequence> mSuggestions;
private final int[] mScores; private final int[] mScores;
private final String mOriginalText; private final String mOriginalText;

View file

@ -16,14 +16,13 @@
package com.android.inputmethod.latin.spellcheck; package com.android.inputmethod.latin.spellcheck;
import android.content.Context;
import java.util.Locale; import java.util.Locale;
import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.LinkedBlockingQueue;
/** /**
* A blocking queue that creates dictionaries up to a certain limit as necessary. * A blocking queue that creates dictionaries up to a certain limit as necessary.
*/ */
@SuppressWarnings("serial")
public class DictionaryPool extends LinkedBlockingQueue<DictAndProximity> { public class DictionaryPool extends LinkedBlockingQueue<DictAndProximity> {
private final AndroidSpellCheckerService mService; private final AndroidSpellCheckerService mService;
private final int mMaxSize; private final int mMaxSize;

View file

@ -19,7 +19,6 @@ package com.android.inputmethod.latin.spellcheck;
import com.android.inputmethod.keyboard.KeyDetector; import com.android.inputmethod.keyboard.KeyDetector;
import com.android.inputmethod.keyboard.ProximityInfo; import com.android.inputmethod.keyboard.ProximityInfo;
import java.util.Map;
import java.util.TreeMap; import java.util.TreeMap;
public class SpellCheckerProximityInfo { public class SpellCheckerProximityInfo {

View file

@ -16,14 +16,10 @@
package com.android.inputmethod.latin.spellcheck; package com.android.inputmethod.latin.spellcheck;
import com.android.inputmethod.latin.R;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.preference.PreferenceActivity; import android.preference.PreferenceActivity;
import java.util.List;
/** /**
* Spell checker preference screen. * Spell checker preference screen.
*/ */

View file

@ -16,17 +16,15 @@
package com.android.inputmethod.latin.spellcheck; package com.android.inputmethod.latin.spellcheck;
import com.android.inputmethod.latin.R;
import android.os.Bundle; import android.os.Bundle;
import android.preference.PreferenceFragment; import android.preference.PreferenceFragment;
import com.android.inputmethod.latin.R;
/** /**
* Preference screen. * Preference screen.
*/ */
public class SpellCheckerSettingsFragment extends PreferenceFragment { public class SpellCheckerSettingsFragment extends PreferenceFragment {
private static final String TAG = SpellCheckerSettingsFragment.class.getSimpleName();
/** /**
* Empty constructor for fragment generation. * Empty constructor for fragment generation.
*/ */