Home
last modified time | relevance | path

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

12345678910>>...24

/frameworks/base/tests/UsbTests/src/com/android/server/usb/
DUsbDescriptorParserTests.java66 UsbDescriptorParser parser = new UsbDescriptorParser("test-usb-addr", descriptors); in loadParser() local
67 return parser; in loadParser()
87 UsbDescriptorParser parser = loadParser(R.raw.usbdescriptors_headset); in testHeadsetDescriptorParser() local
88 assertTrue(parser.hasInput()); in testHeadsetDescriptorParser()
89 assertTrue(parser.hasOutput()); in testHeadsetDescriptorParser()
90 assertTrue(parser.isInputHeadset()); in testHeadsetDescriptorParser()
91 assertTrue(parser.isOutputHeadset()); in testHeadsetDescriptorParser()
93 assertTrue(parser.hasAudioInterface()); in testHeadsetDescriptorParser()
94 assertTrue(parser.hasHIDInterface()); in testHeadsetDescriptorParser()
95 assertFalse(parser.hasStorageInterface()); in testHeadsetDescriptorParser()
[all …]
/frameworks/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/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/core/java/android/security/net/config/
DXmlConfigSource.java82 try (XmlResourceParser parser = mContext.getResources().getXml(mResourceId)) { in ensureInitialized() argument
83 parseNetworkSecurityConfig(parser); in ensureInitialized()
94 private Pin parsePin(XmlResourceParser parser) in parsePin() argument
96 String digestAlgorithm = parser.getAttributeValue(null, "digest"); in parsePin()
98 throw new ParserException(parser, "Unsupported pin digest algorithm: " in parsePin()
101 if (parser.next() != XmlPullParser.TEXT) { in parsePin()
102 throw new ParserException(parser, "Missing pin digest"); in parsePin()
104 String digest = parser.getText().trim(); in parsePin()
109 throw new ParserException(parser, "Invalid pin digest", e); in parsePin()
113 throw new ParserException(parser, "digest length " + decodedDigest.length in parsePin()
[all …]
/frameworks/base/services/core/java/com/android/server/locksettings/recoverablekeystore/serialization/
DKeyChainSnapshotDeserializer.java87 TypedXmlPullParser parser = Xml.resolvePullParser(inputStream); in deserializeInternal() local
89 parser.nextTag(); in deserializeInternal()
90 parser.require(XmlPullParser.START_TAG, NAMESPACE, TAG_KEY_CHAIN_SNAPSHOT); in deserializeInternal()
93 while (parser.next() != XmlPullParser.END_TAG) { in deserializeInternal()
94 if (parser.getEventType() != XmlPullParser.START_TAG) { in deserializeInternal()
98 String name = parser.getName(); in deserializeInternal()
102 builder.setSnapshotVersion(readIntTag(parser, TAG_SNAPSHOT_VERSION)); in deserializeInternal()
107 readBlobTag(parser, TAG_RECOVERY_KEY_MATERIAL)); in deserializeInternal()
111 builder.setCounterId(readLongTag(parser, TAG_COUNTER_ID)); in deserializeInternal()
115 builder.setServerParams(readBlobTag(parser, TAG_SERVER_PARAMS)); in deserializeInternal()
[all …]
/frameworks/base/core/java/com/android/server/
DSystemConfig.java612 final XmlPullParser parser = Xml.newPullParser(); in readAllPermissions() local
615 readPermissions(parser, Environment.buildPath( in readAllPermissions()
619 readPermissions(parser, Environment.buildPath( in readAllPermissions()
629 readPermissions(parser, Environment.buildPath( in readAllPermissions()
631 readPermissions(parser, Environment.buildPath( in readAllPermissions()
637 readPermissions(parser, Environment.buildPath( in readAllPermissions()
640 readPermissions(parser, Environment.buildPath( in readAllPermissions()
648 readPermissions(parser, Environment.buildPath( in readAllPermissions()
650 readPermissions(parser, Environment.buildPath( in readAllPermissions()
657 readPermissions(parser, Environment.buildPath( in readAllPermissions()
[all …]
/frameworks/base/services/usage/java/com/android/server/usage/
DUsageStatsXmlV1.java84 private static void loadUsageStats(XmlPullParser parser, IntervalStats statsOut) in loadUsageStats() argument
86 final String pkg = parser.getAttributeValue(null, PACKAGE_ATTR); in loadUsageStats()
94 parser, LAST_TIME_ACTIVE_ATTR); in loadUsageStats()
98 parser, LAST_TIME_VISIBLE_ATTR); in loadUsageStats()
105 parser, LAST_TIME_SERVICE_USED_ATTR); in loadUsageStats()
110 stats.mTotalTimeInForeground = XmlUtils.readLongAttribute(parser, TOTAL_TIME_ACTIVE_ATTR); in loadUsageStats()
113 stats.mTotalTimeVisible = XmlUtils.readLongAttribute(parser, TOTAL_TIME_VISIBLE_ATTR); in loadUsageStats()
119 stats.mTotalTimeForegroundServiceUsed = XmlUtils.readLongAttribute(parser, in loadUsageStats()
125 stats.mLastEvent = XmlUtils.readIntAttribute(parser, LAST_EVENT_ATTR); in loadUsageStats()
126 stats.mAppLaunchCount = XmlUtils.readIntAttribute(parser, APP_LAUNCH_COUNT_ATTR, in loadUsageStats()
[all …]
/frameworks/base/tools/aapt2/
DResourceParser.h76 bool Parse(xml::XmlPullParser* parser);
86 std::optional<FlattenedXmlSubTree> CreateFlattenSubTree(xml::XmlPullParser* parser);
95 bool FlattenXmlSubtree(xml::XmlPullParser* parser, std::string* out_raw_string,
106 std::unique_ptr<Item> ParseXml(xml::XmlPullParser* parser, const uint32_t type_mask,
109 bool ParseResources(xml::XmlPullParser* parser);
110 bool ParseResource(xml::XmlPullParser* parser, ParsedResource* out_resource);
112 bool ParseItem(xml::XmlPullParser* parser, ParsedResource* out_resource, uint32_t format);
113 bool ParseString(xml::XmlPullParser* parser, ParsedResource* out_resource);
114 bool ParseMacro(xml::XmlPullParser* parser, ParsedResource* out_resource);
115 bool ParsePublic(xml::XmlPullParser* parser, ParsedResource* out_resource);
[all …]
DResourceParser.cpp248 xml::XmlPullParser* parser, std::string* out_raw_string, StyleString* out_style_string, in FlattenXmlSubtree() argument
265 while (depth > 0 && xml::XmlPullParser::IsGoodEvent(parser->Next())) { in FlattenXmlSubtree()
266 const xml::XmlPullParser::Event event = parser->event(); in FlattenXmlSubtree()
285 current_text += parser->text(); in FlattenXmlSubtree()
286 raw_string += parser->text(); in FlattenXmlSubtree()
290 if (parser->element_namespace().empty()) { in FlattenXmlSubtree()
293 span_node->name = parser->element_name(); in FlattenXmlSubtree()
294 const auto end_attr_iter = parser->end_attributes(); in FlattenXmlSubtree()
295 for (auto attr_iter = parser->begin_attributes(); attr_iter != end_attr_iter; in FlattenXmlSubtree()
305 } else if (parser->element_namespace() == sXliffNamespaceUri) { in FlattenXmlSubtree()
[all …]
/frameworks/base/core/java/com/android/internal/util/
DXmlUtils.java261 public static void skipCurrentTag(XmlPullParser parser) in skipCurrentTag() argument
263 int outerDepth = parser.getDepth(); in skipCurrentTag()
265 while ((type=parser.next()) != XmlPullParser.END_DOCUMENT in skipCurrentTag()
267 || parser.getDepth() > outerDepth)) { in skipCurrentTag()
967 TypedXmlPullParser parser = Xml.newFastPullParser(); in readMapXml() local
968 parser.setInput(in, StandardCharsets.UTF_8.name()); in readMapXml()
969 return (HashMap<String, ?>) readValueXml(parser, new String[1]); in readMapXml()
987 TypedXmlPullParser parser = Xml.newFastPullParser(); in readListXml() local
988 parser.setInput(in, StandardCharsets.UTF_8.name()); in readListXml()
989 return (ArrayList)readValueXml(parser, new String[1]); in readListXml()
[all …]
/frameworks/base/tools/aapt2/xml/
DXmlPullParser_test.cpp39 XmlPullParser parser(&input); in TEST() local
41 const size_t depth_outer = parser.depth(); in TEST()
42 ASSERT_TRUE(XmlPullParser::NextChildNode(&parser, depth_outer)); in TEST()
44 EXPECT_THAT(parser.event(), Eq(XmlPullParser::Event::kStartElement)); in TEST()
45 EXPECT_THAT(parser.element_name(), StrEq("a")); in TEST()
47 const size_t depth_a = parser.depth(); in TEST()
48 ASSERT_TRUE(XmlPullParser::NextChildNode(&parser, depth_a)); in TEST()
49 EXPECT_THAT(parser.event(), Eq(XmlPullParser::Event::kStartElement)); in TEST()
50 EXPECT_THAT(parser.element_name(), StrEq("b")); in TEST()
52 const size_t depth_b = parser.depth(); in TEST()
[all …]
DXmlPullParser.cpp219 XmlPullParser* parser = reinterpret_cast<XmlPullParser*>(user_data); in StartNamespaceHandler() local
221 parser->namespace_uris_.push(namespace_uri); in StartNamespaceHandler()
222 parser->event_queue_.push( in StartNamespaceHandler()
224 XML_GetCurrentLineNumber(parser->parser_), parser->depth_++, in StartNamespaceHandler()
231 XmlPullParser* parser = reinterpret_cast<XmlPullParser*>(user_data); in StartElementHandler() local
234 XML_GetCurrentLineNumber(parser->parser_), in StartElementHandler()
235 parser->depth_++}; in StartElementHandler()
250 parser->event_queue_.push(std::move(data)); in StartElementHandler()
255 XmlPullParser* parser = reinterpret_cast<XmlPullParser*>(user_data); in CharacterDataHandler() local
257 parser->event_queue_.push(EventData{Event::kText, XML_GetCurrentLineNumber(parser->parser_), in CharacterDataHandler()
[all …]
/frameworks/opt/telephony/src/java/com/android/internal/telephony/test/
DTestConferenceEventPackageParser.java89 XmlPullParser parser; in parse() local
91 parser = Xml.newPullParser(); in parse()
92 parser.setInput(mInputStream, null); in parse()
93 parser.nextTag(); in parse()
95 int outerDepth = parser.getDepth(); in parse()
96 while (XmlUtils.nextElementWithin(parser, outerDepth)) { in parse()
97 if (parser.getName().equals(PARTICIPANT_TAG)) { in parse()
99 Bundle participant = parseParticipant(parser); in parse()
125 private Bundle parseParticipant(XmlPullParser parser) in parseParticipant() argument
134 int outerDepth = parser.getDepth(); in parseParticipant()
[all …]
/frameworks/base/telephony/java/com/android/internal/telephony/util/
DXmlUtils.java31 public static void beginDocument(XmlPullParser parser, String firstElementName) in beginDocument() argument
34 while ((type = parser.next()) != parser.START_TAG && type != parser.END_DOCUMENT) { in beginDocument()
38 if (type != parser.START_TAG) { in beginDocument()
42 if (!parser.getName().equals(firstElementName)) { in beginDocument()
43 throw new XmlPullParserException("Unexpected start tag: found " + parser.getName() in beginDocument()
51 public static void nextElement(XmlPullParser parser) in nextElement() argument
54 while ((type = parser.next()) != parser.START_TAG && type != parser.END_DOCUMENT) { in nextElement()
62 public static boolean nextElementWithin(XmlPullParser parser, int outerDepth) in nextElementWithin() argument
65 int type = parser.next(); in nextElementWithin()
67 || (type == XmlPullParser.END_TAG && parser.getDepth() == outerDepth)) { in nextElementWithin()
[all …]
/frameworks/base/graphics/java/android/graphics/
DFontListParser.java75 XmlPullParser parser = Xml.newPullParser(); in parse() local
76 parser.setInput(in, null); in parse()
77 parser.nextTag(); in parse()
78 return readFamilies(parser, "/system/fonts/", new FontCustomizationParser.Result(), null, in parse()
117 XmlPullParser parser = Xml.newPullParser(); in parse() local
118 parser.setInput(is, null); in parse()
119 parser.nextTag(); in parse()
120 return readFamilies(parser, systemFontDir, oemCustomization, updatableFontMap, in parse()
142 @NonNull XmlPullParser parser, in readFamilies()
156 parser.require(XmlPullParser.START_TAG, null, "familyset"); in readFamilies()
[all …]
/frameworks/base/services/core/java/com/android/server/tv/tunerresourcemanager/
DUseCasePriorityHints.java118 TypedXmlPullParser parser = Xml.resolvePullParser(in); in parseInternal() local
119 parser.nextTag(); in parseInternal()
120 readUseCase(parser); in parseInternal()
139 private void readUseCase(TypedXmlPullParser parser) in readUseCase() argument
141 parser.require(XmlPullParser.START_TAG, NS, "config"); in readUseCase()
142 while (parser.next() != XmlPullParser.END_TAG) { in readUseCase()
143 if (parser.getEventType() != XmlPullParser.START_TAG) { in readUseCase()
146 String name = parser.getName(); in readUseCase()
149 mDefaultForeground = readAttributeToInt("fgPriority", parser); in readUseCase()
150 mDefaultBackground = readAttributeToInt("bgPriority", parser); in readUseCase()
[all …]
/frameworks/base/core/java/android/view/animation/
DAnimationUtils.java136 XmlResourceParser parser = null; in loadAnimation() local
138 parser = context.getResources().getAnimation(id); in loadAnimation()
139 return createAnimationFromXml(context, parser); in loadAnimation()
151 if (parser != null) parser.close(); in loadAnimation()
155 private static Animation createAnimationFromXml(Context c, XmlPullParser parser) in createAnimationFromXml() argument
158 return createAnimationFromXml(c, parser, null, Xml.asAttributeSet(parser)); in createAnimationFromXml()
162 private static Animation createAnimationFromXml(Context c, XmlPullParser parser, in createAnimationFromXml() argument
169 int depth = parser.getDepth(); in createAnimationFromXml()
171 while (((type=parser.next()) != XmlPullParser.END_TAG || parser.getDepth() > depth) in createAnimationFromXml()
178 String name = parser.getName(); in createAnimationFromXml()
[all …]
/frameworks/base/packages/PrintRecommendationService/src/com/android/printservice/recommendation/plugin/mdnsFilter/
DVendorConfig.java129 private static @NonNull String readText(XmlPullParser parser) in readText() argument
133 if (parser.next() == XmlPullParser.TEXT) { in readText()
134 result = parser.getText(); in readText()
135 parser.nextTag(); in readText()
153 @NonNull XmlPullParser parser, @NonNull String tagName, boolean resolveReferences) in readSimpleTag() argument
155 parser.require(XmlPullParser.START_TAG, null, tagName); in readSimpleTag()
156 String text = readText(parser); in readSimpleTag()
157 parser.require(XmlPullParser.END_TAG, null, tagName); in readSimpleTag()
181 private static @NonNull <T> ArrayList<T> readTagList(@NonNull XmlPullParser parser, in readTagList() argument
186 parser.require(XmlPullParser.START_TAG, null, tagName); in readTagList()
[all …]
/frameworks/base/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/storage/
DBubbleXmlHelper.kt100 val parser: XmlPullParser = Xml.newPullParser() in readXml() constant
101 parser.setInput(stream, StandardCharsets.UTF_8.name()) in readXml()
102 XmlUtils.beginDocument(parser, TAG_BUBBLES) in readXml()
103 val veryOuterDepth = parser.depth in readXml()
104 val version = parser.getAttributeWithName(ATTR_VERSION)?.toInt() ?: return bubbles in readXml()
106 while (XmlUtils.nextElementWithin(parser, veryOuterDepth)) { in readXml()
107 val uid = parser.getAttributeWithName(ATTR_USER_ID) ?: continue in readXml()
108 val outerDepth = parser.depth in readXml()
110 while (XmlUtils.nextElementWithin(parser, outerDepth)) { in readXml()
111 userBubbles.add(readXmlEntry(parser) ?: continue) in readXml()
[all …]
/frameworks/base/core/java/android/app/
DAliasActivity.java59 XmlResourceParser parser = null; in onCreate() local
63 parser = ai.loadXmlMetaData(getPackageManager(), in onCreate()
65 if (parser == null) { in onCreate()
70 Intent intent = parseAlias(parser); in onCreate()
86 if (parser != null) parser.close(); in onCreate()
90 private Intent parseAlias(XmlPullParser parser) in parseAlias() argument
92 AttributeSet attrs = Xml.asAttributeSet(parser); in parseAlias()
97 while ((type=parser.next()) != XmlPullParser.END_DOCUMENT in parseAlias()
101 String nodeName = parser.getName(); in parseAlias()
105 + nodeName + " at " + parser.getPositionDescription()); in parseAlias()
[all …]
/frameworks/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/android/
DBridgeXmlBlockParserTest.java50 XmlPullParser parser = ParserFactory.create( in testXmlBlockParser() local
54 parser = new BridgeXmlBlockParser(parser, null, ResourceNamespace.RES_AUTO); in testXmlBlockParser()
56 assertEquals(XmlPullParser.START_DOCUMENT, parser.next()); in testXmlBlockParser()
58 assertEquals(XmlPullParser.START_TAG, parser.next()); in testXmlBlockParser()
59 assertEquals("LinearLayout", parser.getName()); in testXmlBlockParser()
61 assertEquals(XmlPullParser.START_TAG, parser.next()); in testXmlBlockParser()
62 assertEquals("Button", parser.getName()); in testXmlBlockParser()
63 assertEquals(XmlPullParser.END_TAG, parser.next()); in testXmlBlockParser()
65 assertEquals(XmlPullParser.START_TAG, parser.next()); in testXmlBlockParser()
66 assertEquals("View", parser.getName()); in testXmlBlockParser()
[all …]
/frameworks/opt/setupwizard/library/main/src/com/android/setupwizardlib/items/
DSimpleInflater.java66 XmlResourceParser parser = getResources().getXml(resId); in inflate() local
68 return inflate(parser); in inflate()
70 parser.close(); in inflate()
85 public T inflate(XmlPullParser parser) { in inflate() argument
86 final AttributeSet attrs = Xml.asAttributeSet(parser); in inflate()
92 while ((type = parser.next()) != XmlPullParser.START_TAG in inflate()
98 throw new InflateException(parser.getPositionDescription() + ": No start tag found!"); in inflate()
101 createdItem = createItemFromTag(parser.getName(), attrs); in inflate()
103 rInflate(parser, createdItem, attrs); in inflate()
107 throw new InflateException(parser.getPositionDescription() + ": " + e.getMessage(), e); in inflate()
[all …]
/frameworks/base/services/core/java/com/android/server/pm/
DUserTypeFactory.java82 try (XmlResourceParser parser = in getUserTypes() argument
84 customizeBuilders(builders, parser); in getUserTypes()
311 XmlResourceParser parser) { in customizeBuilders() argument
313 XmlUtils.beginDocument(parser, "user-types"); in customizeBuilders()
314 for (XmlUtils.nextElement(parser); in customizeBuilders()
315 parser.getEventType() != XmlResourceParser.END_DOCUMENT; in customizeBuilders()
316 XmlUtils.nextElement(parser)) { in customizeBuilders()
318 final String elementName = parser.getName(); in customizeBuilders()
325 XmlUtils.skipCurrentTag(parser); in customizeBuilders()
329 + parser.getPositionDescription()); in customizeBuilders()
[all …]
DPackageSignatures.java108 void readXml(TypedXmlPullParser parser, ArrayList<Signature> readSignatures) in readXml() argument
112 final int count = parser.getAttributeInt(null, "count", -1); in readXml()
116 + " no count at " + parser.getPositionDescription()); in readXml()
117 XmlUtils.skipCurrentTag(parser); in readXml()
121 final int signatureSchemeVersion = parser.getAttributeInt(null, "schemeVersion", in readXml()
126 + parser.getPositionDescription()); in readXml()
130 int pos = readCertsListXml(parser, readSignatures, signatureList, count, false, builder); in readXml()
136 + " <cert> entries" + parser.getPositionDescription()); in readXml()
149 private int readCertsListXml(TypedXmlPullParser parser, ArrayList<Signature> readSignatures, in readCertsListXml() argument
155 int outerDepth = parser.getDepth(); in readCertsListXml()
[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 …]

12345678910>>...24