Merge "Add a debug utility for InputMethodUtils"
This commit is contained in:
committed by
Android (Google) Code Review
commit
fd5d153af8
@@ -72,6 +72,28 @@ public class InputMethodUtils {
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public static String getApiCallStack() {
|
||||
String apiCallStack = "";
|
||||
try {
|
||||
throw new RuntimeException();
|
||||
} catch (RuntimeException e) {
|
||||
final StackTraceElement[] frames = e.getStackTrace();
|
||||
for (int j = 1; j < frames.length; ++j) {
|
||||
final String tempCallStack = frames[j].toString();
|
||||
if (TextUtils.isEmpty(apiCallStack)) {
|
||||
// Overwrite apiCallStack if it's empty
|
||||
apiCallStack = tempCallStack;
|
||||
} else if (tempCallStack.indexOf("Transact(") < 0) {
|
||||
// Overwrite apiCallStack if it's not a binder call
|
||||
apiCallStack = tempCallStack;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return apiCallStack;
|
||||
}
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
public static boolean isSystemIme(InputMethodInfo inputMethod) {
|
||||
|
||||
Reference in New Issue
Block a user