aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/keyboard/Keyboard.java2
-rw-r--r--java/src/com/android/inputmethod/latin/StringUtils.java4
-rw-r--r--java/src/com/android/inputmethod/latin/SubtypeSwitcher.java43
3 files changed, 4 insertions, 45 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/Keyboard.java b/java/src/com/android/inputmethod/keyboard/Keyboard.java
index 6ada09067..950b5e99b 100644
--- a/java/src/com/android/inputmethod/keyboard/Keyboard.java
+++ b/java/src/com/android/inputmethod/keyboard/Keyboard.java
@@ -1229,7 +1229,7 @@ public class Keyboard {
private void endRow(Row row) {
if (mCurrentRow == null)
- throw new InflateException("orphant end row tag");
+ throw new InflateException("orphan end row tag");
if (mRightEdgeKey != null) {
mRightEdgeKey.markAsRightEdge(mParams);
mRightEdgeKey = null;
diff --git a/java/src/com/android/inputmethod/latin/StringUtils.java b/java/src/com/android/inputmethod/latin/StringUtils.java
index 42fce53d0..649cd650a 100644
--- a/java/src/com/android/inputmethod/latin/StringUtils.java
+++ b/java/src/com/android/inputmethod/latin/StringUtils.java
@@ -46,7 +46,7 @@ public class StringUtils {
return text.codePointCount(0, text.length());
}
- public static boolean containsInCsv(String key, String csv) {
+ private static boolean containsInCsv(String key, String csv) {
if (csv == null)
return false;
for (String option : csv.split(",")) {
@@ -129,7 +129,7 @@ public class StringUtils {
/**
* Remove duplicates from an array of strings.
*
- * This method will always keep the first occurence of all strings at their position
+ * This method will always keep the first occurrence of all strings at their position
* in the array, removing the subsequent ones.
*/
public static void removeDupes(final ArrayList<CharSequence> suggestions) {
diff --git a/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java b/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java
index dfb01a24c..6612c24cd 100644
--- a/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java
+++ b/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java
@@ -18,11 +18,9 @@ package com.android.inputmethod.latin;
import android.content.Context;
import android.content.Intent;
-import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.Configuration;
import android.content.res.Resources;
-import android.graphics.drawable.Drawable;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.AsyncTask;
@@ -291,45 +289,6 @@ public class SubtypeSwitcher {
}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
- public Drawable getShortcutIcon() {
- return getSubtypeIcon(mShortcutInputMethodInfo, mShortcutSubtype);
- }
-
- private Drawable getSubtypeIcon(InputMethodInfo imi, InputMethodSubtype subtype) {
- final PackageManager pm = mService.getPackageManager();
- if (imi != null) {
- final String imiPackageName = imi.getPackageName();
- if (DBG) {
- Log.d(TAG, "Update icons of IME: " + imiPackageName + ","
- + KeyboardLayoutSet.getKeyboardLayoutSetLocaleString(subtype) + ","
- + subtype.getMode());
- }
- if (subtype != null) {
- return pm.getDrawable(imiPackageName, subtype.getIconResId(),
- imi.getServiceInfo().applicationInfo);
- } else if (imi.getSubtypeCount() > 0 && imi.getSubtypeAt(0) != null) {
- return pm.getDrawable(imiPackageName,
- imi.getSubtypeAt(0).getIconResId(),
- imi.getServiceInfo().applicationInfo);
- } else {
- try {
- return pm.getApplicationInfo(imiPackageName, 0).loadIcon(pm);
- } catch (PackageManager.NameNotFoundException e) {
- Log.w(TAG, "IME can't be found: " + imiPackageName);
- }
- }
- }
- return null;
- }
-
- private static boolean contains(String[] hay, String needle) {
- for (String element : hay) {
- if (element.equals(needle))
- return true;
- }
- return false;
- }
-
public boolean isShortcutImeEnabled() {
if (mShortcutInputMethodInfo == null) {
return false;
@@ -352,7 +311,7 @@ public class SubtypeSwitcher {
return false;
if (mShortcutSubtype == null)
return true;
- if (contains(mShortcutSubtype.getExtraValue().split(","),
+ if (mShortcutSubtype.containsExtraValueKey(
SUBTYPE_EXTRAVALUE_REQUIRE_NETWORK_CONNECTIVITY)) {
return mIsNetworkConnected;
}