Commit Graph

286 Commits

Author SHA1 Message Date
Roozbeh Pournader
217b1d1581 Show only up to two locales in Settings
The list could otherwise grow very long, spamming the screen.

Bug: 28872122
Change-Id: I8c4dbe659e1c088eba8b5ba1b2905b5eb8bc0229
2016-05-26 19:01:06 -07:00
Yohei Yukawa
1ef9c4afd5 Follow class package change: LocaleList
In order to avoid layering violation, LocaleList needs to be moved from
android.util package to android.os package [1].  This CL follows up that
package change.

No behavior change is intended.

 [1]: Ia8de2ee9df3dd0a42b1fe84574439519b680fe18

Bug: 28819696
Change-Id: Ibd7934b30062046830d63f33d1c6febef32da976
2016-05-17 16:25:39 -07:00
Julia Reynolds
075690875b Merge "Fix crash on rotation." into nyc-dev 2016-05-16 20:12:06 +00:00
Julia Reynolds
176b28663b Fix crash on rotation.
Change-Id: Ife0a040bfc1a6ecc579d544f78cc45e37f5bca3c
Fixes: 28767083
2016-05-16 15:56:15 -04:00
Clara Bayarri
fcc411c807 Rename requestKeyboardShortcutsHelper
Per API Council feedback

Bug: 28775576
Change-Id: Ia19668dceb7da2222e9716fcb1caff8d0ee86c41
2016-05-16 14:16:46 +01:00
Fan Zhang
016f875ae7 Fix crash when rotating screen in a few screens.
Bug: 26946312

Fixed in the following screens:
Apps > Gear > Special Access > Modify system settings
Apps > Gear > Special Access > Draw over other apps
Apps > Gear > Special Access > Apps with usage access
Language & input > Personal dictionary
Wireless & networks (More) > Android Beam

Change-Id: I0b9bd6c19f710302625dd87989e9d4ce3c96a9a2
2016-05-09 17:56:06 +00:00
Abodunrinwa Toki
226e452c15 InputSettings: Define order of items in Physical keyboards screen.
Bug: 28158120
Change-Id: Ia7cec64edb9da53a2048865e317b2b9d4b2059b0
2016-05-05 13:52:03 +01:00
Michael Wright
276cc4d8ed Add subtext for default keyboard layout.
Bug: 27742933
Change-Id: I51bec339c0cbcfb114f85758b6a227deb57a69e2
2016-05-03 18:27:16 +00:00
Yohei Yukawa
b156761ae8 Merge "Support IMEs that have no subtype in PhysicalKeyboardFragment." into nyc-dev 2016-04-21 17:11:53 +00:00
Keisuke Kuroyanagi
bf0e1338ec Merge "Fix: Spell checker cannot be re-enabled." into nyc-dev 2016-04-21 13:38:15 +00:00
Abodunrinwa Toki
93c8c0a09a InputSettings: Fix incorrect keyboard list on rotation.
In this situation onLoadFinished callback is triggered before the
loader ids list is updated. Updated the loader ids list before
triggering the loader.

Bug: 28182232
Change-Id: I1e4035f4dcff33e6b9a42d448303e962bd87c14b
2016-04-21 14:37:51 +01:00
Yohei Yukawa
696bf679dd Support IMEs that have no subtype in PhysicalKeyboardFragment.
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
2016-04-20 17:20:26 -07:00
Abodunrinwa Toki
8aa7cf1631 Merge "Input Settings: Change the 'add' icon." into nyc-dev 2016-04-19 10:56:35 +00:00
Keisuke Kuroyanagi
23f7dab2b6 Merge "Fix: SpellChecker subtype label cannot be updated." into nyc-dev 2016-04-19 04:17:02 +00:00
Yohei Yukawa
bd068163e3 Merge "Use IME service logo or icon if exists." into nyc-dev 2016-04-18 19:01:28 +00:00
Keisuke Kuroyanagi
c7fc075e12 Fix: Spell checker cannot be re-enabled.
Without this CL, preference for enabling spell checking is disabled
when spell checking is disabled.
This issue makes it impossible to re-enable spell checking from the
settings UI.
This was introduced in I0ed71bbb580e3547d97e321799ac2b77b1f284a3
that fixes Bug: 26685795.

Bug: 28157871
Change-Id: I386baf2dd79347c1202f885a3f749aea3fb6a58d
2016-04-17 18:09:28 +09:00
Yohei Yukawa
2cae5b8952 Use IME service logo or icon if exists.
With this CL, AvailableVirtualKeyboardFragment searches icon resource in
the following order, which makes it easier to find a certain IME when
one APK contains multiple IMEs.
 1. Service Logo
 2. Service Icon
 3. Application Logo
 4. Application Icon

Bug: 28204635
Change-Id: I406ccc0d53e6ec69793c2fc8be8c6c1c90b34811
2016-04-16 15:52:06 +00:00
Keisuke Kuroyanagi
de251d9713 Fix: SpellChecker subtype label cannot be updated.
"Use system languages" is always displayed independent from the
selected value.
This happens due to inverted if-condition that has been introduced in
I0ed71bbb580e3547d97e321799ac2b77b1f284a3

Bug: 28204608
Change-Id: I9f0390242cb5ed4960c06eb3d0a4ade7a66143a5
2016-04-16 09:16:24 +09:00
Abodunrinwa Toki
a1bda3aa9f Input Settings: Change the 'add' icon.
Bug: 28205583
Change-Id: I9aa1143027f0528de8834c20607c2a44bf0dbd44
2016-04-15 12:49:07 +01:00
Abodunrinwa Toki
bbf5df73f9 Merge "Show Physical keyboards only after everything has been loaded" into nyc-dev 2016-04-14 10:04:17 +00:00
Abodunrinwa Toki
6118469cae Show Physical keyboards only after everything has been loaded
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
2016-04-11 11:38:48 +01:00
Clara Bayarri
6599660196 Merge "Add Keyboard Shortcuts Helper entry in Settings" into nyc-dev 2016-04-11 09:44:20 +00:00
Abodunrinwa Toki
f6053d1536 Input settings: Show keyboard layout collection.
E.g. Android keyboard or Nexus Compat keyboard.

Bug: 27250977
Change-Id: Icd256a760b157418f52046f10ca272561b692838
2016-04-08 14:08:56 +01:00
Clara Bayarri
ea8772a9c3 Add Keyboard Shortcuts Helper entry in Settings
Bug: 27811273
Change-Id: Ic4a97c869d6476bf427e41023dc595b39589e6ce
2016-04-06 14:55:49 +01:00
Yohei Yukawa
19998fef79 Merge "Fix PhysicalKeyboardFragment crash bug." into nyc-dev 2016-04-04 17:28:23 +00:00
Yohei Yukawa
1dff385c16 Fix PhysicalKeyboardFragment crash bug.
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
2016-04-01 11:38:25 +00:00
Yohei Yukawa
6452b84763 Fix jank when dismissing InputMethodAndSubtypeEnabler.
InputMethodAndSubtypeUtil#saveInputMethodSubtypeList() has a bug that
it saves implicitly enabled subtypes when "Use system languages" is
checked.  Implicitly enabled subtypes are transient data and the system
should have only a null data (0) in the persistent strage.  The root
cause of this bug is that the method in question has not checked whether
the preference item is in enabled (not grayed-out).   If it is
grayed-out, its checked state does not mean that the user manually
checked that subtype but it is just an indicator for the user.

The strange UI jank when dismissing InputMethodAndSubtypeEnabler is one
of the victim of the above bug because we have worked around it by
actually changing checked state before calling the method in question.

With this CL we no longer need to update preference items in
InputMethodAndSubtypeEnabler#onPause().

Bug: 27867966
Change-Id: Ifc291d77ea41a988438765b9ba16bc5d18a15e1b
2016-03-31 22:58:33 -07:00
Yohei Yukawa
a9341c38e3 Remove gear icon from InputMethodPreference.
Per comment from UX, we do not show gear icons on InputMethodPreference
because there is no difference between tapping the item itself and
tapping the gear icon.

Bug: 27543291
Change-Id: Ieea9a13a4b7af9c90c3a2a8f365bd318663998b1
2016-03-30 11:45:00 -07:00
Yohei Yukawa
143a686947 Stop using a deprecated constructor of InputMethodSettings.
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
2016-03-16 20:50:28 -07:00
Sudheer Shanka
b3dc3f2983 Don't set useAdminDisabledSummary when there is already a summary.
Bug: 27155568
Change-Id: If2a7bf127307731b2e2258dc6389caed13950f79
2016-03-16 11:42:58 -07:00
Jason Monk
3e19fc5600 Move temporary metrics constants to proto
Change-Id: I8fb3ac22df7bdc52039dd640f7696ebd32281f0b
2016-03-08 14:18:30 -05:00
Yohei Yukawa
1ea368b5d5 Handle the case where no spell checker is selected.
This follows up to a previous CL [1] that fixed Bug 26685795 that the
Settings app crashes when no spell checker is selected, but introduced
another Bug 26686710 that the user cannot re-select the spell checker
once the device has fallen into that state because the button to select
new spell checker is disabled.

This CL tries to deal with such a case more carefully and gracefully, by
adding more null checking and by showing a meaningful text
("Not selected" for English) to users when no spell checker is currently
selected.

  [1]: I65e6d269572e064aa6897807b6611ef947d90211
       093a646772

Bug: 26108333
Bug: 26685795
Bug: 26686710
Change-Id: I0ed71bbb580e3547d97e321799ac2b77b1f284a3
2016-02-26 18:12:43 +00:00
Jason Monk
42123f70c5 Spell checker settings updates
Bug: 26108333
Change-Id: I41e5da4a41978262283bc494a76c887e281266a8
2016-02-24 09:52:34 -05:00
Sudheer Shanka
f755baf1c3 Use the correct userId when checking if disabled by admin.
And when adding accounts if only one account type is possible and
it is disabled by admin, show the admin support dialog.

Bug: 26897250
Bug: 26767564
Change-Id: I5cca64491a100efc34307c45aa35c14412f043cd
2016-02-02 20:31:48 +00:00
Mihai Nita
0c7bce8222 Sentence-case the locale list.
Bug: 26730313
Change-Id: I015c50cb0e82cf3f5ad88a57d43d39e7202cf62d
2016-01-28 09:36:09 -08:00
Chris Wren
9d1bfd1e8d port settings over to new metrics enum
Change-Id: I0b3efd2f4db773ccbc52bfe59ee8eb0dab9584fb
2016-01-27 10:58:58 -05:00
Abodunrinwa Toki
e55afb181b Merge "Settings app: Remove "Toggle keyboard shortcuts helper" button" 2016-01-27 15:12:02 +00:00
Abodunrinwa Toki
7adce5463a Fix comment.
Change-Id: Ie4a535d2bf46a1ac3380ca8dbcf0b6665760ecb2
2016-01-27 11:51:27 +00:00
Abodunrinwa Toki
c8da2e13a5 Settings app: Remove "Toggle keyboard shortcuts helper" button
Change-Id: I93bd51a05a8922e02e4e09add94d247442f67334
2016-01-26 21:10:15 +00:00
Abodunrinwa Toki
bfae9dd7f2 Merge "Input settings: Associate keyboard layouts with device/IME subtype." 2016-01-26 21:00:46 +00:00
Abodunrinwa Toki
c043de9fbf Merge "Settings app: Include package icons in list of virtual keyboards" 2016-01-26 20:59:15 +00:00
Abodunrinwa Toki
5f0b59babf Input settings: Associate keyboard layouts with device/IME subtype.
Implements selection of keyboard layouts using the new InputManager
methods that associate keyboard layouts to
device/InputMethodInfo/InputMethodSubtype
See: Ie88ce1ab77dbfe03ab51d89c1dc9e0a7ddbb3216

Bug: 25752812
Change-Id: Ib76880d66391ca37978054de80f4b3b5147cecc3
2016-01-26 20:57:06 +00:00
Sudheer Shanka
ba1a68b8ab Add preference summary when disabled by admin.
Change-Id: Iaa84e66b0abe0fccde50f116cbf6e68c6abbabc0
2016-01-25 22:39:34 +00:00
Abodunrinwa Toki
567ebd68e1 Settings app: Include package icons in list of virtual keyboards
Bug: 25752812
Change-Id: I2070de953c92cce90dbf178c9ffdbe300d4c2646
2016-01-25 22:19:23 +00:00
Abodunrinwa Toki
976bb3f459 Change Input Settings UI flow.
1. Introduces new UI components as per the new flow
2. Temporarily disables components in the old flow that are to be
   replaced by the new flow. This is done so we can neatly revert
   to the old flow if there are issues with the new flow
3. AvailableVirtualKeyboardActivity now responds to
   android.settings.INPUT_METHOD_SETTINGS intents instead of
   InputMethodAndLanguageSettingsActivity

Bug: 25752812
Change-Id: I728d7ee185827ed328c16cb7abce244557a26518
2016-01-22 18:24:44 +00:00
Mihai Nita
d7d48fda53 Implement multiple locales and sublocales in Settings
Does drag-and-drop reordering, supports adding / removing locales,
suggestions, search, removes locales already selected in the
user preferences.

Bug: 25800339
Change-Id: Iffe7b9810c77ec93a84d848ab20b2ba405249676
2016-01-20 12:31:11 -08:00
Sudheer Shanka
9c32468cd5 Add padlocks to more preferences that can be disabled by policy.
Change-Id: I7cc999dd1d46c20c888e0ba67053564e4d50946b
2016-01-19 16:56:58 +00:00
Michael Wright
17b6319884 Directly show the layout selection screen.
When a user clicks on the physical keyboard in order to select a
layout, rather than showing them a dialog with an empty list of
layouts, send them straight to the screen where they can pick which
layouts to enable.

Also, only request keyboard layouts that are appropriate for the
input device we're in the process of configuring.

Bug: 25062009
Change-Id: I4483dfc89afc8d148b2cfa7c6a5f66d2a02f712a
2016-01-05 16:44:42 -05:00
Jason Monk
9d80eeabe7 Add some more summaries for Settings Home
Change-Id: Iaca8db6bdce87e667832b5b670e4eb027580b668
2015-11-30 10:57:33 -05:00
Jason Monk
c03a45fa9c am 6d85d168: am d2975f9d: am d9774c9f: am cdcba9ce: Merge "Fix crashes in Settings" into mnc-dr-dev
* commit '6d85d1686e6a333fe990d9e3ae5b978e8a8ce8c2':
  Fix crashes in Settings
2015-10-16 16:56:40 +00:00