aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsTable.java4
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java44
-rw-r--r--tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetTestsBase.java17
-rw-r--r--tools/make-keyboard-text/res/values-af/donottranslate-more-keys.xml1
4 files changed, 50 insertions, 16 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsTable.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsTable.java
index 96acb1551..ed2db07a8 100644
--- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsTable.java
+++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsTable.java
@@ -90,7 +90,7 @@ public final class KeyboardTextsTable {
/* 8:20 */ "more_keys_for_s",
/* 9:20 */ "more_keys_for_n",
/* 10:20 */ "label_to_alpha_key",
- /* 11:15 */ "more_keys_for_y",
+ /* 11:14 */ "more_keys_for_y",
/* 12:13 */ "more_keys_for_d",
/* 13:12 */ "more_keys_for_z",
/* 14:10 */ "more_keys_for_t",
@@ -3585,7 +3585,7 @@ public final class KeyboardTextsTable {
private static final Object[] LANGUAGES_AND_TEXTS = {
// "locale", TEXT_ARRAY, /* numberOfNonNullText/lengthOf_TEXT_ARRAY localeName */
"DEFAULT", LANGUAGE_DEFAULT, /* 171/171 default */
- "af", LANGUAGE_af, /* 8/ 12 Afrikaans */
+ "af", LANGUAGE_af, /* 7/ 12 Afrikaans */
"ar", LANGUAGE_ar, /* 58/110 Arabic */
"az", LANGUAGE_az_AZ, /* 8/ 17 Azerbaijani (Azerbaijan) */
"be", LANGUAGE_be_BY, /* 10/ 33 Belarusian (Belarus) */
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 8ab1bb6a1..bfc578082 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -172,7 +172,11 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
}
public void onCreate() {
- final Resources res = getOwnerInstance().getResources();
+ final LatinIME latinIme = getOwnerInstance();
+ if (latinIme == null) {
+ return;
+ }
+ final Resources res = latinIme.getResources();
mDelayUpdateSuggestions = res.getInteger(R.integer.config_delay_update_suggestions);
mDelayUpdateShiftState = res.getInteger(R.integer.config_delay_update_shift_state);
mDoubleSpacePeriodTimeout =
@@ -182,6 +186,9 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
@Override
public void handleMessage(final Message msg) {
final LatinIME latinIme = getOwnerInstance();
+ if (latinIme == null) {
+ return;
+ }
final KeyboardSwitcher switcher = latinIme.mKeyboardSwitcher;
switch (msg.what) {
case MSG_UPDATE_SUGGESTION_STRIP:
@@ -239,7 +246,11 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
}
public void postResumeSuggestions() {
- if (!getOwnerInstance().mSettings.getCurrent().isSuggestionStripVisible()) {
+ final LatinIME latinIme = getOwnerInstance();
+ if (latinIme == null) {
+ return;
+ }
+ if (!latinIme.mSettings.getCurrent().isSuggestionStripVisible()) {
return;
}
removeMessages(MSG_RESUME_SUGGESTIONS);
@@ -326,6 +337,9 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
resetPendingImsCallback();
mIsOrientationChanging = true;
final LatinIME latinIme = getOwnerInstance();
+ if (latinIme == null) {
+ return;
+ }
if (latinIme.isInputViewShown()) {
latinIme.mKeyboardSwitcher.saveKeyboardState();
}
@@ -362,8 +376,10 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
mPendingSuccessiveImsCallback = true;
}
final LatinIME latinIme = getOwnerInstance();
- executePendingImsCallback(latinIme, editorInfo, restarting);
- latinIme.onStartInputInternal(editorInfo, restarting);
+ if (latinIme != null) {
+ executePendingImsCallback(latinIme, editorInfo, restarting);
+ latinIme.onStartInputInternal(editorInfo, restarting);
+ }
}
}
@@ -381,9 +397,11 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
PENDING_IMS_CALLBACK_DURATION);
}
final LatinIME latinIme = getOwnerInstance();
- executePendingImsCallback(latinIme, editorInfo, restarting);
- latinIme.onStartInputViewInternal(editorInfo, restarting);
- mAppliedEditorInfo = editorInfo;
+ if (latinIme != null) {
+ executePendingImsCallback(latinIme, editorInfo, restarting);
+ latinIme.onStartInputViewInternal(editorInfo, restarting);
+ mAppliedEditorInfo = editorInfo;
+ }
}
}
@@ -393,8 +411,10 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
mHasPendingFinishInputView = true;
} else {
final LatinIME latinIme = getOwnerInstance();
- latinIme.onFinishInputViewInternal(finishingInput);
- mAppliedEditorInfo = null;
+ if (latinIme != null) {
+ latinIme.onFinishInputViewInternal(finishingInput);
+ mAppliedEditorInfo = null;
+ }
}
}
@@ -404,8 +424,10 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
mHasPendingFinishInput = true;
} else {
final LatinIME latinIme = getOwnerInstance();
- executePendingImsCallback(latinIme, null, false);
- latinIme.onFinishInputInternal();
+ if (latinIme != null) {
+ executePendingImsCallback(latinIme, null, false);
+ latinIme.onFinishInputInternal();
+ }
}
}
}
diff --git a/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetTestsBase.java b/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetTestsBase.java
index 6dcf51370..9939a4335 100644
--- a/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetTestsBase.java
+++ b/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetTestsBase.java
@@ -80,12 +80,25 @@ public class KeyboardLayoutSetTestsBase extends AndroidTestCase {
|| mScreenMetrics == Constants.SCREEN_METRICS_LARGE_PHONE;
}
+ private static String toString(final ArrayList<InputMethodSubtype> subtypeList) {
+ final StringBuilder sb = new StringBuilder();
+ for (int index = 0; index < subtypeList.size(); index++) {
+ final InputMethodSubtype subtype = subtypeList.get(index);
+ sb.append((index + 1) + ": ");
+ sb.append(SubtypeLocaleUtils.getSubtypeNameForLogging(subtype));
+ sb.append("\n");
+ }
+ return sb.toString();
+ }
+
public final void testAllSubtypesCount() {
- assertEquals(NUMBER_OF_SUBTYPES, mAllSubtypesList.size());
+ assertEquals(toString(mAllSubtypesList),
+ NUMBER_OF_SUBTYPES, mAllSubtypesList.size());
}
public final void testAsciiCapableSubtypesCount() {
- assertEquals(NUMBER_OF_ASCII_CAPABLE_SUBTYPES, mAsciiCapableSubtypesList.size());
+ assertEquals(toString(mAsciiCapableSubtypesList),
+ NUMBER_OF_ASCII_CAPABLE_SUBTYPES, mAsciiCapableSubtypesList.size());
}
protected final InputMethodSubtype getSubtype(final Locale locale,
diff --git a/tools/make-keyboard-text/res/values-af/donottranslate-more-keys.xml b/tools/make-keyboard-text/res/values-af/donottranslate-more-keys.xml
index ee96f442d..5a90e62bd 100644
--- a/tools/make-keyboard-text/res/values-af/donottranslate-more-keys.xml
+++ b/tools/make-keyboard-text/res/values-af/donottranslate-more-keys.xml
@@ -62,7 +62,6 @@
<!-- U+00F1: "ñ" LATIN SMALL LETTER N WITH TILDE
U+0144: "ń" LATIN SMALL LETTER N WITH ACUTE -->
<string name="more_keys_for_n">&#x00F1;,&#x0144;</string>
- <string name="more_keys_for_y">&#x00FD;,&#x0177;,&#x00FF;,&#x0133;</string>
<!-- U+00FD: "ý" LATIN SMALL LETTER Y WITH ACUTE
U+0133: "ij" LATIN SMALL LIGATURE IJ -->
<string name="more_keys_for_y">&#x00FD;,&#x0133;</string>