Change RuntimeErrot to OutOfMemoryError
Change-Id: Ic237bc7f0631dcb192be7203379bdf4c5d832b28main
parent
e4c7ad3097
commit
dac53d9c7d
|
@ -1,7 +1,7 @@
|
|||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.google.android.inputmethod.latin"
|
||||
android:versionCode="9"
|
||||
android:versionName="0.15">
|
||||
android:versionName="0.16">
|
||||
|
||||
<uses-sdk android:minSdkVersion="8"></uses-sdk>
|
||||
|
||||
|
|
|
@ -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]);
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue