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

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

Make `shell ime reset` work again for bg users

This is a follow up CL to my previous CL [1], which unexpectedly
changed the behavior of

  adb shell ime reset

in a certain situation, that is, when you call it with '--user' option
such as '--user all' and '--user 10', and if there is any manually
enabled IME for background users, then such manually enabled IMEs are
no longer disabled.

With this CL, such a manually enabled IME (if any) will be reset into
the disabled state as it used to be.

 [1]: I01d13d1f46a5af19d6db18246f74a20a4fe14168
      13e67d43

Test: Manually verified as follows
  1. Build aosp_bluejay-trunk_staging-userdebug and flash it
  2. make -j SoftKeyboard
  3. adb shell pm create-user test_user
  4. adb shell am start-user 10
  5. adb install --user 10 -r  \
         $OUT/system/app/SoftKeyboard/SoftKeyboard.apk
  6. adb shell ime list -s --user 10
     -> SoftKeyboard not is included.
  7. adb shell ime enable --user 10  \
         com.example.android.softkeyboard/.SoftKeyboard
  8. adb shell ime list -s --user 10
     -> SoftKeyboard is included.
  9. adb shell ime reset --user 10
 10. adb shell ime list -s --user 10
     -> SoftKeyboard not is included.
Bug: 309837937
Fix: 336899188
Change-Id: I406031c59575a51b70382dc8a6af55e36d875953
parent dc961591
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -6407,7 +6407,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
                            nextEnabledImeIds[i] = nextEnabledImes.get(i).getId();
                        }
                        settings.putEnabledInputMethodsStr(InputMethodUtils.concatEnabledImeIds(
                                settings.getEnabledInputMethodsStr(), nextEnabledImeIds));
                                "", nextEnabledImeIds));

                        // Reset selected IME.
                        settings.putSelectedInputMethod(nextIme);