Use a separate lock object instead of mSpellCheckerMap

In order to make TSMS multi-user aware, the first step is to get rid of
the use of user-specific mSpellCheckerMap (since there will be one for
each user) in the synchronized blocks, and instead use a separate
object lock.

Bug: 63041121
Test: Manually tested as follows.
      1. Build and flash an OS image.
      2. Complete the setup wizard (if any).
      3. Make sure AOSP Keyboard (com.android.inputmethod.latin)
       is installed.
      4. adb shell settings put secure selected_spell_checker com.android.inputmethod.latin/.spellcheck.AndroidSpellCheckerService
      5. Observe that there are no bindings to the selected spell
       checker service (SCS) by running
       adb shell dumpsys textservices
      6. Observe that there is no connection to selected SCS by running
       adb shell dumpsys activity services com.android.inputmethod.latin
       There should be no ConnectionRecord for
       AndroidSpellCheckerService
      7. Run a test program that has TextView and tap on one of the
       TextViews and type some text.
      8. Repeat steps 5 and 6 to observe there are now bindings and
       connection to the selected SCS.
      9. Kill the app manually. Repeat steps 5 and 6 to see bindings
       and connections are removed again.
      10. adb shell settings put secure selected_spell_checker com.google.android.inputmethod.latin/com.android.inputmethod.latin.spellcheck.AndroidSpellCheckerService
      11. Repeat 7, 8, 9.
      12. Switch to a secondary user account. Repeat 3-11.
Change-Id: Ic8772accb4c6225a1e662fd2fa371b2f4c87e445
1 file changed