Fix IME Overlay Layering Target visibility updates
In [1] we started tracking the visibility of the IME Input Target, and the IME Overlay Layering target (i.e. IME Layering Target that has FLAG_NOT_FOCUSABLE and FLAG_ALT_FOCUSABLE_IM). If there is a visible IME Overlay Layering Target, and the IME Input Target becomes invisible, then we hide the IME. In this case, the IME Input Target won't be updated, as the layering target is not focusable. If we wouldn't explicitly hide, the IME would show on the new layering target, using the requestedVisibleTypes of the (now outdated) input target. However, the initial issue tracked by [1] is still reproducible. Moreover, this state update is quite brittle, and in many cases left with an outdated value, which leads to InputMethodManagerService sending explicit IME hide request, because at some point we had a visible IME Overlay Layering target, and we didn't reset the state properly. This will first make sure we update this state properly when needed, with a follow up CL tracking this state removal, as well as a proper fix to the initial issue (252192121). [1]: Ia71b975898efb19439c3a1b1a9a2bdcf21b78650 Flag: EXEMPT bugfix Bug: 407125743 Test: atest DisplayContentTests#testDispatchImeOverlayLayeringTargetVisibilityChanged_whenLayeringTargetNull DisplayContentTests#testDispatchImeOverlayLayeringTargetVisibilityChanged_whenLayeringTargetChanges DisplayContentTests#testDispatchImeOverlayLayeringTargetVisibilityChanged_whenOverlayTargetAdded Change-Id: I3ddcc49947f68a18216551bc9434ce453debdeea
Loading
Please register or sign in to comment