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

Commit 63ebf34d authored by Jerome Gaillard's avatar Jerome Gaillard Committed by android-build-merger
Browse files

Merge "Get color state list file content from PSI instead of disk" into mnc-ub-dev am: 171a2a93

am: 1bddf2b1

* commit '1bddf2b1':
  Get color state list file content from PSI instead of disk
parents f8642182 1bddf2b1
Loading
Loading
Loading
Loading
+23 −16
Original line number Diff line number Diff line
@@ -327,12 +327,19 @@ public final class BridgeTypedArray extends TypedArray {
            return null;
        }

        // let the framework inflate the ColorStateList from the XML file.

        try {
            // Get the state list file content from callback to parse PSI file
            XmlPullParser parser = mContext.getLayoutlibCallback().getXmlFileParser(value);
            if (parser == null) {
                // If used with a version of Android Studio that does not implement getXmlFileParser
                // fall back to reading the file from disk
                File f = new File(value);
                if (f.isFile()) {
            try {
                XmlPullParser parser = ParserFactory.create(f);

                    parser = ParserFactory.create(f);
                }
            }
            if (parser != null) {
                BridgeXmlBlockParser blockParser = new BridgeXmlBlockParser(
                        parser, mContext, resValue.isFramework());
                try {
@@ -341,6 +348,7 @@ public final class BridgeTypedArray extends TypedArray {
                } finally {
                    blockParser.ensurePopped();
                }
            }
        } catch (XmlPullParserException e) {
            Bridge.getLog().error(LayoutLog.TAG_BROKEN,
                    "Failed to configure parser for " + value, e, null);
@@ -353,7 +361,6 @@ public final class BridgeTypedArray extends TypedArray {

            return null;
        }
        }

        try {
            int color = ResourceHelper.getColor(value);