aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod
diff options
context:
space:
mode:
Diffstat (limited to 'java/src/com/android/inputmethod')
-rw-r--r--java/src/com/android/inputmethod/latin/KeyboardSwitcher.java2
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java6
-rw-r--r--java/src/com/android/inputmethod/latin/LatinImeLogger.java8
-rw-r--r--java/src/com/android/inputmethod/latin/LatinKeyboardView.java2
4 files changed, 13 insertions, 5 deletions
diff --git a/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java b/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java
index ef3fb8e1e..a8be2fd44 100644
--- a/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java
+++ b/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java
@@ -392,7 +392,7 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
try {
mInputView = (LatinKeyboardView) mInputMethodService.getLayoutInflater().inflate(
LAYOUTS[newLayout], null);
- } catch (RuntimeException e) {
+ } catch (OutOfMemoryError e) {
LatinImeLogger.logOnException(mLayoutId + "," + newLayout, e);
}
mInputView.setExtentionLayoutResId(LAYOUTS[newLayout]);
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 520974580..6d620968a 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -291,7 +291,11 @@ public class LatinIME extends InputMethodService
if (inputLanguage == null) {
inputLanguage = conf.locale.toString();
}
- initSuggest(inputLanguage);
+ try {
+ initSuggest(inputLanguage);
+ } catch (OutOfMemoryError e) {
+ LatinImeLogger.logOnException(inputLanguage, e);
+ }
mOrientation = conf.orientation;
initSuggestPuncList();
diff --git a/java/src/com/android/inputmethod/latin/LatinImeLogger.java b/java/src/com/android/inputmethod/latin/LatinImeLogger.java
index 83a791c13..5a8b61dbc 100644
--- a/java/src/com/android/inputmethod/latin/LatinImeLogger.java
+++ b/java/src/com/android/inputmethod/latin/LatinImeLogger.java
@@ -550,7 +550,7 @@ public class LatinImeLogger implements SharedPreferences.OnSharedPreferenceChang
}
}
- public static void logOnException(String metaData, RuntimeException e) {
+ public static void logOnException(String metaData, Throwable e) {
if (sLogEnabled) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
PrintStream ps = new PrintStream(baos);
@@ -566,7 +566,11 @@ public class LatinImeLogger implements SharedPreferences.OnSharedPreferenceChang
sLatinImeLogger.commitInternalAndStopSelf();
} else {
sLatinImeLogger.commitInternal();
- throw e;
+ if (e instanceof RuntimeException) {
+ throw (RuntimeException) e;
+ } else if (e instanceof Error) {
+ throw (Error) e;
+ }
}
}
}
diff --git a/java/src/com/android/inputmethod/latin/LatinKeyboardView.java b/java/src/com/android/inputmethod/latin/LatinKeyboardView.java
index 46f04b8a2..014d773ab 100644
--- a/java/src/com/android/inputmethod/latin/LatinKeyboardView.java
+++ b/java/src/com/android/inputmethod/latin/LatinKeyboardView.java
@@ -474,7 +474,7 @@ public class LatinKeyboardView extends KeyboardView {
public void draw(Canvas c) {
try {
super.draw(c);
- } catch (RuntimeException e) {
+ } catch (OutOfMemoryError e) {
LatinImeLogger.logOnException("draw in LatinKeybaordView", e);
}
if (DEBUG_AUTO_PLAY) {