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

Commit eac7d5a3 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Remove hidden API dependency of XmlUtils"

parents 35a7fe50 08407506
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -33,6 +33,9 @@ import android.os.UserHandle;
import android.os.UserManager;
import android.util.Log;

import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
@@ -529,4 +532,14 @@ public final class Utils {
        return DateTimeFormatter.ofPattern("MM-dd HH:mm:ss.SSS")
                .withZone(ZoneId.systemDefault()).format(Instant.now());
    }

    public static void skipCurrentTag(XmlPullParser parser)
            throws XmlPullParserException, IOException {
        int outerDepth = parser.getDepth();
        int type;
        while ((type = parser.next()) != XmlPullParser.END_DOCUMENT
                && (type != XmlPullParser.END_TAG
                || parser.getDepth() > outerDepth)) {
        }
    }
}
+3 −3
Original line number Diff line number Diff line
@@ -17,8 +17,8 @@ package com.android.bluetooth.map;
import android.util.Log;
import android.util.Xml;

import com.android.bluetooth.Utils;
import com.android.internal.util.FastXmlSerializer;
import com.android.internal.util.XmlUtils;

import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
@@ -156,7 +156,7 @@ public class BluetoothMapConvoListing {
                    if (D) {
                        Log.i(TAG, "Unknown XML tag: " + name);
                    }
                    XmlUtils.skipCurrentTag(parser);
                    Utils.skipCurrentTag(parser);
                }
                readConversations(parser);
            }
@@ -191,7 +191,7 @@ public class BluetoothMapConvoListing {
                if (D) {
                    Log.i(TAG, "Unknown XML tag: " + name);
                }
                XmlUtils.skipCurrentTag(parser);
                Utils.skipCurrentTag(parser);
                continue;
            }
            // Add a single conversation
+2 −2
Original line number Diff line number Diff line
@@ -17,8 +17,8 @@ package com.android.bluetooth.map;
import android.util.Log;

import com.android.bluetooth.SignedLongLong;
import com.android.bluetooth.Utils;
import com.android.bluetooth.map.BluetoothMapUtils.TYPE;
import com.android.internal.util.XmlUtils;

import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
@@ -341,7 +341,7 @@ public class BluetoothMapConvoListingElement
                if (D) {
                    Log.i(TAG, "Unknown XML tag: " + name);
                }
                XmlUtils.skipCurrentTag(parser);
                Utils.skipCurrentTag(parser);
                continue;
            }
        }
+3 −3
Original line number Diff line number Diff line
@@ -17,8 +17,8 @@ package com.android.bluetooth.map;
import android.util.Log;
import android.util.Xml;

import com.android.bluetooth.Utils;
import com.android.internal.util.FastXmlSerializer;
import com.android.internal.util.XmlUtils;

import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
@@ -346,7 +346,7 @@ public class BluetoothMapFolderElement implements Comparable<BluetoothMapFolderE
                    if (D) {
                        Log.i(TAG, "Unknown XML tag: " + name);
                    }
                    XmlUtils.skipCurrentTag(parser);
                    Utils.skipCurrentTag(parser);
                }
                readFolders(parser);
            }
@@ -378,7 +378,7 @@ public class BluetoothMapFolderElement implements Comparable<BluetoothMapFolderE
                if (D) {
                    Log.i(TAG, "Unknown XML tag: " + name);
                }
                XmlUtils.skipCurrentTag(parser);
                Utils.skipCurrentTag(parser);
                continue;
            }
            int count = parser.getAttributeCount();