Avoid exception from 'adb shell ime enable/disable'
This is a preparation to introduce CTS for per-profile IME.
Currently
adb shell ime enable <ime id>
and
adb shell ime disable <ime id>
can throw IllegalArgumentException when <ime id> is not recognized by
the system. This makes some sense, but if we start supporting
'-u all' option it'd make more sense if it just shows an error message
rather than letting the command crash with throing an exception.
This behavior change also removes a limitation that developers cannot
use
adb shell ime disable <ime id>
command to remove an IME ID from Settings.Secure.ENABLED_INPUT_METHODS
if that IME is not currently installed.
Bug: 120784635
Test: Manually verified as follows.
1. Build aosp_blueline-userdebug and flash it
2. adb shell ime enable com.example.android.softkeyboard/.SoftKeyboard
-> "Unknown input method <IME ID here> cannot be enabled"
3. adb shell ime disable com.example.android.softkeyboard/.SoftKeyboard
-> "Input method <IME ID here>: already disabled"
Change-Id: Ib9be7700557f2f606c90d62f79ec3afca2f82c40
1 file changed