summaryrefslogtreecommitdiff
path: root/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2010-12-10 15:24:28 +0900
committerTadashi G. Takaoka <takaoka@google.com>2010-12-10 18:24:00 +0900
commite26ef1bccddc942fdaeada3409c8e8ff18a35008 (patch)
treef697a67c0c82dc4e097e46fbf983ba77b98b44fd /java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
parent20cdb37bd062ae6cb6d42ad6229a19733476cd55 (diff)
Remove Tutorial class and unused debug feature
This change also cleanups compiler warnings. Bug: 2897373 Change-Id: If972cf45c1eb40436adbddbf71969e5409f4c9c5
Diffstat (limited to 'java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java')
-rw-r--r--java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java16
1 files changed, 9 insertions, 7 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
index 88e7ad5d0..51e878c88 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
@@ -100,6 +100,7 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
}
private KeyboardSwitcher() {
+ // Intentional empty constructor for singleton.
}
public static void init(LatinIME ims, SharedPreferences prefs) {
@@ -554,12 +555,13 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
}
private void createInputViewInternal(int newLayout, boolean forceReset) {
- if (mLayoutId != newLayout || mInputView == null || forceReset) {
+ int layoutId = newLayout;
+ if (mLayoutId != layoutId || mInputView == null || forceReset) {
if (mInputView != null) {
mInputView.closing();
}
- if (THEMES.length <= newLayout) {
- newLayout = Integer.valueOf(DEFAULT_LAYOUT_ID);
+ if (THEMES.length <= layoutId) {
+ layoutId = Integer.valueOf(DEFAULT_LAYOUT_ID);
}
Utils.GCUtils.getInstance().reset();
@@ -567,20 +569,20 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
for (int i = 0; i < Utils.GCUtils.GC_TRY_LOOP_MAX && tryGC; ++i) {
try {
mInputView = (LatinKeyboardView) mInputMethodService.getLayoutInflater(
- ).inflate(THEMES[newLayout], null);
+ ).inflate(THEMES[layoutId], null);
tryGC = false;
} catch (OutOfMemoryError e) {
Log.w(TAG, "load keyboard failed: " + e);
tryGC = Utils.GCUtils.getInstance().tryGCOrWait(
- mLayoutId + "," + newLayout, e);
+ mLayoutId + "," + layoutId, e);
} catch (InflateException e) {
Log.w(TAG, "load keyboard failed: " + e);
tryGC = Utils.GCUtils.getInstance().tryGCOrWait(
- mLayoutId + "," + newLayout, e);
+ mLayoutId + "," + layoutId, e);
}
}
mInputView.setOnKeyboardActionListener(mInputMethodService);
- mLayoutId = newLayout;
+ mLayoutId = layoutId;
}
}