Set the IME control's initiallyVisible to false
We create the insets source control on the server side in InsetsSourceProvider#updateControlForTarget, setting the control's initiallyVisible to the clientVisible. For the IME provider, we update the clientVisible to match the target's requestedVisibleTypes, added in [1]. We also reset the IME target's requestedVisibleTypes when we lose control in the ImeInsetsSourceConsumer on the client side. There is a race condition between resetting the requestedVisibleTypes in the consumer (client side) and reading the value in the provider (server side), which leads to the IME control having initiallyVisible set to true. However, this breaks some assumptions, as we expect the IME control's initiallyVisible to always be false. One example is triggering a hide request that would cancel an explicit show request. This replaces the logic for updating the IME controls's initiallyVisible based on the providers's clientVisible, to always set it to false, matching the IME expectations. This could only lead to an inconsistency between the actual visibility of the IME, and the visibility tracked by IMMS, which was already an issue, and is going to be fixed by the refactor in b/298172246. [1]: I1f140af6bcccbcbe6efb2fde9a789ac4c7bd127f Test: atest ImeSwitchingTest#testImeRemainsVisibleAfterSwitchingIme Bug: 328994329 Bug: 337122357 Change-Id: I459debedb243b4345b9981b88adf6e4a0ea9b44a (cherry picked from commit c8a1fbb5)
Loading
Please register or sign in to comment