Commit Graph

13 Commits

Author SHA1 Message Date
Fan Zhang
fdfc88faef Don't hide summary text in RestrictedPreference.
Bug: 34974598
Test: RunSettingsLibRoboTests
Change-Id: I8ea74fb52c38430c120fd4158867a9184d8f16cf
2017-02-10 17:22:51 -08:00
Sudheer Shanka
2893302afc Call preference.setEnabled only after updating disabledByAdmin state.
We check the value of disabledByAdmin state in setEnabled, so update it
first before calling setEnabled.

Bug: 27642236
Change-Id: Ie6c805b85a3afb87ffdaad0b80dbadc172b62d49
2016-03-14 14:59:52 -07:00
Sudheer Shanka
8d774b752b Minor cleanup in RestrictedPreferenceHelper.setDisabledByAdmin.
Change-Id: I573ea3a0c4565c62d47c4458b7885a8cfbdf31cc
2016-03-09 14:48:19 -08:00
Sudheer Shanka
bc58e3faa1 Merge "Remove unused imports and variables." into nyc-dev 2016-03-09 17:03:33 +00:00
Sudheer Shanka
efbecddcb7 Remove unused imports and variables.
Bug: 27564074
Change-Id: I5eff9f673fe093a9068e94619cfe7eef10c0b4a9
2016-03-09 16:31:49 +00:00
Martijn Coenen
502bc4e7a3 Merge "SettingsLib: Always update preference state." into nyc-dev 2016-03-09 10:30:40 +00:00
Sudheer Shanka
40400a648f Update restricted icon.
Bug: 25603665
Bug: 27263775
Change-Id: Ib66866cf536f15130f936d03d9328ee5b0b508c7
2016-03-02 19:08:51 -08:00
Sudheer Shanka
923bc74c92 Part1: Show the restricted lock icon in place of the pref widget.
Add summary strings used for switch prefs if disabled by admin.

Bug: 25603665
Bug: 27263775
Change-Id: I88c2dd2e024f92da107bedc645641e285796d51f
2016-03-01 16:45:03 -08:00
Martijn Coenen
6f02f56f52 SettingsLib: Always update preference state.
In case a RestrictedPreference can also be disabled
for other reasons than device admin, the state
of RestrictedPreferenceHelper may not be up-to-date
with the actual preference state. For example, the
"Android Beam" checkbox can be disabled by device
policy, but it can also be disabled by Settings itself
because NFC was turned off by the user.

To fix that, always update the Preference state.

Bug: 26907006
Change-Id: I27cde70beb82721dd4d423943a9898e022df8862
2016-02-29 12:16:52 +01:00
Sudheer Shanka
a8fbbb30ea Part1 - Don't add padlock if the restriction is not set by admin.
Bug: 26687435
Change-Id: I2fd740b1fa0d76eceedc4dde73e41d779820bbcf
2016-02-19 19:21:57 +00:00
Sudheer Shanka
1450173034 Add support for adding preference summary when disabled by admin.
Change-Id: I455c3180266734fa4ba6b5bf7cb5fc2f34177759
2016-01-25 22:40:10 +00:00
Sudheer Shanka
ea088af5c1 Made changes to padlock support for preferences.
- Currently, if a preference is disabled by admin, we add a padlock and disable
the preference. And now if the preference is enabled in some other place, the
padlock is not removed. Updated RestrictedPreference to fix this
behavior.
- Made RestrictedPreferenceHelper and
RestrictedPreferenceHelper.onAttachedToHierarchy public so that preferences in
Settings can use these.
- Put a check for null to avoid NullPointerException.
- Removed a redundant statement.

Change-Id: Ie88a761dc38c58a680c62b3703d2081c67462079
2016-01-14 16:25:56 +00:00
Sudheer Shanka
7ff866d286 Move restricted padlock support to SettingsLib
Change-Id: Ib0b1c58d1f45e017b6b17ce0a55ca839b900cba4
2016-01-12 18:14:24 +00:00