summaryrefslogtreecommitdiffstats
path: root/packages/SettingsProvider
diff options
context:
space:
mode:
authorWojciech Staszkiewicz <staszkiewicz@google.com>2015-05-14 10:34:55 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-05-14 10:34:55 +0000
commite2ad30ef5168d55f7c1b4a2dc4fe699be1bf8a48 (patch)
treee80c8eb1f2a67192138dea8821b51d03ad6b42e7 /packages/SettingsProvider
parentdee1479c90179b7307cb889a4a233ef8633fabe8 (diff)
parentbe752b1f28f1f3724b235e3f0a77b4c07c40e631 (diff)
downloadframeworks_base-e2ad30ef5168d55f7c1b4a2dc4fe699be1bf8a48.zip
frameworks_base-e2ad30ef5168d55f7c1b4a2dc4fe699be1bf8a48.tar.gz
frameworks_base-e2ad30ef5168d55f7c1b4a2dc4fe699be1bf8a48.tar.bz2
am be752b1f: Merge "Pass charset to XmlPullParser.setInput instead of null" into mnc-dev
* commit 'be752b1f28f1f3724b235e3f0a77b4c07c40e631': Pass charset to XmlPullParser.setInput instead of null
Diffstat (limited to 'packages/SettingsProvider')
-rw-r--r--packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
index f853f3f..9209c26 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
@@ -38,6 +38,7 @@ import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
+import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
@@ -353,7 +354,7 @@ final class SettingsState {
out = destination.startWrite();
XmlSerializer serializer = Xml.newSerializer();
- serializer.setOutput(out, "utf-8");
+ serializer.setOutput(out, StandardCharsets.UTF_8.name());
serializer.setFeature("http://xmlpull.org/v1/doc/features.html#indent-output", true);
serializer.startDocument(null, true);
serializer.startTag(null, TAG_SETTINGS);
@@ -406,7 +407,7 @@ final class SettingsState {
}
try {
XmlPullParser parser = Xml.newPullParser();
- parser.setInput(in, null);
+ parser.setInput(in, StandardCharsets.UTF_8.name());
parseStateLocked(parser);
} catch (XmlPullParserException | IOException e) {