History log of /frameworks/base/core/java/android/provider/SettingsValidators.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
4451179411f4a84d2b64c5306371b186e510ad3c 17-May-2018 Annie Meng <anniemeng@google.com> Allow restore of settings with nullable components

Creates a new settings validator that allows for null components, which
have semantic meaning for certain settings (in this case, that no
service is selected).

Bug: 79925290
Test: 1) atest SettingsValidatorsTest
2) Manual:
- In Settings UI, select "None" for autofill service and accessibility
shortcut target
- "adb backup -keyvalue -f nullsettings.ab com.android.providers.settings"
- "adb restore nullsettings.ab"
- Verify no crashes and that autofill service and accessibility shortcut
target both have "None" in Settings UI

Change-Id: I159b3f4706c6b981a30437c31724b106eb4e3f2a
/frameworks/base/core/java/android/provider/SettingsValidators.java
eed1b812a4ad38c6815f3066e41a95d7f5358838 21-May-2018 Annie Meng <anniemeng@google.com> Check settings validators for NPE

From b/79910479, we need to have better checks on settings validators.

Catch NPE for various settings validators and add a @Nullable annotation
to try to prevent NPEs in new validators.

Bug: 80067772
Test: atest SettingsValidatorsTest
Change-Id: I9a5058e1bae1ba0dea084c0589aa3e4ef3a51836
/frameworks/base/core/java/android/provider/SettingsValidators.java
5d26b8c03a1e11076e41699fd54259ef5ff4a1e0 17-May-2018 Annie Meng <anniemeng@google.com> Fix NPE in ComponentNameValidator

In general, we should consider null component names as invalid settings,
meaning that we don't restore.

b/79925290 to allow restoring null component names for specific
settings where null has semantic meaning.

Bug: 79910479
Test: 1) atest SettingsValidatorsTest
2) Manual:
- In Settings UI, select "None" for autofill service and accessibility
shortcut target
- "adb backup -keyvalue -f nullsettings.ab com.android.providers.settings"
- "adb restore nullsettings.ab" and verify no crashes
Change-Id: Iffecbe7d26a93a816e7be42f564ba471f9681876
/frameworks/base/core/java/android/provider/SettingsValidators.java
6fe6c8ef02df1c394cab1316248e1ffb88c598a1 24-Jan-2018 Michal Karpinski <mkarpinski@google.com> Use proper logic operators in package name validation

And add unit tests for common validators as atonement...

Test: atest frameworks/base/core/tests/coretests/src/android/provider/SettingsValidatorsTest.java
Bug: 64988620
Change-Id: I561319356cbca70da326586c2a762293c4ade9ed
/frameworks/base/core/java/android/provider/SettingsValidators.java
29a7472974d4c90c1668eb24db83f27ca17012cd 20-Jan-2018 Michal Karpinski <mkarpinski@google.com> Split string properly in package name validator

Test: atest frameworks/base/core/tests/coretests/src/android/provider/SettingsValidatorsTest.java
Bug: 64988620
Change-Id: I35b93a9ba317dc31494bffb7ad3576ad7290220f
/frameworks/base/core/java/android/provider/SettingsValidators.java
964943ab98874a91be04f9ea2137861c93f6ffd3 19-Jan-2018 Michal Karpinski <mkarpinski@google.com> Add validators for all Settings.Secure settings that are backed up

A few no longer used settings were removed from SETTINGS_TO_BACKUP.

And extend the unit test to fail if new ones are added without
a validator. Also fail to boot in that case.

Ref: go/android-p-backed-up-settings
Test: atest frameworks/base/core/tests/coretests/src/android/provider/SettingsValidatorsTest.java
Bug: 64988620
Change-Id: I94b4039c9f54c341aec72b62579be3dd8bd84dbb
/frameworks/base/core/java/android/provider/SettingsValidators.java
5db1e430f9d774a5b203eda5ec53f065bb1ec5b3 18-Jan-2018 Michal Karpinski <mkarpinski@google.com> Add validators for all Settings.Global settings that are backed up

And extend the unit test to fail if new ones are added without
a validator. Also fail to boot in that case.

Ref: go/android-p-backed-up-settings
Test: atest frameworks/base/core/tests/coretests/src/android/provider/SettingsValidatorsTest.java
Bug: 64988620
Change-Id: Ibd4a2bad0c6a1f2a9e1beec1a4ec8e6972fd86a4
/frameworks/base/core/java/android/provider/SettingsValidators.java
2c37b08510877af06542ad21eb5b63c8f9824584 18-Jan-2018 Michal Karpinski <mkarpinski@google.com> Add SettingsValidators class and a test for validators enforcement

Common validators have been moved out to SettingsValidators class,
as they'll be now shared between Settings.System, Settings.Secure
and Settings.Global.

All validators of Settings.System settings have been verified to be
correct and the missing ones were added.

A unit test that verifies that all settings on SETTINGS_TO_BACKUP
list in Settings.System have validators on VALIDATORS list has been
added. This test will also cover Settings.Secure and Settings.Global
once validators are added for those settings. Also, fail to boot
in that case.

Ref: go/android-p-backed-up-settings
Test: atest frameworks/base/core/tests/coretests/src/android/provider/SettingsValidatorsTest.java
Bug: 64988620
Change-Id: I1fe951604010ab0c3f68a66296885a9766690d69
/frameworks/base/core/java/android/provider/SettingsValidators.java