RESTRICT AUTOMERGE: Polish IME transition from fullscreen task to split-screen task

As the new split-screen behavior that the root task of the split-screen
can be in the recents task, so using quick switch can switch between
the split-screen task and other fullscreen tasks.

So if the IME shown on the fullscreen task, when quick switch to
the split-screen task, basically the expected result will be IME
attached on the fullscreen task then won't expect IME moved to the
split-screen task.

However, the issue case is that seen the IME flicker on top of the
split-screen task and then disappeared.

The root case is in DC#computeImeParent didn't consider to not change
the new IME surface parent while the next IME input target has not yet
updated and settled the new IME visiblity, so IME may flicker if
changing the new IME parent too early.
(Typically the IME parent will be on the root displayArea when the
next target task is in multi-window mode)

We do defer changing IME parent from CL[1] when shouldImeAttachedToApp is
true, but this check didn't applied when switching to the split-screen
task, because shouldImeAttachedToApp will be false when the next IME
layering taget is in multi-window mode.

Simply move the above defer update IME parent logic out from
shouldImeAttachedToApp check to fix this IME flicker issue.

Also, remove shouldImeAttachedToApp check in
InsetsPolicy#adjustVisibilityForIme when the window is in insets frozen
state waiting for the next input started. Since there is no strong
reason to froze IME insets only when switching on fullscreen tasks.

[1]: I01b67b9a7fdf04f23ab05c244281f42518352ca5

Fix: 210391817
Test: atest DisplayContentTests#testComputeImeParent_inputTargetNotUpdate
Test: atest WindowStateTests#\
   testAdjustImeInsetsVisibilityWhenSwitchingApps_toAppInMultiWindowMode

Change-Id: I332c0e4fff62df5d7b793eda2767bb58fe85a938
5 files changed