OSDN Git Service

Fix jank when dismissing InputMethodAndSubtypeEnabler.
authorYohei Yukawa <yukawa@google.com>
Fri, 1 Apr 2016 05:58:33 +0000 (22:58 -0700)
committerYohei Yukawa <yukawa@google.com>
Fri, 1 Apr 2016 05:58:33 +0000 (22:58 -0700)
commit6452b84763f864139a3744bd3406f72a0014301a
tree963de1aa6e11dcc1a502821727db7f3f6afa51c7
parenta2dda4122bb73f49fcd118a712c1aa61a303c11b
Fix jank when dismissing InputMethodAndSubtypeEnabler.

InputMethodAndSubtypeUtil#saveInputMethodSubtypeList() has a bug that
it saves implicitly enabled subtypes when "Use system languages" is
checked.  Implicitly enabled subtypes are transient data and the system
should have only a null data (0) in the persistent strage.  The root
cause of this bug is that the method in question has not checked whether
the preference item is in enabled (not grayed-out).   If it is
grayed-out, its checked state does not mean that the user manually
checked that subtype but it is just an indicator for the user.

The strange UI jank when dismissing InputMethodAndSubtypeEnabler is one
of the victim of the above bug because we have worked around it by
actually changing checked state before calling the method in question.

With this CL we no longer need to update preference items in
InputMethodAndSubtypeEnabler#onPause().

Bug: 27867966
Change-Id: Ifc291d77ea41a988438765b9ba16bc5d18a15e1b
src/com/android/settings/inputmethod/InputMethodAndSubtypeEnabler.java
src/com/android/settings/inputmethod/InputMethodAndSubtypeUtil.java