Merge changes from topic "b/142461756"

* changes:
  Ime target window should control when to hide IME (2/2)
  Ime target window should control when to hide IME (1/2)