OSDN Git Service

Select only preinstalled Spell Checker Services
authorGuliz Tuncay <gulizseray@google.com>
Wed, 16 Aug 2017 19:02:31 +0000 (12:02 -0700)
committerBryan Ferris <bferris@google.com>
Thu, 10 Jan 2019 17:54:12 +0000 (17:54 +0000)
commited5973b8a8a2c0f0fc1f39c59c33f81882f41405
tree1f042adcc12568201656da9642b7fabbe7d5eeec
parent170e24d4e1f05e73ae8d52d215193a97d8b36eb3
Select only preinstalled Spell Checker Services

When we are setting a new spell checker as the default one in
Secure.Settings, TSMS#findAvailSpellCheckerLocked can pick up
any available spell checker service. This violates the principle
that user should be warned whenever we are setting an untrusted
spell checker service as the default service, since the warning
dialog is never shown.

Fixes: 64764051
Bug: 118694079
Test: Manually as follows:
1. Open 'packages/inputmethods/LatinIME/java/AndroidManifest.xml'
     and remove 'AndroidSpellCheckerService'
2. lunch aosp_buillhead-userdebug && make -j
3. Flash the image
4. adb shell dumpsys textservices
    -> no spell checker is recognized
5. adb shell settings get secure selected_spell_checker
    -> null
6. tapas SampleSpellCheckerService
7. make -j
8. adb install -r $OUT/system/app/SampleSpellCheckerService/SampleSpellCheckerService.apk
9. adb shell dumpsys textservices
    -> SampleSpellCheckerService is recognized
10. adb shell settings get secure selected_spell_checker
    -> null

Change-Id: I16f12293d15258c9148677c7ee09fe6dcf81e81d
Merged-In: Idab3ecc246fe9344a09e6907a0ba39f8ea6506f9
services/core/java/com/android/server/TextServicesManagerService.java