Java Code Examples for android.view.inputmethod.InputMethodManager#getInputMethodList()

The following examples show how to use android.view.inputmethod.InputMethodManager#getInputMethodList() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: UncachedInputMethodManagerUtils.java    From openboard with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Get {@link InputMethodInfo} of the IME specified by the package name.
 * CAVEAT: This may cause a round trip IPC.
 *
 * @param packageName package name of the IME.
 * @param imm the {@link InputMethodManager}.
 * @return the {@link InputMethodInfo} of the IME specified by the <code>packageName</code>,
 * or null if not found.
 */
public static InputMethodInfo getInputMethodInfoOf(final String packageName,
        final InputMethodManager imm) {
    for (final InputMethodInfo imi : imm.getInputMethodList()) {
        if (packageName.equals(imi.getPackageName())) {
            return imi;
        }
    }
    return null;
}
 
Example 2
Source File: InputMethodSettingsImpl.java    From Android-Keyboard with Apache License 2.0 5 votes vote down vote up
private static InputMethodInfo getMyImi(Context context, InputMethodManager imm) {
    final List<InputMethodInfo> imis = imm.getInputMethodList();
    for (int i = 0; i < imis.size(); ++i) {
        final InputMethodInfo imi = imis.get(i);
        if (imis.get(i).getPackageName().equals(context.getPackageName())) {
            return imi;
        }
    }
    return null;
}
 
Example 3
Source File: InputMethodSettingsImpl.java    From LokiBoard-Android-Keylogger with Apache License 2.0 5 votes vote down vote up
private static InputMethodInfo getMyImi(Context context, InputMethodManager imm) {
    final List<InputMethodInfo> imis = imm.getInputMethodList();
    for (int i = 0; i < imis.size(); ++i) {
        final InputMethodInfo imi = imis.get(i);
        if (imis.get(i).getPackageName().equals(context.getPackageName())) {
            return imi;
        }
    }
    return null;
}
 
Example 4
Source File: BaldInputMethodService.java    From BaldPhone with Apache License 2.0 5 votes vote down vote up
private static boolean voiceExists(InputMethodManager imeManager) {
    final List<InputMethodInfo> list = imeManager.getInputMethodList();
    for (final InputMethodInfo el : list) {
        if (el.getId().equals(VOICE_RECOGNITION_IMS))
            return true;
    }
    return false;
}
 
Example 5
Source File: XposedBigBang.java    From timecat with Apache License 2.0 5 votes vote down vote up
private Set<String> getInputMethodAsWhiteList(Context context) {
    HashSet<String> packages = new HashSet<>();
    InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
    List<InputMethodInfo> methodList = imm.getInputMethodList();
    for (InputMethodInfo info : methodList) {
        packages.add(info.getPackageName());
    }
    return packages;
}
 
Example 6
Source File: XposedTimeCat.java    From timecat with Apache License 2.0 5 votes vote down vote up
private Set<String> getInputMethodAsWhiteList(Context context) {
    HashSet<String> packages = new HashSet<>();
    InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
    List<InputMethodInfo> methodList = imm.getInputMethodList();
    for (InputMethodInfo info : methodList) {
        packages.add(info.getPackageName());
    }
    return packages;
}
 
Example 7
Source File: InputMethodSettingsImpl.java    From simple-keyboard with Apache License 2.0 5 votes vote down vote up
private static InputMethodInfo getMyImi(Context context, InputMethodManager imm) {
    final List<InputMethodInfo> imis = imm.getInputMethodList();
    for (int i = 0; i < imis.size(); ++i) {
        final InputMethodInfo imi = imis.get(i);
        if (imis.get(i).getPackageName().equals(context.getPackageName())) {
            return imi;
        }
    }
    return null;
}
 
Example 8
Source File: UncachedInputMethodManagerUtils.java    From AOSP-Kayboard-7.1.2 with Apache License 2.0 5 votes vote down vote up
/**
 * Get {@link InputMethodInfo} of the IME specified by the package name.
 * CAVEAT: This may cause a round trip IPC.
 *
 * @param packageName package name of the IME.
 * @param imm the {@link InputMethodManager}.
 * @return the {@link InputMethodInfo} of the IME specified by the <code>packageName</code>,
 * or null if not found.
 */
public static InputMethodInfo getInputMethodInfoOf(final String packageName,
        final InputMethodManager imm) {
    for (final InputMethodInfo imi : imm.getInputMethodList()) {
        if (packageName.equals(imi.getPackageName())) {
            return imi;
        }
    }
    return null;
}
 
Example 9
Source File: InputMethodSettingsImpl.java    From AOSP-Kayboard-7.1.2 with Apache License 2.0 5 votes vote down vote up
private static InputMethodInfo getMyImi(Context context, InputMethodManager imm) {
    final List<InputMethodInfo> imis = imm.getInputMethodList();
    for (int i = 0; i < imis.size(); ++i) {
        final InputMethodInfo imi = imis.get(i);
        if (imis.get(i).getPackageName().equals(context.getPackageName())) {
            return imi;
        }
    }
    return null;
}
 
Example 10
Source File: InputMethodSettingsImpl.java    From AndroidKeyboard with GNU General Public License v3.0 5 votes vote down vote up
private static InputMethodInfo getMyImi(Context context, InputMethodManager imm) {
    final List<InputMethodInfo> imis = imm.getInputMethodList();
    for (int i = 0; i < imis.size(); ++i) {
        final InputMethodInfo imi = imis.get(i);
        if (imis.get(i).getPackageName().equals(context.getPackageName())) {
            return imi;
        }
    }
    return null;
}
 
Example 11
Source File: UncachedInputMethodManagerUtils.java    From Indic-Keyboard with Apache License 2.0 5 votes vote down vote up
/**
 * Get {@link InputMethodInfo} of the IME specified by the package name.
 * CAVEAT: This may cause a round trip IPC.
 *
 * @param packageName package name of the IME.
 * @param imm the {@link InputMethodManager}.
 * @return the {@link InputMethodInfo} of the IME specified by the <code>packageName</code>,
 * or null if not found.
 */
public static InputMethodInfo getInputMethodInfoOf(final String packageName,
        final InputMethodManager imm) {
    for (final InputMethodInfo imi : imm.getInputMethodList()) {
        if (packageName.equals(imi.getPackageName())) {
            return imi;
        }
    }
    return null;
}
 
Example 12
Source File: CustomApplicationHelper.java    From AndroidTVWidget with Apache License 2.0 4 votes vote down vote up
public List<InputMethodInfo> getAllInputMethod() {
	InputMethodManager imm = (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE);
	List<InputMethodInfo> methodList = imm.getInputMethodList();
	return methodList;
}
 
Example 13
Source File: CustomApplicationHelper.java    From Android-tv-widget with Apache License 2.0 4 votes vote down vote up
public List<InputMethodInfo> getAllInputMethod() {
	InputMethodManager imm = (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE);
	List<InputMethodInfo> methodList = imm.getInputMethodList();
	return methodList;
}