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

Commit 6481dc59 authored by ztenghui's avatar ztenghui Committed by Android Git Automerger
Browse files

am 8373ce69: Fix the create() for the attrs position

* commit '8373ce698088c0788cc2994fe43e6dcb3ac6a118':
  Fix the create() for the attrs position
parents 97fb1dcc 874bcd82
Loading
Loading
Loading
Loading
+11 −5
Original line number Diff line number Diff line
@@ -364,13 +364,19 @@ public class VectorDrawable extends Drawable {
    /** @hide */
    public static VectorDrawable create(Resources resources, int rid) {
        try {
            final XmlPullParser xpp = resources.getXml(rid);
            final AttributeSet attrs = Xml.asAttributeSet(xpp);
            final XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
            factory.setNamespaceAware(true);
            final XmlPullParser parser = resources.getXml(rid);
            final AttributeSet attrs = Xml.asAttributeSet(parser);
            int type;
            while ((type=parser.next()) != XmlPullParser.START_TAG &&
                    type != XmlPullParser.END_DOCUMENT) {
                // Empty loop
            }
            if (type != XmlPullParser.START_TAG) {
                throw new XmlPullParserException("No start tag found");
            }

            final VectorDrawable drawable = new VectorDrawable();
            drawable.inflate(resources, xpp, attrs);
            drawable.inflate(resources, parser, attrs);

            return drawable;
        } catch (XmlPullParserException e) {