Home
last modified time | relevance | path

Searched refs:parser (Results 1 – 25 of 289) sorted by relevance

12345678910>>...12

/frameworks/base/samples/training/network-usage/src/com/example/android/networkusage/
DStackOverflowXmlParser.java39 XmlPullParser parser = Xml.newPullParser(); in parse() local
40 parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, false); in parse()
41 parser.setInput(in, null); in parse()
42 parser.nextTag(); in parse()
43 return readFeed(parser); in parse()
49 private List<Entry> readFeed(XmlPullParser parser) throws XmlPullParserException, IOException { in readFeed() argument
52 parser.require(XmlPullParser.START_TAG, ns, "feed"); in readFeed()
53 while (parser.next() != XmlPullParser.END_TAG) { in readFeed()
54 if (parser.getEventType() != XmlPullParser.START_TAG) { in readFeed()
57 String name = parser.getName(); in readFeed()
[all …]
/frameworks/base/tools/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/impl/
DLayoutParserWrapperTest.java38 LayoutParserWrapper parser = getParserFromString(sDataBindingLayout); in testDataBindingLayout() local
39 parser.peekTillLayoutStart(); in testDataBindingLayout()
40 assertEquals("Expected START_TAG", START_TAG, parser.next()); in testDataBindingLayout()
41 assertEquals("RelativeLayout", parser.getName()); in testDataBindingLayout()
42 for (int next = parser.next(); next != START_TAG && next != END_DOCUMENT; in testDataBindingLayout()
43 next = parser.next()); in testDataBindingLayout()
44 assertEquals("Expected START_TAG", START_TAG, parser.getEventType()); in testDataBindingLayout()
45 assertEquals("TextView", parser.getName()); in testDataBindingLayout()
47 parser.getAttributeValue(NS_RESOURCES, "layout_width")); in testDataBindingLayout()
50 parser.getAttributeValue(NS_RESOURCES, "text")); in testDataBindingLayout()
[all …]
/frameworks/base/core/java/android/security/net/config/
DXmlConfigSource.java92 try (XmlResourceParser parser = mContext.getResources().getXml(mResourceId)) { in ensureInitialized() argument
93 parseNetworkSecurityConfig(parser); in ensureInitialized()
104 private Pin parsePin(XmlResourceParser parser) in parsePin() argument
106 String digestAlgorithm = parser.getAttributeValue(null, "digest"); in parsePin()
108 throw new ParserException(parser, "Unsupported pin digest algorithm: " in parsePin()
111 if (parser.next() != XmlPullParser.TEXT) { in parsePin()
112 throw new ParserException(parser, "Missing pin digest"); in parsePin()
114 String digest = parser.getText().trim(); in parsePin()
119 throw new ParserException(parser, "Invalid pin digest", e); in parsePin()
123 throw new ParserException(parser, "digest length " + decodedDigest.length in parsePin()
[all …]
/frameworks/base/core/java/com/android/internal/util/
DXmlUtils.java51 public static void skipCurrentTag(XmlPullParser parser) in skipCurrentTag() argument
53 int outerDepth = parser.getDepth(); in skipCurrentTag()
55 while ((type=parser.next()) != XmlPullParser.END_DOCUMENT in skipCurrentTag()
57 || parser.getDepth() > outerDepth)) { in skipCurrentTag()
738 XmlPullParser parser = Xml.newPullParser(); in readMapXml() local
739 parser.setInput(in, StandardCharsets.UTF_8.name()); in readMapXml()
740 return (HashMap<String, ?>) readValueXml(parser, new String[1]); in readMapXml()
759 XmlPullParser parser = Xml.newPullParser(); in readListXml() local
760 parser.setInput(in, StandardCharsets.UTF_8.name()); in readListXml()
761 return (ArrayList)readValueXml(parser, new String[1]); in readListXml()
[all …]
/frameworks/base/graphics/java/android/graphics/
DFontListParser.java93 XmlPullParser parser = Xml.newPullParser(); in parse() local
94 parser.setInput(in, null); in parse()
95 parser.nextTag(); in parse()
96 return readFamilies(parser); in parse()
102 private static Config readFamilies(XmlPullParser parser) in readFamilies() argument
105 parser.require(XmlPullParser.START_TAG, null, "familyset"); in readFamilies()
106 while (parser.next() != XmlPullParser.END_TAG) { in readFamilies()
107 if (parser.getEventType() != XmlPullParser.START_TAG) continue; in readFamilies()
108 String tag = parser.getName(); in readFamilies()
110 config.families.add(readFamily(parser)); in readFamilies()
[all …]
/frameworks/base/core/java/com/android/server/
DSystemConfig.java258 XmlPullParser parser = Xml.newPullParser(); in readPermissionsFromXml() local
259 parser.setInput(permReader); in readPermissionsFromXml()
262 while ((type=parser.next()) != parser.START_TAG in readPermissionsFromXml()
263 && type != parser.END_DOCUMENT) { in readPermissionsFromXml()
267 if (type != parser.START_TAG) { in readPermissionsFromXml()
271 if (!parser.getName().equals("permissions") && !parser.getName().equals("config")) { in readPermissionsFromXml()
273 + ": found " + parser.getName() + ", expected 'permissions' or 'config'"); in readPermissionsFromXml()
282 XmlUtils.nextElement(parser); in readPermissionsFromXml()
283 if (parser.getEventType() == XmlPullParser.END_DOCUMENT) { in readPermissionsFromXml()
287 String name = parser.getName(); in readPermissionsFromXml()
[all …]
/frameworks/base/tools/aapt2/
DResourceParser.cpp133 bool ResourceParser::flattenXmlSubtree(xml::XmlPullParser* parser, std::u16string* outRawString, in flattenXmlSubtree() argument
142 while (xml::XmlPullParser::isGoodEvent(parser->next())) { in flattenXmlSubtree()
143 const xml::XmlPullParser::Event event = parser->getEvent(); in flattenXmlSubtree()
145 if (!parser->getElementNamespace().empty()) { in flattenXmlSubtree()
160 outRawString->append(parser->getText()); in flattenXmlSubtree()
161 builder.append(parser->getText()); in flattenXmlSubtree()
164 if (!parser->getElementNamespace().empty()) { in flattenXmlSubtree()
165 if (parser->getElementNamespace() != sXliffNamespaceUri) { in flattenXmlSubtree()
167 mDiag->warn(DiagMessage(mSource.withLine(parser->getLineNumber())) in flattenXmlSubtree()
169 << parser->getElementName() in flattenXmlSubtree()
[all …]
DResourceParser.h57 bool parse(xml::XmlPullParser* parser);
66 bool flattenXmlSubtree(xml::XmlPullParser* parser, std::u16string* outRawString,
75 std::unique_ptr<Item> parseXml(xml::XmlPullParser* parser, const uint32_t typeMask,
78 bool parseResources(xml::XmlPullParser* parser);
79 bool parseResource(xml::XmlPullParser* parser, ParsedResource* outResource);
81 bool parseItem(xml::XmlPullParser* parser, ParsedResource* outResource, uint32_t format);
82 bool parseString(xml::XmlPullParser* parser, ParsedResource* outResource);
84 bool parsePublic(xml::XmlPullParser* parser, ParsedResource* outResource);
85 bool parsePublicGroup(xml::XmlPullParser* parser, ParsedResource* outResource);
86 bool parseSymbolImpl(xml::XmlPullParser* parser, ParsedResource* outResource);
[all …]
/frameworks/base/core/java/android/view/animation/
DAnimationUtils.java73 XmlResourceParser parser = null; in loadAnimation() local
75 parser = context.getResources().getAnimation(id); in loadAnimation()
76 return createAnimationFromXml(context, parser); in loadAnimation()
88 if (parser != null) parser.close(); in loadAnimation()
92 private static Animation createAnimationFromXml(Context c, XmlPullParser parser) in createAnimationFromXml() argument
95 return createAnimationFromXml(c, parser, null, Xml.asAttributeSet(parser)); in createAnimationFromXml()
98 private static Animation createAnimationFromXml(Context c, XmlPullParser parser, in createAnimationFromXml() argument
105 int depth = parser.getDepth(); in createAnimationFromXml()
107 while (((type=parser.next()) != XmlPullParser.END_TAG || parser.getDepth() > depth) in createAnimationFromXml()
114 String name = parser.getName(); in createAnimationFromXml()
[all …]
/frameworks/opt/telephony/src/java/com/android/internal/telephony/test/
DTestConferenceEventPackageParser.java90 XmlPullParser parser; in parse() local
92 parser = Xml.newPullParser(); in parse()
93 parser.setInput(mInputStream, null); in parse()
94 parser.nextTag(); in parse()
96 int outerDepth = parser.getDepth(); in parse()
97 while (XmlUtils.nextElementWithin(parser, outerDepth)) { in parse()
98 if (parser.getName().equals(PARTICIPANT_TAG)) { in parse()
100 Bundle participant = parseParticipant(parser); in parse()
126 private Bundle parseParticipant(XmlPullParser parser) in parseParticipant() argument
135 int outerDepth = parser.getDepth(); in parseParticipant()
[all …]
/frameworks/base/tools/aapt2/xml/
DXmlPullParser_test.cpp29 xml::XmlPullParser parser(str); in TEST() local
31 const size_t depthOuter = parser.getDepth(); in TEST()
32 ASSERT_TRUE(xml::XmlPullParser::nextChildNode(&parser, depthOuter)); in TEST()
34 EXPECT_EQ(xml::XmlPullParser::Event::kStartElement, parser.getEvent()); in TEST()
35 EXPECT_EQ(StringPiece16(u"a"), StringPiece16(parser.getElementName())); in TEST()
37 const size_t depthA = parser.getDepth(); in TEST()
38 ASSERT_TRUE(xml::XmlPullParser::nextChildNode(&parser, depthA)); in TEST()
39 EXPECT_EQ(xml::XmlPullParser::Event::kStartElement, parser.getEvent()); in TEST()
40 EXPECT_EQ(StringPiece16(u"b"), StringPiece16(parser.getElementName())); in TEST()
42 const size_t depthB = parser.getDepth(); in TEST()
[all …]
DXmlPullParser.cpp206 XmlPullParser* parser = reinterpret_cast<XmlPullParser*>(userData); in startNamespaceHandler() local
208 parser->mNamespaceUris.push(namespaceUri); in startNamespaceHandler()
209 parser->mEventQueue.push(EventData{ in startNamespaceHandler()
211 XML_GetCurrentLineNumber(parser->mParser), in startNamespaceHandler()
212 parser->mDepth++, in startNamespaceHandler()
220 XmlPullParser* parser = reinterpret_cast<XmlPullParser*>(userData); in startElementHandler() local
223 Event::kStartElement, XML_GetCurrentLineNumber(parser->mParser), parser->mDepth++ in startElementHandler()
238 parser->mEventQueue.push(std::move(data)); in startElementHandler()
242 XmlPullParser* parser = reinterpret_cast<XmlPullParser*>(userData); in characterDataHandler() local
244 parser->mEventQueue.push(EventData{ in characterDataHandler()
[all …]
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/util/
DFrameParserTest.java139 FrameParser parser = new FrameParser( in parseProbeResponseFrame() local
141 assertEquals(TEST_PROBE_RESPONSE_FRAME_PROTOCOL_STRING, parser.mMostSpecificProtocolString); in parseProbeResponseFrame()
142 assertEquals(TEST_PROBE_RESPONSE_FRAME_TYPE_STRING, parser.mTypeString); in parseProbeResponseFrame()
164 FrameParser parser = new FrameParser( in canParseStatusCodeOutOfNonHtOpenAuthenticationReply() local
178 assertEquals("802.11 Mgmt", parser.mMostSpecificProtocolString); in canParseStatusCodeOutOfNonHtOpenAuthenticationReply()
179 assertEquals("Authentication", parser.mTypeString); in canParseStatusCodeOutOfNonHtOpenAuthenticationReply()
180 assertEquals("17: Association denied; too many STAs", parser.mResultString); in canParseStatusCodeOutOfNonHtOpenAuthenticationReply()
186 FrameParser parser = new FrameParser( in canParseStatusCodeOutOfNonHtAssociationResponse() local
211 assertEquals("802.11 Mgmt", parser.mMostSpecificProtocolString); in canParseStatusCodeOutOfNonHtAssociationResponse()
212 assertEquals("Association Response", parser.mTypeString); in canParseStatusCodeOutOfNonHtAssociationResponse()
[all …]
/frameworks/base/tools/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/android/
DBridgeXmlBlockParserTest.java43 XmlPullParser parser = ParserFactory.create( in testXmlBlockParser() local
47 parser = new BridgeXmlBlockParser(parser, null, false /* platformResourceFlag */); in testXmlBlockParser()
49 assertEquals(XmlPullParser.START_DOCUMENT, parser.next()); in testXmlBlockParser()
51 assertEquals(XmlPullParser.START_TAG, parser.next()); in testXmlBlockParser()
52 assertEquals("LinearLayout", parser.getName()); in testXmlBlockParser()
54 assertEquals(XmlPullParser.TEXT, parser.next()); in testXmlBlockParser()
56 assertEquals(XmlPullParser.START_TAG, parser.next()); in testXmlBlockParser()
57 assertEquals("Button", parser.getName()); in testXmlBlockParser()
58 assertEquals(XmlPullParser.TEXT, parser.next()); in testXmlBlockParser()
59 assertEquals(XmlPullParser.END_TAG, parser.next()); in testXmlBlockParser()
[all …]
/frameworks/base/packages/PrintRecommendationService/src/com/android/printservice/recommendation/plugin/mdnsFilter/
DVendorConfig.java128 private static @NonNull String readText(XmlPullParser parser) in readText() argument
132 if (parser.next() == XmlPullParser.TEXT) { in readText()
133 result = parser.getText(); in readText()
134 parser.nextTag(); in readText()
152 @NonNull XmlPullParser parser, @NonNull String tagName, boolean resolveReferences) in readSimpleTag() argument
154 parser.require(XmlPullParser.START_TAG, null, tagName); in readSimpleTag()
155 String text = readText(parser); in readSimpleTag()
156 parser.require(XmlPullParser.END_TAG, null, tagName); in readSimpleTag()
180 private static @NonNull <T> ArrayList<T> readTagList(@NonNull XmlPullParser parser, in readTagList() argument
185 parser.require(XmlPullParser.START_TAG, null, tagName); in readTagList()
[all …]
/frameworks/base/core/java/android/app/
DAliasActivity.java56 XmlResourceParser parser = null; in onCreate() local
60 parser = ai.loadXmlMetaData(getPackageManager(), in onCreate()
62 if (parser == null) { in onCreate()
67 Intent intent = parseAlias(parser); in onCreate()
83 if (parser != null) parser.close(); in onCreate()
87 private Intent parseAlias(XmlPullParser parser) in parseAlias() argument
89 AttributeSet attrs = Xml.asAttributeSet(parser); in parseAlias()
94 while ((type=parser.next()) != XmlPullParser.END_DOCUMENT in parseAlias()
98 String nodeName = parser.getName(); in parseAlias()
102 + nodeName + " at " + parser.getPositionDescription()); in parseAlias()
[all …]
/frameworks/base/packages/PrintSpooler/src/com/android/printspooler/model/
DPrintSpoolerService.java1082 XmlPullParser parser = Xml.newPullParser(); in readStateLocked() local
1083 parser.setInput(in, StandardCharsets.UTF_8.name()); in readStateLocked()
1084 parseState(parser); in readStateLocked()
1102 private void parseState(XmlPullParser parser) in parseState() argument
1104 parser.next(); in parseState()
1105 skipEmptyTextTags(parser); in parseState()
1106 expect(parser, XmlPullParser.START_TAG, TAG_SPOOLER); in parseState()
1107 parser.next(); in parseState()
1109 while (parsePrintJob(parser)) { in parseState()
1110 parser.next(); in parseState()
[all …]
/frameworks/base/core/java/android/preference/
DGenericInflater.java240 public T inflate(XmlPullParser parser, P root) { in inflate() argument
241 return inflate(parser, root, root != null); in inflate()
262 XmlResourceParser parser = getContext().getResources().getXml(resource); in inflate() local
264 return inflate(parser, root, attachToRoot); in inflate()
266 parser.close(); in inflate()
291 public T inflate(XmlPullParser parser, P root, in inflate() argument
294 final AttributeSet attrs = Xml.asAttributeSet(parser); in inflate()
301 while ((type = parser.next()) != parser.START_TAG in inflate()
302 && type != parser.END_DOCUMENT) { in inflate()
306 if (type != parser.START_TAG) { in inflate()
[all …]
/frameworks/base/services/core/java/com/android/server/pm/
DCrossProfileIntentFilter.java66 CrossProfileIntentFilter(XmlPullParser parser) throws XmlPullParserException, IOException { in CrossProfileIntentFilter() argument
67 mTargetUserId = getIntFromXml(parser, ATTR_TARGET_USER_ID, UserHandle.USER_NULL); in CrossProfileIntentFilter()
68 mOwnerPackage = getStringFromXml(parser, ATTR_OWNER_PACKAGE, ""); in CrossProfileIntentFilter()
69 mFlags = getIntFromXml(parser, ATTR_FLAGS, 0); in CrossProfileIntentFilter()
71 int outerDepth = parser.getDepth(); in CrossProfileIntentFilter()
72 String tagName = parser.getName(); in CrossProfileIntentFilter()
74 while ((type = parser.next()) != XmlPullParser.END_DOCUMENT in CrossProfileIntentFilter()
75 && (type != XmlPullParser.END_TAG || parser.getDepth() > outerDepth)) { in CrossProfileIntentFilter()
76 tagName = parser.getName(); in CrossProfileIntentFilter()
85 + parser.getPositionDescription(); in CrossProfileIntentFilter()
[all …]
DSELinuxMMAC.java107 XmlPullParser parser = Xml.newPullParser(); in readInstallPolicy() local
112 parser.setInput(policyFile); in readInstallPolicy()
113 parser.nextTag(); in readInstallPolicy()
114 parser.require(XmlPullParser.START_TAG, null, "policy"); in readInstallPolicy()
116 while (parser.next() != XmlPullParser.END_TAG) { in readInstallPolicy()
117 if (parser.getEventType() != XmlPullParser.START_TAG) { in readInstallPolicy()
121 switch (parser.getName()) { in readInstallPolicy()
123 policies.add(readSignerOrThrow(parser)); in readInstallPolicy()
126 skip(parser); in readInstallPolicy()
132 sb.append(parser.getPositionDescription()); in readInstallPolicy()
[all …]
DPersistentPreferredActivity.java46 PersistentPreferredActivity(XmlPullParser parser) throws XmlPullParserException, IOException { in PersistentPreferredActivity() argument
47 String shortComponent = parser.getAttributeValue(null, ATTR_NAME); in PersistentPreferredActivity()
53 " at " + parser.getPositionDescription()); in PersistentPreferredActivity()
55 int outerDepth = parser.getDepth(); in PersistentPreferredActivity()
56 String tagName = parser.getName(); in PersistentPreferredActivity()
58 while ((type = parser.next()) != XmlPullParser.END_DOCUMENT in PersistentPreferredActivity()
59 && (type != XmlPullParser.END_TAG || parser.getDepth() > outerDepth)) { in PersistentPreferredActivity()
60 tagName = parser.getName(); in PersistentPreferredActivity()
69 " at " + parser.getPositionDescription()); in PersistentPreferredActivity()
70 XmlUtils.skipCurrentTag(parser); in PersistentPreferredActivity()
[all …]
/frameworks/base/packages/WallpaperCropper/src/com/android/gallery3d/exif/
DExifReader.java46 ExifParser parser = ExifParser.parse(inputStream, mInterface); in read() local
47 ExifData exifData = new ExifData(parser.getByteOrder()); in read()
50 int event = parser.next(); in read()
54 exifData.addIfdData(new IfdData(parser.getCurrentIfd())); in read()
57 tag = parser.getTag(); in read()
59 parser.registerForTagValue(tag); in read()
65 tag = parser.getTag(); in read()
67 parser.readFullTagValue(tag); in read()
72 byte buf[] = new byte[parser.getCompressedImageSize()]; in read()
73 if (buf.length == parser.read(buf)) { in read()
[all …]
/frameworks/base/core/java/android/transition/
DTransitionInflater.java77 XmlResourceParser parser = mContext.getResources().getXml(resource); in inflateTransition() local
79 return createTransitionFromXml(parser, Xml.asAttributeSet(parser), null); in inflateTransition()
86 parser.getPositionDescription() in inflateTransition()
91 parser.close(); in inflateTransition()
106 XmlResourceParser parser = mContext.getResources().getXml(resource); in inflateTransitionManager() local
108 return createTransitionManagerFromXml(parser, Xml.asAttributeSet(parser), sceneRoot); in inflateTransitionManager()
115 parser.getPositionDescription() in inflateTransitionManager()
120 parser.close(); in inflateTransitionManager()
127 private Transition createTransitionFromXml(XmlPullParser parser, in createTransitionFromXml() argument
135 int depth = parser.getDepth(); in createTransitionFromXml()
[all …]
/frameworks/base/services/usage/java/com/android/server/usage/
DUsageStatsXmlV1.java60 private static void loadUsageStats(XmlPullParser parser, IntervalStats statsOut) in loadUsageStats() argument
62 final String pkg = parser.getAttributeValue(null, PACKAGE_ATTR); in loadUsageStats()
71 parser, LAST_TIME_ACTIVE_ATTR); in loadUsageStats()
72 stats.mTotalTimeInForeground = XmlUtils.readLongAttribute(parser, TOTAL_TIME_ACTIVE_ATTR); in loadUsageStats()
73 stats.mLastEvent = XmlUtils.readIntAttribute(parser, LAST_EVENT_ATTR); in loadUsageStats()
76 private static void loadConfigStats(XmlPullParser parser, IntervalStats statsOut) in loadConfigStats() argument
79 Configuration.readXmlAttrs(parser, config); in loadConfigStats()
85 parser, LAST_TIME_ACTIVE_ATTR); in loadConfigStats()
87 configStats.mTotalTimeActive = XmlUtils.readLongAttribute(parser, TOTAL_TIME_ACTIVE_ATTR); in loadConfigStats()
88 configStats.mActivationCount = XmlUtils.readIntAttribute(parser, COUNT_ATTR); in loadConfigStats()
[all …]
/frameworks/opt/setupwizard/library/main/src/com/android/setupwizardlib/items/
DGenericInflater.java240 public T inflate(XmlPullParser parser, T root) { in inflate() argument
241 return inflate(parser, root, root != null); in inflate()
262 XmlResourceParser parser = getContext().getResources().getXml(resource); in inflate() local
264 return inflate(parser, root, attachToRoot); in inflate()
266 parser.close(); in inflate()
291 public T inflate(XmlPullParser parser, T root, boolean attachToRoot) { in inflate() argument
293 final AttributeSet attrs = Xml.asAttributeSet(parser); in inflate()
300 while ((type = parser.next()) != XmlPullParser.START_TAG in inflate()
305 throw new InflateException(parser.getPositionDescription() in inflate()
312 + parser.getName()); in inflate()
[all …]

12345678910>>...12