From 7988287f0a3cd899c797c8457f2ba38bc851f5c4 Mon Sep 17 00:00:00 2001 From: Yohei Yukawa Date: Fri, 26 Feb 2021 11:51:00 -0800 Subject: [PATCH] Make "adb shell cmd input_method tracing" official This is a follow up CL to our previous CL [1], which introduced a new shell command to start/stop IME tracing. Perhaps this might be too opinionated, but "adb shell ime" had been used as a convenient wrapper only for enabling/selecting IMEs and not for doing anything beyond that. Admittedly adb shell ime tracing start is short and convenient, but keep in mind that for winscope we already type the following command. adb shell cmd window tracing start For better consistency, it'd make mose sense for us to use the following command instead. adb shell cmd input_method tracing start Note that this CL does not remove "adb shell ime tracing start" so as not to break internal tooling, but at some point we should migrate all the tools to use the new command. [1]: Ia89f11d5ef8a220ea7746191b18769cea5a8359d cf9e5123ce04dfe1d03b942a6a5632ca1b9b27fd Fix: 180765389 Test: "adb shell cmd input_method tracing start" works. Test: "adb shell ime tracing start" still works. Test: "adb shell ime list" still works. Change-Id: Ic53fd7c8baa3340250cf5e03bd225cce219eae61 --- .../server/inputmethod/InputMethodManagerService.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java index 87e63ebf26510..7dcb3a87e5f06 100644 --- a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java +++ b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java @@ -5417,6 +5417,8 @@ public class InputMethodManagerService extends IInputMethodManager.Stub switch (TextUtils.emptyIfNull(cmd)) { case "get-last-switch-user-id": return mService.getLastSwitchUserId(this); + case "tracing": + return mService.handleShellCommandTraceInputMethod(this); case "ime": { // For "adb shell ime ". final String imeCommand = TextUtils.emptyIfNull(getNextArg()); switch (imeCommand) { @@ -5434,7 +5436,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub return mService.handleShellCommandSetInputMethod(this); case "reset": return mService.handleShellCommandResetInputMethod(this); - case "tracing": + case "tracing": // TODO(b/180765389): Unsupport "adb shell ime tracing" return mService.handleShellCommandTraceInputMethod(this); default: getOutPrintWriter().println("Unknown command: " + imeCommand); @@ -5457,6 +5459,10 @@ public class InputMethodManagerService extends IInputMethodManager.Stub pw.println(" Synonym of dumpsys."); pw.println(" ime [options]"); pw.println(" Manipulate IMEs. Run \"ime help\" for details."); + pw.println(" tracing "); + pw.println(" start: Start tracing."); + pw.println(" stop : Stop tracing."); + pw.println(" help : Show help."); } }