Small refactor on InputMethodUtils
Change-Id: Ie4f797508c02abb13c7fe1be162ec4dc18829925
This commit is contained in:
@ -57,6 +57,23 @@ public class InputMethodUtils {
|
||||
// This utility class is not publicly instantiable.
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
// Utilities for debug
|
||||
public static String getStackTrace() {
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
try {
|
||||
throw new RuntimeException();
|
||||
} catch (RuntimeException e) {
|
||||
final StackTraceElement[] frames = e.getStackTrace();
|
||||
// Start at 1 because the first frame is here and we don't care about it
|
||||
for (int j = 1; j < frames.length; ++j) {
|
||||
sb.append(frames[j].toString() + "\n");
|
||||
}
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
public static boolean isSystemIme(InputMethodInfo inputMethod) {
|
||||
return (inputMethod.getServiceInfo().applicationInfo.flags
|
||||
& ApplicationInfo.FLAG_SYSTEM) != 0;
|
||||
|
Reference in New Issue
Block a user