Restore IME visibility based on WindowState / requestedVisibleTypes
This CL changes the source of how the IME visibility should been restored: Before, the ActivityRecord of the WindowState held a flag with the visibility. However, this could led to the visibility being restored more than once, because it was not updated. With the recent changes, the ground truth is stored in the requestedVisibleTypes of an InsetsControlTarget. Therefore, this can be used to determine whether the IME was visible before, and if it should be restored. However, this also brings a behavior change when the IME was showing before, but not explicitly requested again after rotation. Unlike other insets types, the IME was showing up again in such a scenario. By activating this flag, an app has to explicitly request the IME to show after rotation, otherwise it remains hidden (except of when the editText has still focus, and SOFT_INPUT_STATE_ALWAYS_VISIBLE was set). Bug: 291740458 Bug: 391859600 Flag: android.view.inputmethod.disable_ime_restore_on_activity_create Test: atest KeyboardVisibilityControlTest#testImeHiddenWhenSoftInputStateUnchanged Test: atest KeyboardVisibilityControlTest#testRotateScreenWithKeyboardShownImplicitly Change-Id: Ibe4138f2184a7dec8fd64cdf0a120a8fdb0acfb6
Loading
Please register or sign in to comment