OSDN Git Service

Fix NPE in ComponentNameValidator
authorAnnie Meng <anniemeng@google.com>
Thu, 17 May 2018 15:00:16 +0000 (16:00 +0100)
committerAnnie Meng <anniemeng@google.com>
Thu, 17 May 2018 17:56:58 +0000 (17:56 +0000)
commit5d26b8c03a1e11076e41699fd54259ef5ff4a1e0
tree3a8fd48bc590a950805afc3b735a26ccace0643e
parentbc7a12b01a0779a22d49c738404949eda3f863c7
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
core/java/android/provider/SettingsValidators.java
core/tests/coretests/src/android/provider/SettingsValidatorsTest.java