Fix IME flicker by dispatching unrelated insets after unset IME frozen

CL[1] to add InsetsStateController#updateAboveInsetsState in
DC#updateImeInputAndControlTarget that after setting
mImeInsetsFrozenUntilStartInput as false to unfreeze IME insets,
so that increases the possibility to deliver the last IME insets
change to non-IME input target window that didn't request show IME.
(Since updateImeInputAndControlTarget will call
 WindowState#insetsChanged to client eventually)

As typically the new IME insets change will deliver to the client when
server receives InsetsStateController#onInsetsModified(InsetsControlTarget)
from the client requests IME visible after
DC#updateImeInputAndControlTarget.

So in DC#updateImeInputAndControlTarget, we should ensure to unfreeze
IME insets after the input target updated, in case updateAboveInsetsState
may deliver unrelated IME insets change to the non-IME requester.

[1]: I57357ba85501397fa5926ab4dee116c42df24506

Bug: 213522825
Test: atest ActivityRecordTests#\
       testImeInsetsFrozenFlag_noDispatchVisibleInsetsWhenAppNotRequest
Test: atest WindowStateTests#\
        testAdjustImeInsetsVisibilityWhenSwitchingApps
Test: Verify Bug 195385541 and Bug 195846009 that keyboard
      won't cover the edit text.

Change-Id: I95c5b45bd4cf9c30ff7771b2db485c8ae2b0c6db
(cherry picked from commit 938eb8fd2ded04bbcd5f32576a7bb4eaf186d56a)
Merged-In:I95c5b45bd4cf9c30ff7771b2db485c8ae2b0c6db
2 files changed