Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e72d3dec authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Resolve XML parser used to parse system data.

We recently pivoted the default XML parser to write a new binary
XML schema, which requires all users to "resolve" to determine the
correct parser.

Bug: 157843394
Test: atest WallpaperBackupAgentTests
Change-Id: I84cc9f4e5b4abaedc014af54017096a1014d1e3a
parent 18b99c52
Loading
Loading
Loading
Loading
+2 −5
Original line number Original line Diff line number Diff line
@@ -51,7 +51,6 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.IOException;
import java.nio.charset.StandardCharsets;


public class WallpaperBackupAgent extends BackupAgent {
public class WallpaperBackupAgent extends BackupAgent {
    private static final String TAG = "WallpaperBackup";
    private static final String TAG = "WallpaperBackup";
@@ -323,8 +322,7 @@ public class WallpaperBackupAgent extends BackupAgent {
    private Rect parseCropHint(File wallpaperInfo, String sectionTag) {
    private Rect parseCropHint(File wallpaperInfo, String sectionTag) {
        Rect cropHint = new Rect();
        Rect cropHint = new Rect();
        try (FileInputStream stream = new FileInputStream(wallpaperInfo)) {
        try (FileInputStream stream = new FileInputStream(wallpaperInfo)) {
            XmlPullParser parser = Xml.newPullParser();
            XmlPullParser parser = Xml.resolvePullParser(stream);
            parser.setInput(stream, StandardCharsets.UTF_8.name());


            int type;
            int type;
            do {
            do {
@@ -351,8 +349,7 @@ public class WallpaperBackupAgent extends BackupAgent {
    private ComponentName parseWallpaperComponent(File wallpaperInfo, String sectionTag) {
    private ComponentName parseWallpaperComponent(File wallpaperInfo, String sectionTag) {
        ComponentName name = null;
        ComponentName name = null;
        try (FileInputStream stream = new FileInputStream(wallpaperInfo)) {
        try (FileInputStream stream = new FileInputStream(wallpaperInfo)) {
            final XmlPullParser parser = Xml.newPullParser();
            final XmlPullParser parser = Xml.resolvePullParser(stream);
            parser.setInput(stream, StandardCharsets.UTF_8.name());


            int type;
            int type;
            do {
            do {