diff options
author | Svet Ganov <svetoslavganov@google.com> | 2015-03-28 13:21:22 -0700 |
---|---|---|
committer | Svet Ganov <svetoslavganov@google.com> | 2015-03-28 13:21:22 -0700 |
commit | c9755bc4f2183d6d8e035e6a448b2c948dcd3a01 (patch) | |
tree | e5ea1d8fb33f889f07ceae2d5b800ff29debcf95 /packages/SettingsProvider | |
parent | 8440ca3934dbb65743b357006e4a019e4351d479 (diff) | |
download | frameworks_base-c9755bc4f2183d6d8e035e6a448b2c948dcd3a01.zip frameworks_base-c9755bc4f2183d6d8e035e6a448b2c948dcd3a01.tar.gz frameworks_base-c9755bc4f2183d6d8e035e6a448b2c948dcd3a01.tar.bz2 |
Fix a regression in settings parsing
Change-Id: I222bac482a843112ae031b00c83e3765ea6b456c
Diffstat (limited to 'packages/SettingsProvider')
-rw-r--r-- | packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java | 2 | ||||
-rw-r--r-- | packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java | 22 |
2 files changed, 15 insertions, 9 deletions
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java index 2c63647..8328d11 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java @@ -1806,7 +1806,7 @@ public class SettingsProvider extends ContentProvider { final int oldVersion = secureSettings.getVersionLocked(); final int newVersion = SETTINGS_VERSION; - // If up do data - done. + // If up do date - done. if (oldVersion == newVersion) { return; } diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java index d0f4e7d..c7092b3 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java @@ -433,6 +433,9 @@ final class SettingsState { private void parseSettingsLocked(XmlPullParser parser) throws IOException, XmlPullParserException { + + mVersion = Integer.parseInt(parser.getAttributeValue(null, ATTR_VERSION)); + final int outerDepth = parser.getDepth(); int type; while ((type = parser.next()) != XmlPullParser.END_DOCUMENT @@ -441,15 +444,18 @@ final class SettingsState { continue; } - String id = parser.getAttributeValue(null, ATTR_ID); - String name = parser.getAttributeValue(null, ATTR_NAME); - String value = parser.getAttributeValue(null, ATTR_VALUE); - String packageName = parser.getAttributeValue(null, ATTR_PACKAGE); - mSettings.put(name, new Setting(name, unpackValue(value), - unpackValue(packageName), id)); + String tagName = parser.getName(); + if (tagName.equals(TAG_SETTING)) { + String id = parser.getAttributeValue(null, ATTR_ID); + String name = parser.getAttributeValue(null, ATTR_NAME); + String value = parser.getAttributeValue(null, ATTR_VALUE); + String packageName = parser.getAttributeValue(null, ATTR_PACKAGE); + mSettings.put(name, new Setting(name, unpackValue(value), + unpackValue(packageName), id)); - if (DEBUG_PERSISTENCE) { - Slog.i(LOG_TAG, "[RESTORED] " + name + "=" + value); + if (DEBUG_PERSISTENCE) { + Slog.i(LOG_TAG, "[RESTORED] " + name + "=" + value); + } } } } |