OSDN Git Service

Fix a race to detemine IME switcher visibilityde
authorYohei Yukawa <yukawa@google.com>
Fri, 12 Aug 2016 02:16:02 +0000 (19:16 -0700)
committerYohei Yukawa <yukawa@google.com>
Fri, 12 Aug 2016 02:16:02 +0000 (19:16 -0700)
commit982a94c5e3cce47d6c7ae4cdf7a4dbcdcc75431f
treeb2e1f8eefde10c18113891503ecad9887d1d5a67
parent0b26adbb8b42168d4fc5ef240b1e2730fcfd5c61
Fix a race to detemine IME switcher visibilityde

When the current user is switching to a user who requires password to
unlock, there is a chance that InputMethodManagerService has not
completed InputMethodManagerService#onSwitchUser() when the keyguard is
calling InputMethodManager#getEnabledInputMethodList() to detemine
whether the IME switcher icon should be shown or not.  If this occurs,
and if the previous user enables only one IME but the new user enables
multiple IMEs, it's possible that the IME switcher icon is not shown
when it should be.  Although the user is still able to work around this
by switch back to the previous user then the current user again until
the icon shows up, or can rely on a way to switch to next
IME (e.g. globe key) if it's available, the lack of the IME switcher
is still concerning since it can prevent the user from unlocking the
device.

As a quick workaround for this situation, this CL introduces a delayed
task to re-evaluate if we need to show the IME switcher icon on the
keyguard or not (currently the delay is set to 500msec) until this race
condition is fundamentally fixed.

Bug: 30640917
Change-Id: I93ea71d73540c31fbbe1cc4bd6747871f957dcc6
packages/Keyguard/src/com/android/keyguard/KeyguardPasswordView.java