SwitchPreference and SwitchPreferenceCompat are both TwoStatePreference.
Using TwoStatePreference in Java will helps migration in the future.
Bug: 306771414
Test: manual - check Settings pages
Change-Id: I84e1d7b09451106797c2b23d127855c6976678ca
1. Use onSaveInstanceState to store the data.
2. Do not repeat to automatically select the keyboard layout.
Bug: 281481973
Bug: 281461013
Test: manual
Change-Id: Ieaa8fa3d2e6c22c39b34313d255e4f7869777a8b
1. Check open from a notification
2. Check open from Bluetooth entry
3. If the inputDeviceIdentifier is not null, open the next page
directly.
4. Add extra to record the class of sender for the future metrics.
Demo: http://screencast/cast/NDU4MTYxOTIzMTg4MzI2NHxiYTQ0ODE5Ny02YQ
Bug: 269212353
Test: manual, atest
[Pass] atest KeyboardSettingsPreferenceControllerTest
[Pass] atest PhysicalKeyboardPreferenceControllerTest
Change-Id: Ie874003260896bbb949806623913e70486e4731d
1. Physical keyboard settings should only show up if at least one PK is connected.
2. Update tests.
3. Fix NullPointerException.
Bug: 269983475
Bug: 270109384
Bug: 271357910
Test: atest and manual
Change-Id: If7798587fb386dbf669fc249cab304d91a26879b
Integrate UI with these APIs.
1. getKeyboardLayoutListForInputDevice
2. getKeyboardLayoutForInputDevice
3. setKeyboardLayoutForInputDevice
Demo: go/pk_with_final_api_demo
Bug: 247079681
Test: local test
Change-Id: I5478e2c344a47e692e7c524f8c1e96d9dda52796
The default observer delay is 10s for background
service. When a device connected to a hardware
keyboard, the delay makes soft keyboard visibility
is unsync after user switch the configuration.
Notify the SHOW_IME_WITH_HARD_KEYBOARD change
without delay.
Bug: 240210005
Test: Manual with bug steps
Change-Id: I7f8cb0df514fdea4ed0e092cd4466931ec200969
- Use SettingsLib Indexable
- Directly use resource id in getPreferenceScreenResId
Bug: 135053028
Test: roboletric
Change-Id: I05f493b55e8b6e2091301e9231ba5615215618e6
- Add function getXmlResourceId, Fragments don't need to write
xml resource id twice.
- Remove getPreferenceControllers from Indexable.java. Because it will
move to SettingsLib later for other apps which don't need this function
Bug: 135053028
Test: robolectric
Change-Id: I1e74519aecdea3dde64a5aea79f08d766dbc0003
Having consistent import order will reduce chance of merge
conflict between internal and external master
Test: rebuild
Change-Id: I0b1a170967ddcce7f388603fd521f6ed1eeba30b
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
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
Convert input device search into a search query loader
And remove old logic from DynamicIndexableContentMonitor
Change-Id: If652b1ea7c8add9185bbd025055e14925d3a8eec
Bug: 64310452
Bug: 63831980
Test: robotests
- 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
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
Bug: 30681771
Test: SettingsUnitTests
Refactor visibility logging from InstrumentedFragment into a mixin. And
apply mixin in remaining fragments.
Change-Id: Ibbb59904336254a3e4bb9e8c7d0b36e5a6bc2622
The OnPreferenceChangeListener for the preference to show
the virtual keyboard was returning false, indicating that the
new preference was not to be persisted, even though it was
persisting the setting. That caused the accessibility
framework not to be informed of the new value, which led
TalkBack to speak the old value rather than the new one.
Bug: 30140972
Change-Id: I02b7dc1db52cb7646650e6f2e49a1e15c2233897
Settings.Secure.SHOW_IME_WITH_HARD_KEYBOARD is a per-user settings.
PhysicalKeyboardFragment needs to use the current user's ID rather than
hard-coded user ID 0.
Bug: 29406181
Change-Id: Ie40f729f3c85e9ce9ad8f957caba338786b119d9
It turns out that out previous CL [1] is not sufficient to address all
the requests regarding capitalization.
With [1], now InputMethodSubtype#getLocaleDisplayName() returns a locale
name whose capitalization is basically optimized to be used as a list
item. It works well for list UI, but on a UI element that looks like a
sentence text, we still need to capitalize the first character.
This CL takes care of those UI elements in the Settings app. This CL
also addresses a remaining TODO about locale-unaware text formatting by
using about android.icu.text.ListFormatter.
[1]: If105082ce703db7a86738455db7e9fb37f3c6fe8
e489baf96df2837a3a63b626d9023a4a8b322c28
Bug: 29035638
Change-Id: I59f93f0bc067cdd87c6065c972a7da3cde1128f9
With a Framework-side change [1],
InputManager#{get, set}KeyboardLayoutForInputDevice() are now able to
deal with null InputMethodSubtype as a valid input. With this CL, we no
longer filter out IMEs that do not support subtypes in
PhysicalKeyboardFragment.
[1]: Ia013784a594ad3beaf30976d047f5ac0fa8185be
Bug: 28182650
Change-Id: I46b9c5b018f08e3eaa4614a0893db0be91652f3c
This patch loads all physical keyboards at once and only updates the
screen after that returns. Previously, each keyboard's data was
loaded individually and the screen was updated for each keyboard
when the data was received.
Bug: 27549590
Change-Id: I05d80d74df14fb7bfaa0ce76a1f8919889865108
The root cause of crash bug #27749932 is that the state mismatch between
when a Loader is created and when the Loader object finishes background
task. We can easily reproduce this crash by:
1. Pair two hardware keyboard A and B.
2. Open Physical Keyboard settings.
3. Press the power button to turn off the display.
4. Move keyboard A far away so that it is unpaired.
5. Press the power button to turn on the display.
6. Unlock the device.
One of the reasons PhysicalKeyboardFragment was unstable is that loader
ID reuse. PhysicalKeyboardFragment starts background data loading
because of many events such as #onResume() and #onInputDeviceAdded() but
there are chances that loader ID was reused because we specified
hardware keyboard device index as the loader ID. This was dangerous
also because device index can change when a device is added and removed.
With his CL each loader object has an unique ID and
PhysicalKeyboardFragment keeps tracking the list of active Loader IDs
only from which PhysicalKeyboardFragment should accept data.
Also, this CL removes dependencies on PhysicalKeyboardFragment from each
loader object so that we can have a clear boundary of responsibility
between data loader and data consumer.
Bug: 27749932
Change-Id: I53fcb2426d028a492c775bb2b4ec6a5419e33bb4
This is a follow up CL to my previous CL [1], which added a new
constructor to InputMethodSettings to support File-Based
Encryption (FBE).
Settings app is the only remaining package that depends on the previous
constructor. To completely deprecate the previous one, this CL lets the
caller switch to the new constructor.
Note that this CL does not change the initial parameters of
InputMethodSettings. In other words this is a mechanical code
clean-up.
[1] I9c6f9bb3d51174198e5f73588637f87ea0d90e11
5db2f16f15549c490c9541602a96f42bef984acb
Bug: 26279466
Change-Id: I09cba4066b95c4a9e89a3e4f83d75b97882502dc