Example usage for android.view.inputmethod InputMethodInfo getServiceInfo

List of usage examples for android.view.inputmethod InputMethodInfo getServiceInfo

Introduction

In this page you can find the example usage for android.view.inputmethod InputMethodInfo getServiceInfo.

Prototype

public ServiceInfo getServiceInfo() 

Source Link

Document

Return the raw information about the Service implementing this input method.

Usage

From source file:io.digibyte.tools.util.Utils.java

public static boolean isUsingCustomInputMethod(Activity context) {
    if (context == null)
        return false;
    InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
    if (imm == null) {
        return false;
    }/*from www  .j a v  a 2s. c  om*/
    List<InputMethodInfo> mInputMethodProperties = imm.getEnabledInputMethodList();
    final int N = mInputMethodProperties.size();
    for (int i = 0; i < N; i++) {
        InputMethodInfo imi = mInputMethodProperties.get(i);
        if (imi.getId().equals(Settings.Secure.getString(context.getContentResolver(),
                Settings.Secure.DEFAULT_INPUT_METHOD))) {
            if ((imi.getServiceInfo().applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) == 0) {
                return true;
            }
        }
    }
    return false;
}