Although there is a security check for IMM#showInputMethodPicker() [1],
any background application can virtually call the method via explicit
broadcast intent to Settings app.
Since showing IME picker from the notification has implemented in
InputMethodManagerService using protected-broadcast [2], the receiver in
Settings app isn't necessary and should be removed to close the security
bypass.
Note that this broadcast receiver stops working from Android-O due to
background check [3].
[1]: I4f0fc21268200c64d12b31ca54416acfbf62f37b
[2]: Id36c8c34159bea8b72557b40bcf024d401f580b6
[3]: https://developer.android.com/preview/features/background.html#broadcasts
Test: The following broadcast intent will not show IME picker.
$ adb shell am broadcast \
-a android.settings.SHOW_INPUT_METHOD_PICKER \
com.android.settings
Fixes: 64008672
Bug: 63644555
Change-Id: Id990c66516c9b3ed7ada6891746ec0e0eecbe545
Previously, Settings application was using TextServicesManager APIs to
update any of the spell checker settings (i.e., enabled/disabled, spell
checker, subtype). Since these APIs are used only by the Settings
application, there is no need to expose it to other services and the
Settings application can directly write them to secure settings since it
has the WRITE_SECURE_SETTINGS permission.
Bug: 62950392
Test: Manually 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. Install SampleSpellCheckerService
4.1 tapas SampleSpellCheckerService
4.2. make -j
4.3. adb install -r out/target/product/generic/system/app/SampleSpellCheckerService/SampleSpellCheckerService.apk
5. Go to spell checker settings in the system settings
6. Select 'SampleSpellCheckerService' through Settings app
7. Run
adb shell settings get secure selected_spell_checker
and make sure it returns the following value
com.example.android.samplespellcheckerservice/.SampleSpellCheckerService
8. Run
adb shell settings get secure selected_spell_checker_subtype
and make sure it returns '0'
9. Select 'Android Spell Checker (AOSP)' through Settings app
10. Run
adb shell settings get secure selected_spell_checker
and make sure it returns the following value
com.android.inputmethod.latin/.spellcheck.AndroidSpellCheckerService
11. Run
adb shell settings get secure selected_spell_checker_subtype
and make sure it returns '0'
12. Tap 'Languages' on the spell checker settings to select 'French'
13. Run
adb shell settings get secure selected_spell_checker_subtype
and make sure it returns '102517'
14. Select 'SampleSpellCheckerService' again through Settings app
15. Run
adb shell settings get secure selected_spell_checker
and make sure it returns the following value
com.example.android.samplespellcheckerservice/.SampleSpellCheckerService
16. Run
adb shell settings get secure selected_spell_checker_subtype
and make sure it returns '0'
Test: Manually 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. Install SampleSpellCheckerService
4.1 tapas SampleSpellCheckerService
4.2. make -j
4.3. adb install -r out/target/product/generic/system/app/SampleSpellCheckerService/SampleSpellCheckerService.apk
5. Set the current spell checker service to be AOSP SCS by
adb shell settings put secure selected_spell_checker com.android.inputmethod.latin/.spellcheck.AndroidSpellCheckerService
6. Run a test program that has TextView and tap on one of the
TextViews and type some text.
7. Observe that there is a connection to AOSP SCS by
adb shell dumpsys textservices
8. Set the current spell checker service to be
SampleSpellCheckerService SCS by
adb shell settings put secure selected_spell_checker com.example.android.samplespellcheckerservice/.SampleSpellCheckerService
9. Tap on the same TextView as in Step 6
10. Observe that there is a connection to SampleSpellCheckerService
SCS (for this TextView) by
adb shell dumpsys textservices
Change-Id: I2f3d5282a342bcb42abf995d6e7834241e11cd4f
The implementations have been imported into SettingsLib. Setting's copy
can now be removed, which this change also does.
Test: Manually check battery status, which uses FooterMixin, looks OK.
make RunSettingsLibRobotTests && make RunSettingsRoboTests
&& make RunSettingsGoogleRoboTests
Change-Id: I6539605fdad80d156ff5ff249e68df4a1c412067
This is needed because keyboard names can contain characters from mixed
locale. Without Bidi wrapping the labels will be garbled and not
readable.
Change-Id: I47668a65d7bef8828ad0424097834929ec12700d
Fix: 37353900
Test: make RunSettingsRoboTests
Allows enabling/disabling IMEs on TV.
Moves InputMethodPreference to SettingsLib.
Also minor code tidying
Bug: 36079941
Test: Keyboard settings still work on Fugu and Ryu
Change-Id: Idf42cf5c46d5bb32db59924819d64f73d533d105
(cherry picked from commit 2ec69563cd)
- Show summary under virtual keyboard: list all avaiable keyboards
- Set about phone subtext to device model string.
- Update DND Suggestion text
Change-Id: I20acffcf691d1354c7636f5851b376099844700f
Fix: 35959817
Fix: 36395109
Test: robotests
And move the layout to settingslib.
The new TwoTargetPreference is a preference object that has a vertical
divider between main panel and widget (if it exists).
Converted master switch, restricted preference, gear preference to use
the new style
Change-Id: Ia3848cebb06b8edc4e60abf9b0caf13cdb29c22c
Fix: 36511169
Test: make RunSettingsRoboTests
- remove activity alias: DevelopmentSettingsDashboardAlias,
DateTimeDashboardAlias, AboutDeviceDashboardAlias,
BackupResetDashboardAlias, EnterprisePrivacyDashboardAlias, and
AccessibilityDashboardAlias and updated the corresponding target
activities with the alias metadata.
- remove InputMethodAndLanguageSettingsActivity and
GestureSettingsActivity and the associated xml.
Bug: 35764802
Test: make RunSettingsRoboTests
Change-Id: I7d4922f8dfaac40e8ad077a68008185cd9fe3304
Use the centralized registry to look up category key instead.
Bug: 32936784
Test: make RunSettingsRoboTests -j40
Change-Id: I0b8c72d70f93e4b5c58871ac90de41f69ad15653
This CL moves the code building index of IMEs from
InputMethodAndLanguageSettings to VirtualKeyboardFragment and
AvailableVirtualKeyboardFragment, so that a search landing page of IME
becomes one of the fragment correctly depending on the IME state.
Bug: 32643633
Test: Manually installing/uninstalling AOSP LatinIME.apk while
Settings app is/isn't running, then search AOSP and verify the
landing page is correctly determined by the IME's enable state.
Test: Update robolectric DynamicIndexableContentMonitorTest
Change-Id: Ie44f358c2d3919fc864f4f88e6229293113823dd
This CL moves the code building index of physical keyboards from
InputMethodAndLanguageSettings to PhysicalKeyboardFragment, so that a
search landing page becomes PhysicalKeyboardFragment as expected.
Bug: 32643633
Test: Connecting/Disconnecting Anker bluetooth keyboard while Settings
app is/isn't running, the search Anker and verify landing page
is PhysicalKeyboardFragment.
Test: Update robolectric DynamicIndexableContentMonitorTest.
Change-Id: I51f308ada74966a96c258f8ef50a9b4fc7bc6635
Disable NFC fragments when feature is not avaiable
Link to spell checker screen with the pref is clicked
Tint "add"/"delete" button in UserDictionary actionbar to proper color.
Change-Id: I8a8e219ce3dbbafc6c4d5a0f34f835ffd0abad4f
Fix: 34155679
Fix: 34161006
Fix: 34154795
Test: RunSettingsRoboTests
Refactor content monitoring code into a few singletons to keep alive
while Settings app is running.
Bug: 32995210
Test: Manually installing/uninstalling AOSP LatinIME.apk while
Settings app is/isn't running, then search AOSP.
Test: Connecting/Disconnecting Anker bluetooth keyboard while Settings
app is/isn't running, then search Anker.
Test: Added Robolectric test for DynamicIndexableContentMonitor.
Change-Id: I588e33be169fc9677d41c3daa59ab400f04f6419
This allows app fragment use a less heavyweight fragment as super class
if they don't need PreferenceFragment. Using this class as base is
generally easier to set up robolectric tests too.
Bug: 33354536
Test: RunSettingsRoboTests
Change-Id: I91c4d242ea0333c76c8767c03c3f18dee6b6e104
- Refactor GesturePreference to a generic VideoPreference.
- The old video_preference.xml is only for magnification video, so
renamed.
- And use VideoPreference in gesture setting pages.
- Refactor common logic into GesturePreferenceController.
Bug: 32637613
Test: RunSettingsRoboTests
Change-Id: I58580b01a32873cb32c5dc5bf2ec021d5b1400cc
In this change input & gesture page added 5 separate gesture
preferences, each should lead to a new page to set gesture setting. For
now only swipe to notification preference is wired up. Will implement
the rest in later changes.
Bug: 32637613
Test: make RunSettingsRoboTests -j40
Change-Id: I57ceea8fcd85f3a0ab59cbd12da50b7138f5ca0c
- Removed LanguageAndInputDashboardAlias because now the contents are
moved to new pages.
Bug: 32637613
Bug: 32643833
Test: RunSettingsRoboTests
Change-Id: Ia66a942a449a07b9cbba53bdc97738148aafadb4
Bug: 32642706
Bug: 32637613
Bug: 32643833
Test: RunSettingsRoboTests
This change is necessary to test preference controlling logic, as well
as making preferences reusable in other Preference pages in the new
information architecture.
Change-Id: I9e2fd2f6800579f005a5c303ed03ae06477006a6
InputMethodAndLanguageSettings calls InputMethodAndSubtypeUtil for no
good reason. The page does not display or provide ways to change IMEs.
The virtualKeyboardFragment does, and it already contains logic for
refreshing InputMethodAndSubtypeUtil.
Bug: 32642706
Test: Compiles
Change-Id: Icdbf9cd2fa95ba3037c1e47d62c7514376cf8037
- Removed unused preferences that are commented out in pref xml.
- Also removed code that references to them in Fragment.
Bug: 32637613
Test: compile/manual
Change-Id: I84be24f9c5df7531843f03b047a93f9aa912432e
- The prefrence is not used in code according to comment, and it's not
defined in xml. So this chunk of code is redundant and should be
removed.
Bug: 32642706
Test: compiles, and manually navigate to fragment.
Change-Id: Iac38632d090c635f324bc4eed8e1c41300ddb08e
Refactored getLocaleNames() into a FeatureProvider interface so it's
reusable and testable.
Bug: 31801428
Test: RunSettingsRoboTests
Change-Id: I2d31a66a4b32cfa7a364a4cfef1f6eea87084577
When adding/editing a word for your personal dictionary
rotating the screen could cause the language to change
back to the device default. This has been fixed.
Test: ag/1389633, robolectric not supported in this branch.
Bug: 30874931
Change-Id: I0c8ebec5f4d5e7b23112b656c482c3b2cda7791f
Bug: 30681771
Test: SettingsUnitTests
Refactor visibility logging from InstrumentedFragment into a mixin. And
apply mixin in remaining fragments.
Change-Id: Ibbb59904336254a3e4bb9e8c7d0b36e5a6bc2622
This is a small follow up CL to the previous CL [1] that added
functionality to show a warning dialog when Direct Boot unaware apps and
IMEs are being selected.
In the previous CL, we checked whether the package to which the IME
belogs to is (fully or partially) Direct Boot aware. If the package is
partially Direct Boot aware but the InputMethodService in question is
still Direct Boot unaware, the user will not see the warning dialog.
Luckily in InputMethodPreference we already have InputMethodInfo that
indirectly exposes ServiceInfo#directBootAware. By directly checking
that bit we can simplify the logic and avoid such false negatives.
[1]: I0498904d2f664fb41e8c1e6bb30d1cbf437cf4b9
4a8136b51b
Bug: 27196876
Change-Id: I869a7bd87748f09f7032a60b34ac0dbdc4a00b72
Certain apps like Phone, SMS, Emergency Info, and IME are critical
enough that they ideally need to be runnable before the device is
unlocked after a reboot. Users can still pick non-Direct Boot aware
apps, but this change now warns users that the selected app won't be
runnable until after unlocking.
Bug: 27196876
Change-Id: I0498904d2f664fb41e8c1e6bb30d1cbf437cf4b9