OSDN Git Service

Use IBinder#shellCommand() for 'adb shell ime'
authorYohei Yukawa <yukawa@google.com>
Tue, 12 Dec 2017 01:24:55 +0000 (17:24 -0800)
committerYohei Yukawa <yukawa@google.com>
Tue, 12 Dec 2017 01:24:55 +0000 (17:24 -0800)
commit926488d70d09baefee0489537b2915602deaeebf
tree548bc371294ce32cb39d83159f4b98dfee983440
parent7a46c28d4571e037e26a28ea8e2a01312d916d47
Use IBinder#shellCommand() for 'adb shell ime'

This is a preparation CL to add a new command to 'adb shell ime'.

Currently 'ime' command is written in Java language that relies directly
on the internal Binder IPC interface IInputMethodManager.

This is not ideal because:

 1. We have to keep maintaining IInputMethodManager methods used
    only by the 'ime' command.
 2. Adding new options to the 'ime' command is tedious when it
    requires new methods in IInputMethodManager.

With this CL, all features of 'ime' command are re-implemented inside
InputMethodManagerService (IMMS) on top of Binder's "shell command"
feature [1].  Like 'am' command was gone recently [2], now 'ime' command
is also a simple shell wrapper to forward options to 'cmd input_method',
which allows us to 1) reduce the code duplication and 2) give non-zero
status code when the command fails with Java exception.

 [1]: I76518ea6719d1d08a8ad8722a059c7f5fd86813a
      9461b6f91f37fd32207da1bd734d9ea9629eb8e5
 [2]: Ia8187196af597046fd2e7092dbf19ce1dc1ea457
      1704e3cf0c445512f0a9644485dd3449e874556b

Bug: 70475949
Test: adb shell ime
Test: adb shell ime help
Test: adb shell ime dump
Test: adb shell ime list -a
Test: adb shell cmd input_method
Test: adb shell cmd input_method help
Test: adb shell cmd input_method dump
Test: adb shell cmd input_method list -a
Change-Id: I9a2dbbf1d4494addbe22c82e2c416eedc4d585f2
cmds/ime/Android.mk
cmds/ime/ime
cmds/ime/src/com/android/commands/ime/Ime.java [deleted file]
core/java/com/android/internal/view/IInputMethodManager.aidl
services/core/java/com/android/server/InputMethodManagerService.java