diff options
author | Wojciech Staszkiewicz <staszkiewicz@google.com> | 2015-05-14 10:34:55 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-05-14 10:34:55 +0000 |
commit | e2ad30ef5168d55f7c1b4a2dc4fe699be1bf8a48 (patch) | |
tree | e80c8eb1f2a67192138dea8821b51d03ad6b42e7 /packages/PrintSpooler | |
parent | dee1479c90179b7307cb889a4a233ef8633fabe8 (diff) | |
parent | be752b1f28f1f3724b235e3f0a77b4c07c40e631 (diff) | |
download | frameworks_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/PrintSpooler')
-rw-r--r-- | packages/PrintSpooler/src/com/android/printspooler/model/PrintSpoolerService.java | 5 | ||||
-rw-r--r-- | packages/PrintSpooler/src/com/android/printspooler/ui/FusedPrintersProvider.java | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/packages/PrintSpooler/src/com/android/printspooler/model/PrintSpoolerService.java b/packages/PrintSpooler/src/com/android/printspooler/model/PrintSpoolerService.java index 377d2d5..49e6740 100644 --- a/packages/PrintSpooler/src/com/android/printspooler/model/PrintSpoolerService.java +++ b/packages/PrintSpooler/src/com/android/printspooler/model/PrintSpoolerService.java @@ -63,6 +63,7 @@ import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.PrintWriter; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.List; @@ -757,7 +758,7 @@ public final class PrintSpoolerService extends Service { out = mStatePersistFile.startWrite(); XmlSerializer serializer = new FastXmlSerializer(); - serializer.setOutput(out, "utf-8"); + serializer.setOutput(out, StandardCharsets.UTF_8.name()); serializer.startDocument(null, true); serializer.startTag(null, TAG_SPOOLER); @@ -952,7 +953,7 @@ public final class PrintSpoolerService extends Service { } try { XmlPullParser parser = Xml.newPullParser(); - parser.setInput(in, null); + parser.setInput(in, StandardCharsets.UTF_8.name()); parseState(parser); } catch (IllegalStateException ise) { Slog.w(LOG_TAG, "Failed parsing ", ise); diff --git a/packages/PrintSpooler/src/com/android/printspooler/ui/FusedPrintersProvider.java b/packages/PrintSpooler/src/com/android/printspooler/ui/FusedPrintersProvider.java index 22a7f86..80c28e0 100644 --- a/packages/PrintSpooler/src/com/android/printspooler/ui/FusedPrintersProvider.java +++ b/packages/PrintSpooler/src/com/android/printspooler/ui/FusedPrintersProvider.java @@ -46,6 +46,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.Collections; import java.util.LinkedHashMap; @@ -562,7 +563,7 @@ public final class FusedPrintersProvider extends Loader<List<PrinterInfo>> { try { List<PrinterInfo> printers = new ArrayList<>(); XmlPullParser parser = Xml.newPullParser(); - parser.setInput(in, null); + parser.setInput(in, StandardCharsets.UTF_8.name()); parseState(parser, printers); // Take a note which version of the history was read. mLastReadHistoryTimestamp = mStatePersistFile.getBaseFile().lastModified(); @@ -686,7 +687,7 @@ public final class FusedPrintersProvider extends Loader<List<PrinterInfo>> { out = mStatePersistFile.startWrite(); XmlSerializer serializer = new FastXmlSerializer(); - serializer.setOutput(out, "utf-8"); + serializer.setOutput(out, StandardCharsets.UTF_8.name()); serializer.startDocument(null, true); serializer.startTag(null, TAG_PRINTERS); |