Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dfdab739 authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

Fix IMMS debug shell command

It turns out the previous CL [1] introduced a new option not as
  adb shell cmd input_method refresh_debug_properties
but as a sub command of
  adb shell cmd input_method ime refresh_debug_properties
or
  adb shell ime refresh_debug_properties

This is not what we intended.

With this CL, 'refresh_debug_properties' is recognized as a sub
command of 'adb shell cmd input_method' as we intended.

 [1]: Ibf9dab3d9c138b5f04e053d41ee4fd248c78e4da
      75a92392

Bug: 37617707
Test: Verify following command reverts the behavior to the
      previous one:
        adb root
        adb shell setprop debug.optimize_startinput false
        adb shell cmd input_method refresh_debug_properties
Test: The following command is not recognized.
        adb shell ime refresh_debug_properties
Change-Id: I89b0900f402940d5943e1a6c6e236592b5cefc78
parent b3dc6321
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -4702,6 +4702,10 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
        @ShellCommandResult
        @Override
        public int onCommand(@Nullable String cmd) {
            if ("refresh_debug_properties".equals(cmd)) {
                return refreshDebugProperties();
            }

            // For existing "adb shell ime <command>".
            if ("ime".equals(cmd)) {
                final String imeCommand = getNextArg();
@@ -4720,8 +4724,6 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
                        return mService.handleShellCommandSetInputMethod(this);
                    case "reset":
                        return mService.handleShellCommandResetInputMethod(this);
                    case "refresh_debug_properties":
                        return refreshDebugProperties();
                    default:
                        getOutPrintWriter().println("Unknown command: " + imeCommand);
                        return ShellCommandResult.FAILURE;