Add logic to handle cases that IME is already shown

The logic was removed previously by mistake. This CL adds it back and
takes care of the animation direction.

Fix: 152450770
Test: Steps in the bug.
Change-Id: I4a0ca2593dab891232e2f9d4a82400a700b8f069
1 file changed