This CL adds "Work profile" section to Languages and input settings.
The new section is visible when and only when work profile is enabled.
Hence there should be no user-visible behavior difference when work
profile is not enabled.
If per-profile IME [1] is also enabled, the following 3 preferences
will be shown in the new section.
* Virtual keyboard for work
* Spell checker for work
* Personal dictionary for work
[1]: Ied99664d3dc61b97c919b220c601f90b29761b96
a878b9500e6b89dce9738179edc27bcd0d736b7e
Fix: 120748696
Test: Manually verified as follows.
1. Build and flash an AOSP build
2. adb root
3. adb shell setprop persist.debug.per_profile_ime 1
4. adb reboot
5. Install Test DPC
6. Enable managed profile with Test DPC
7. tapas SoftKeyboard && make -j
8. adb install -r --user 0 $OUT/system/app/SoftKeyboard/SoftKeyboard.apk
9. tapas SampleSpellCheckerService && make -j
10. adb install -r --user 0 \
$OUT/system/app/SampleSpellCheckerService/SampleSpellCheckerService.apk
11. Open Settings -> System -> Languages & input
12. Virtual Keyboard -> Manage keyboards:
Make sure both "Android Keyboard" and "Sample Soft Keyboard" are shown.
13. Spell checker -> Default spell checker
Make sure "Android Spell Checker" and "Sample correction" are shown.
14. Advanced -> Virtual Keyboard for Work -> Manage keyboards
Make sure that only "Android Keyboard" is shown.
15. Advanced -> Spell checker -> Default spell checker
Make sure that only "Android Spell Checker" is shown.
Change-Id: Id88928318ab1cd92963d652ae39ca772222ea4ac
Since view id changed after fragment migration,
we correct view id.
Change-Id: If81ca06423ac62fd9f6a118be0b5fe3c93356142
Fixes: 117559309
Test: robotest
Having consistent import order will reduce chance of merge
conflict between internal and external master
Test: rebuild
Change-Id: I0b1a170967ddcce7f388603fd521f6ed1eeba30b
When possible, remove or simplify getNonIndexable() logic in fragments,
and use searchable="false" in xml to suppress index.
Change-Id: I5bdf5bc7d5494a64cdd9e230a51321a4b210af69
Fixes: 112608186
Test: robotest and manual search
This CL only changed AlertDialog imports.
So, reviewer can review it easily.
Change-Id: I097bc44394195b14287f4f920c570ac8653f356a
Fixes: 111413092
Test: This CL can't pass Robo test.
This patch focused on fixing compile errors and some runtime errors.
Test: We can't test it now. But we will have an integration test later.
Bug: 110259478
Change-Id: I16c471ddcd0fa1460c665b7f74d86fcace5ee67b
- Make SettingsPreferenceFragment implement Indexable directly
- Add existing fragments that are SettingsPrefFragment but not Indexable
to grandfather list.
- Fix "font size" fragment so it shows up in search properly.
- Remove duplicates for "lock screen display", "Screen saver".
Bug: 70720645
Test: robotests
Change-Id: I44ce0cac0fdf5e882b315861bb4bebc45dbe01e6
Distinguish between settings which are permanently unavailable on
the device, and temporarily unavailable. This enables us to restrict
which setting slices are exposed in onSliceGetDescendants.
The primary changes in this CL are renaming:
"DISABLED_UNSUPPORTED" -> "UNSUPPORTED_ON_DEVICE"
to be more clear the the setting will cannot be accessed on the device, and,
adding a new enum to encapsulate settings which are currently unavailable, but
could be enabled in the future.
Also remove UNAVAILABLE_UNKNOWN. Devs should never need this enum.
Bug: 78910582
Bug: 79245656
Test: robotests
Change-Id: I58821a6cfd6134b3b351657b6edf5f74ead00643
For make this method usage more clear,
setTitle(charSequence) rename as setTitleText,
add java doc: it is only for user generated string
setTitle(int) rename as setTitleRes.
Change-Id: I972cb6a8ff90873dfdc25c23f6dc3d68103c8e4e
Fixes: 78347436
Test: make RunSettingsRoboTests
Currently in Settings we are using R.string.join_many_items_first, R.string.join_many_items_middle and R.string.join_many_items_last to manually join strings. The join code is messy and the joined string is incorrect in some languages, so we migrate all string join to just use ListFormatter.getInstance().format().
Bug: b/78248791
Test: robotests
Change-Id: I898339978e6e2027587e28994b0280fa46821fd6
Also convert the controller to TogglePrefCtrl, and register it in xml.
Change-Id: Ifbc95364b47690117b2875cba1cdc4761ad205be
Bug: 71972185
Test: make RunSettingsRoboTests
- Build a controller to generate a list of preferences and add to screen.
- Move some logic to controller.
- Add some test cases for controller.
Test: manual
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.inputmethod
make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.core
make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.dashboard
atest UniquePreferenceTest
Change-Id: I4ebe486ade3439b9814b11866c402dcf881f21a7
- Build a controller to generate/manage a list of preferences.
- Move some logics to the controller and add tests.
Test: manual
Test: make RunSettingsRoboTests -j
atest UniquePreferenceTest SettingsGatewayTest
Change-Id: Ia3d885cb8917c7d5498b87818e24b938f0d95dbb
InputMethodUtils.InputMethodSetting is a quite complicated inernal
class of InputMethodUtils and PhysicalKeyboardFragment's depending on
it just for getting/setting SHOW_IME_WITH_HARD_KEYBOARD is overkill.
With this CL, PhysicalKeyboardFragment just uses Secure Settings APIs
directly.
There should be no user-visible behavior change.
Bug: 77730201
Test: Manually verified as follows:
1. Open system settings.
2. Tap "System" -> "Languages & input" -> "Physical keyboard"
3. Make sure "Show virtual keyboard" is unchecked
4. Make sure the following command shows 0
adb shell settings get secure show_ime_with_hard_keyboard
5. Check "Show virtual keyboard"
6. Make sure the following command shows 1
adb shell settings get secure show_ime_with_hard_keyboard
7. Run the following command
adb shell settings put secure show_ime_with_hard_keyboard 0
8. Make sure "Show virtual keyboard" is chenged to unchecked
Change-Id: I956da5dad27313d6edf141f2320bb0a7954fbbea
This is logical revert of a CL [1] that was recently re-introduced as
part of my recent CL [2].
Reason for revert:
Directly showing the layout selection screen when there is no hardware
keyboard is selected yet is not something people had been familiar
with.
That behavior had been enabled only in a short period during Android N
development cycle and was never enabled in most of production builds.
To avoid confusions, let's revert back to the true Android M behavior
by logically reverting that change.
[1]: I4483dfc89afc8d148b2cfa7c6a5f66d2a02f712a
17b6319884
[2]: I7a2ed6dd39dcd8207d3d94e12cd01d5d67ba4bb5
7129b374bb
Change-Id: If0529e20cbff432d38d9b2dd74eeb3af0da5baf1
Bug: 66498367
Fix: 75318417
Test: Manually verified
This CL logically reverts Settings app changes for Bug 25752812, which
aimed to improve UX by tightly integrating physical keyboard layout
with input method subtype.
What went wrong is that the concept of input method subtype is not
widely accepted by the ecosystem actually. Until we figoure out any
other better way here, let's revert back to the good old way that
enables users to specify multiple keyboard layouts per physical
keyboard device, not one layout per one input method subtype.
Note that we cannot simply revert the CL that originally introduced
the new flow [1] because it was indeed a huge CL that also touched IME
settings, which we want to continue using. In that sense, this CL is
a kind of re-implementation of the previous style on top of the recent
language settings flow.
Note also that a fix [2] fox Bug 25062009 was also ported from
previous InputMethodAndLanguageSetting to
KeyboardLayoutPickerFragment.
[1]: I728d7ee185827ed328c16cb7abce244557a26518
976bb3f459
[2]: I4483dfc89afc8d148b2cfa7c6a5f66d2a02f712a
17b6319884
Fix: 66498367
Test: make -j RunSettingsRoboTests
Test: Manually done with two Bluetooth keyboards
Change-Id: I7a2ed6dd39dcd8207d3d94e12cd01d5d67ba4bb5
- for fragments that do not implement the preference screen, change them
to inherit from InstrumentedFragment instead.
Change-Id: I791c2634024bd2c248efea955be5c680180d735c
Fixes: 68277111
Test: make RunSettingsRoboTests
When enter/exit from "Languages & input" screen repeatedly, memory
leak happens since InputDeviceListener is not unregistered.
Listener registration is called in onPause() when exiting from the
screen, but new activity is created when enter the screen and the
listener registered by previous activity is not unregistered in
onResume().
Bug: 72675680
Test: Manual - Repeat enter and exit "Language & input" page for
several times and check if the count of activity doesn't increase.
Change-Id: I8e0be0ab4b1d13d53c3868b10f409d1e06387c2f
This adds seven new boolean flags:
config_show_phone_language
config_show_virtual_keyboard_pref
config_show_physical_keyboard_pref
config_show_spellcheckers_settings
config_show_tts_settings_summary
config_show_pointer_speed
config_show_vibrate_input_devices
Which when individually set to false, will hide the item from "Language
& input" in System. It will also hide them from surfacing in search
results.
Bug: 62379555
Test: Individual controller tests are all updated.
Change-Id: I9ef1c3037b0bec6ffa5a627006507f4f16e534c4
- Never return null when querying userDictionaryLocales
- Auto mirror mobile setting icon in RTL to match status bar.
Fixes: 65298627
Fixes: 65361092
Test: robotests
Change-Id: I0f9827f7bc23baf4895712c0f86584aeccfb9c73
Convert input device search into a search query loader
And remove old logic from DynamicIndexableContentMonitor
Change-Id: If652b1ea7c8add9185bbd025055e14925d3a8eec
Bug: 64310452
Bug: 63831980
Test: robotests
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