Skip to content
Commit 9cd0c8a6 authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

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
      7f8ee4b9

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
parent a927c591
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment