From 525141a402ac9a3fb3495cb069ad25b9ba1fc970 Mon Sep 17 00:00:00 2001 From: satok Date: Tue, 24 Aug 2010 12:38:39 +0900 Subject: [PATCH] Clean up LatinIME java - remove unused code - add @Override - change the inappropriate cast Change-Id: Ib25b4939e5b4273794ab0f6349776b5b62d89894 --- .../com/android/inputmethod/latin/BinaryDictionary.java | 1 - java/src/com/android/inputmethod/latin/Hints.java | 1 - .../android/inputmethod/latin/InputLanguageSelection.java | 2 +- .../com/android/inputmethod/latin/KeyboardSwitcher.java | 1 - java/src/com/android/inputmethod/latin/LatinIME.java | 1 - .../com/android/inputmethod/latin/LatinIMEBackupAgent.java | 1 + java/src/com/android/inputmethod/latin/Suggest.java | 2 -- java/src/com/android/inputmethod/latin/Tutorial.java | 7 ------- .../android/inputmethod/latin/UserBigramDictionary.java | 3 +-- java/src/com/android/inputmethod/latin/WordComposer.java | 3 +-- 10 files changed, 4 insertions(+), 18 deletions(-) diff --git a/java/src/com/android/inputmethod/latin/BinaryDictionary.java b/java/src/com/android/inputmethod/latin/BinaryDictionary.java index 69c2b94f2..d0e143dd0 100644 --- a/java/src/com/android/inputmethod/latin/BinaryDictionary.java +++ b/java/src/com/android/inputmethod/latin/BinaryDictionary.java @@ -16,7 +16,6 @@ package com.android.inputmethod.latin; -import java.io.ByteArrayInputStream; import java.io.InputStream; import java.io.IOException; import java.nio.ByteBuffer; diff --git a/java/src/com/android/inputmethod/latin/Hints.java b/java/src/com/android/inputmethod/latin/Hints.java index 689c8d852..2434d5195 100644 --- a/java/src/com/android/inputmethod/latin/Hints.java +++ b/java/src/com/android/inputmethod/latin/Hints.java @@ -36,7 +36,6 @@ public class Hints { public void showHint(int viewResource); } - private static final String TAG = "Hints"; private static final String PREF_VOICE_HINT_NUM_UNIQUE_DAYS_SHOWN = "voice_hint_num_unique_days_shown"; private static final String PREF_VOICE_HINT_LAST_TIME_SHOWN = diff --git a/java/src/com/android/inputmethod/latin/InputLanguageSelection.java b/java/src/com/android/inputmethod/latin/InputLanguageSelection.java index 4f672271a..7258874c0 100644 --- a/java/src/com/android/inputmethod/latin/InputLanguageSelection.java +++ b/java/src/com/android/inputmethod/latin/InputLanguageSelection.java @@ -40,7 +40,7 @@ public class InputLanguageSelection extends PreferenceActivity { "ko", "ja", "zh", "el" }; - private static class Loc implements Comparable { + private static class Loc implements Comparable { static Collator sCollator = Collator.getInstance(); String label; diff --git a/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java b/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java index 88a2b8398..dec29b7cb 100644 --- a/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java +++ b/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java @@ -24,7 +24,6 @@ import android.content.Context; import android.content.SharedPreferences; import android.content.res.Configuration; import android.content.res.Resources; -import android.inputmethodservice.Keyboard; import android.preference.PreferenceManager; import android.view.InflateException; diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 0f724f00a..0e6b18a06 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -398,7 +398,6 @@ public class LatinIME extends InputMethodService static int[] getDictionary(Resources res) { String packageName = LatinIME.class.getPackage().getName(); XmlResourceParser xrp = res.getXml(R.xml.dictionary); - int dictionaryCount = 0; ArrayList dictionaries = new ArrayList(); try { diff --git a/java/src/com/android/inputmethod/latin/LatinIMEBackupAgent.java b/java/src/com/android/inputmethod/latin/LatinIMEBackupAgent.java index 568b31d04..a14a4751f 100644 --- a/java/src/com/android/inputmethod/latin/LatinIMEBackupAgent.java +++ b/java/src/com/android/inputmethod/latin/LatinIMEBackupAgent.java @@ -24,6 +24,7 @@ import android.app.backup.SharedPreferencesBackupHelper; */ public class LatinIMEBackupAgent extends BackupAgentHelper { + @Override public void onCreate() { addHelper("shared_pref", new SharedPreferencesBackupHelper(this, getPackageName() + "_preferences")); diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java index a96737f5c..92bbe4362 100755 --- a/java/src/com/android/inputmethod/latin/Suggest.java +++ b/java/src/com/android/inputmethod/latin/Suggest.java @@ -34,8 +34,6 @@ import android.view.View; */ public class Suggest implements Dictionary.WordCallback { - private static final String TAG = "Suggest"; - public static final int APPROX_MAX_WORD_LENGTH = 32; public static final int CORRECTION_NONE = 0; diff --git a/java/src/com/android/inputmethod/latin/Tutorial.java b/java/src/com/android/inputmethod/latin/Tutorial.java index a8123317b..d3eaf30c6 100644 --- a/java/src/com/android/inputmethod/latin/Tutorial.java +++ b/java/src/com/android/inputmethod/latin/Tutorial.java @@ -17,7 +17,6 @@ package com.android.inputmethod.latin; import android.content.Context; -import android.graphics.Rect; import android.graphics.drawable.Drawable; import android.os.Handler; import android.os.Message; @@ -38,13 +37,9 @@ import java.util.List; public class Tutorial implements OnTouchListener { private List mBubbles = new ArrayList(); - private long mStartTime; - private static final long MINIMUM_TIME = 6000; - private static final long MAXIMUM_TIME = 20000; private View mInputView; private LatinIME mIme; private int[] mLocation = new int[2]; - private int mBubblePointerOffset; private static final int MSG_SHOW_BUBBLE = 0; @@ -167,8 +162,6 @@ public class Tutorial implements OnTouchListener { mIme = ime; int inputWidth = inputView.getWidth(); final int x = inputWidth / 20; // Half of 1/10th - mBubblePointerOffset = inputView.getContext().getResources() - .getDimensionPixelOffset(R.dimen.bubble_pointer_offset); Bubble bWelcome = new Bubble(context, inputView, R.drawable.dialog_bubble_step02, x, 0, R.string.tip_to_open_keyboard, R.string.touch_to_continue); diff --git a/java/src/com/android/inputmethod/latin/UserBigramDictionary.java b/java/src/com/android/inputmethod/latin/UserBigramDictionary.java index c3eab94f1..67d9c0bcf 100644 --- a/java/src/com/android/inputmethod/latin/UserBigramDictionary.java +++ b/java/src/com/android/inputmethod/latin/UserBigramDictionary.java @@ -374,8 +374,7 @@ public class UserBigramDictionary extends ExpandableDictionary { c.close(); // insert new frequency - long s = db.insert(FREQ_TABLE_NAME, null, - getFrequencyContentValues(pairId, bi.frequency)); + db.insert(FREQ_TABLE_NAME, null, getFrequencyContentValues(pairId, bi.frequency)); } checkPruneData(db); sUpdatingDB = false; diff --git a/java/src/com/android/inputmethod/latin/WordComposer.java b/java/src/com/android/inputmethod/latin/WordComposer.java index 1ea74847a..6772d53ea 100644 --- a/java/src/com/android/inputmethod/latin/WordComposer.java +++ b/java/src/com/android/inputmethod/latin/WordComposer.java @@ -17,7 +17,6 @@ package com.android.inputmethod.latin; import java.util.ArrayList; -import java.util.List; /** * A place to store the currently composing word with information such as adjacent key codes as well @@ -50,7 +49,7 @@ public class WordComposer { } WordComposer(WordComposer copy) { - mCodes = (ArrayList) copy.mCodes.clone(); + mCodes = new ArrayList(copy.mCodes); mPreferredWord = copy.mPreferredWord; mTypedWord = new StringBuilder(copy.mTypedWord); mCapsCount = copy.mCapsCount;