Report WINDOW_FOCUS_GAIN_REPORT_ONLY when the served connection remains

When we tried CL[1] to fix Gboard Translation UI dialog dismissed that
keeping the served view when focused to the next window,
although we can skip starting new input when the window focused back as
the behavior of Q,

However, we overlooked in R, IME insets will rely on IMS#reportStartInput
to get the updated IME input target, which will out of sync for the above
case.

To fix this regression, we report the next window focus gain
to IMMS with WINDOW_FOCUS_GAIN_REPORT_ONLY when the next focused view is
same as current served view and the served input connection remains.

so that in IMMS side won't get StartInputFlags.INITIAL_CONNECTION flags
to set restarting as false when calling IInputMethod#startInput to IMS,
and in IMS side will still call reportStartInput to WMS for updating
IME input target without additional onFinishInputView callback to
client.

[1]: I8d4fff94ba9313b773bc27fcbd019cc88580d3e9

Fix: 152373385
Bug: 155781821
Test: atest CtsInputMethodTestCases
Test: manual, make sure Bug 155781821 comment #10 works:
    1) Launch video call in Hangouts.
    2) End call.
    3) Click on the text box.
    4) Expect Soft-Keyboard shown
Test: make sure not break Bug 148489857 and Bug 148788569, following
auto / manual test to verify:
 - Auto: atest FocusHandlingTest#testKeyboardStateAfterImeFocusableFlagChanged
 - Manual:
    1) Build / install EditTextVariations
    2) Select menu -> Direct-Reply, make sure Notification comes up.
    3) Tap EditText on Notification, verify soft-keyboard is visible.

Change-Id: I45a9814d812ad906f417c24200fd4219959e2423
3 files changed