Fix possible incorrect output from 'adb shell ime reset'
This is a follow up CL to my previous CL [1], which enabled
InputMethodManager#getEnabledInputMethodList() to return the result
based on the caller's user ID, not based on the current IME user,
which is mSettings.getCurrentUserId().
Since InputMethodManagerService#handleShellCommandSetInputMethod()
always runs as user 0, we cannot actually simply call
IMMS#getEnabledInputMethodList() any more from that method. Instead,
we should use mSettings.getEnabledInputMethodListLocked() so that the
right user's result should be shown on the console.
This is a minor fix for the output message of a debug command. There
should be no visible behavior change for production use cases.
[1]: I192a0f5a1375170d17a4c08af94f23966dbaea8b
7f8ee4b9ddd31ad36a12c5278b27990dc76011cc
Bug: 122164939
Fix: 123906510
Test: Manually verified as follows.
1. Build aosp_taimen-userdebug and flash it.
2. make -j SoftKeyboard
3. adb install -r $OUT/system/app/SoftKeyboard/SoftKeyboard.apk
4. adb shell ime enable com.example.android.softkeyboard/.SoftKeyboard
5. adb shell pm create-user test_user
6. adb shell am switch-user 10
7. adb shell ime reset
-> Confirm that the output is
Reset current and enabled IMEs
Newly selected IME:
com.android.inputmethod.latin/.LatinIME
Newly enabled IMEs:
com.android.inputmethod.latin/.LatinIME
Change-Id: I4c29ade9373b0fa5ab77f5a349017389ff1fb827
1 file changed