Fix IME flickering when swiping out to home
When switching tasks between different users (i.e. primary and work-profile user), if the source task has shown IME, when going to the target task, IMMS will first unbind the current input method of the current user and hide the soft-keyboard and the window token by HIDE_SWITCH_USER reason, and then re-bind the input method of the target user when focused to the target task. If the hide soft-keyboard somehow being delayed and comes after the target task has been focused and be the next IME target, user will see the window removal transition on top of this IME target window. (i.e. launching Google chat apps with IME shown from work-profile and then swiping out to home screen) Even if we disable window animation in Activity#onDestory in IME client side, the next relayout can come before that, so window exit transition still happens. To fix this timing issue, add animateExit parameter in WindowManagerInternal#removeToken for IMMS not to perform window exit animation and to hide the window surface permanentaly, so we can avoid the window surface becoming visible again unexpectedly during relayout. Fix: 197494607 Fix: 195449326 Test: atest WindowTokenTests#\ testRemoveWindowToken_noAnimateExitWhenSet Test: manual as issue steps: 1. Enter Google chat 2. Start typing a message 3. Swipe home 4. Expect no IME surface flicker happens Change-Id: I044257b5ac0d92dd06dae8eba996ea0ac6f1e659
Loading
Please register or sign in to comment