Use correct binding flags when reconnecting to IME

Since ICS MR-1 [1], InputMethodManagerService (IMMS) establishes two
connections to an IME: one is for general connection and the other to
allow the system to adjust the IME's performance characteristics much
more like a foreground activity. The tricky point is that the former
connection can be re-connected not only IMMS#startInputInnerLocked() in
but also in IMMS#showCurrentInputLocked().

It turns out that some previous attempts to adjust BIND_ flags for the
former connection [2][3] were not applied to
IMMS#showCurrentInputLocked().  This CL addresses that inconsistency by
make it clear that IMMS establishes up to connections to the IME.

 [1]: Id1f73de66dc93d63212183958a72119ad174318b
      2c84cfc001fb92a71811bf7384b7f865ff31ff9d
 [2]: I1724113f42abe7862e8aecb6faae5a7620245e89
      c8230519728b14065effd3b7d4eca273ff86160c
 [3]: Ie5793fd9b40d980fa18f80246326511ed6ae0597
      f0f94d129b6eb3c48624e915898d86d4f2de59ff

Test: Manuall tested as follows.
      1. Build and flash an OS image.
      2. Complete the setup wizard (if any).
      3. tapas LatinIME && make -j
      4. adb install -r out/target/product/generic/system/app/LatinIME/LatinIME.apk
      5. Run a test program that keeps calling IMM#showSoftInput()
      6. adb shell ime enable com.android.inputmethod.latin/.LatinIME
      7. adb shell ime set com.android.inputmethod.latin/.LatinIME
      8. adb shell dumpsys activity processes android
         Make sure that there is a ConnectionRecord to
         com.android.inputmethod.latin that has "CR !FG UI !VIS" bits.
      9. adb install -r out/target/product/generic/system/app/LatinIME/LatinIME.apk
     10. adb shell dumpsys activity processes android
         Make sure that there is a ConnectionRecord to
         com.android.inputmethod.latin that has "CR !FG UI !VIS" bits.
Fixes: 36727763
Change-Id: Ib7fa34b21e1fb8bb5b19a9b08e36d0565f3dd266
1 file changed