@Test public void testParseDownloadableFont() throws IOException, XmlPullParserException { @SuppressLint("ResourceType") XmlResourceParser parser = mResources.getXml(R.font.samplexmldownloadedfont); FamilyResourceEntry result = FontResourcesParserCompat.parse(parser, mResources); assertNotNull(result); ProviderResourceEntry providerEntry = (ProviderResourceEntry) result; FontRequest request = providerEntry.getRequest(); assertEquals("androidx.core.provider.fonts.font", request.getProviderAuthority()); assertEquals("androidx.core.test", request.getProviderPackage()); assertEquals("singleFontFamily", request.getQuery()); }
public static @Nullable FamilyResourceEntry parse(XmlPullParser parser, Resources resources) throws XmlPullParserException, IOException { int type; while ((type = parser.next()) != XmlPullParser.START_TAG && type != XmlPullParser.END_DOCUMENT) { } if (type != XmlPullParser.START_TAG) { throw new XmlPullParserException("No start tag found"); } return readFamilies(parser, resources); }
FontResourcesParserCompat { public static @Nullable FamilyResourceEntry parse(XmlPullParser parser, Resources resources) throws XmlPullParserException, IOException { int type; while ((type = parser.next()) != XmlPullParser.START_TAG && type != XmlPullParser.END_DOCUMENT) { } if (type != XmlPullParser.START_TAG) { throw new XmlPullParserException("No start tag found"); } return readFamilies(parser, resources); } }
FontResourcesParserCompat { public static @Nullable FamilyResourceEntry parse(XmlPullParser parser, Resources resources) throws XmlPullParserException, IOException { int type; while ((type = parser.next()) != XmlPullParser.START_TAG && type != XmlPullParser.END_DOCUMENT) { } if (type != XmlPullParser.START_TAG) { throw new XmlPullParserException("No start tag found"); } return readFamilies(parser, resources); } private  FontResourcesParserCompat(); }
FontResourcesParserCompat { public static @Nullable FamilyResourceEntry parse(XmlPullParser parser, Resources resources) throws XmlPullParserException, IOException { int type; while ((type = parser.next()) != XmlPullParser.START_TAG && type != XmlPullParser.END_DOCUMENT) { } if (type != XmlPullParser.START_TAG) { throw new XmlPullParserException("No start tag found"); } return readFamilies(parser, resources); } private  FontResourcesParserCompat(); static @Nullable FamilyResourceEntry parse(XmlPullParser parser, Resources resources); static List<List<byte[]>> readCerts(Resources resources, @ArrayRes int certsId); }
FontResourcesParserCompat { public static @Nullable FamilyResourceEntry parse(XmlPullParser parser, Resources resources) throws XmlPullParserException, IOException { int type; while ((type = parser.next()) != XmlPullParser.START_TAG && type != XmlPullParser.END_DOCUMENT) { } if (type != XmlPullParser.START_TAG) { throw new XmlPullParserException("No start tag found"); } return readFamilies(parser, resources); } private  FontResourcesParserCompat(); static @Nullable FamilyResourceEntry parse(XmlPullParser parser, Resources resources); static List<List<byte[]>> readCerts(Resources resources, @ArrayRes int certsId); static final int FETCH_STRATEGY_BLOCKING; static final int FETCH_STRATEGY_ASYNC; static final int INFINITE_TIMEOUT_VALUE; }