Home
last modified time | relevance | path

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

12345678910>>...27

/frameworks/base/packages/SystemUI/tests/src/com/android/systemui/statusbar/commandline/
DCommandParserTest.kt30 private val parser = CommandParser() constant
34 parser.flag("-f") in registerToken_cannotReuseNames()
35 assertThrows(IllegalArgumentException::class.java) { parser.flag("-f") } in registerToken_cannotReuseNames()
40 assertThrows(ArgParseError::class.java) { parser.parse(listOf("unknown-token")) } in unknownToken_throws()
45 val flag by parser.flag("-f") in parseSingleFlag_present()
46 parser.parse(listOf("-f")) in parseSingleFlag_present()
52 val flag by parser.flag("-f") in parseSingleFlag_notPresent()
53 parser.parse(listOf()) in parseSingleFlag_notPresent()
59 val param by parser.param("-p", valueParser = Type.Int) in parseSingleOptionalParam_present()
60 parser.parse(listOf("-p", "123")) in parseSingleOptionalParam_present()
[all …]
/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/base/core/java/com/android/internal/vibrator/persistence/
DXmlReader.java42 public static void readDocumentStartTag(TypedXmlPullParser parser, String expectedRootTag) in readDocumentStartTag() argument
44 readDocumentStart(parser); in readDocumentStartTag()
46 String tagName = parser.getName(); in readDocumentStartTag()
56 public static void readDocumentStart(TypedXmlPullParser parser) in readDocumentStart() argument
59 int type = parser.getEventType(); in readDocumentStart()
63 parser.nextTag(); // skips comments, instruction tokens and whitespace only in readDocumentStart()
75 public static void readDocumentEndTag(TypedXmlPullParser parser) in readDocumentEndTag() argument
78 int type = parser.getEventType(); in readDocumentEndTag()
82 type = parser.next(); // skips comments and instruction tokens in readDocumentEndTag()
83 if (type == XmlPullParser.TEXT && parser.isWhitespace()) { // skip whitespace only in readDocumentEndTag()
[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/services/core/java/com/android/server/appop/
DLegacyAppOpStateParser.java53 TypedXmlPullParser parser = Xml.resolvePullParser(stream); in readState() local
55 while ((type = parser.next()) != XmlPullParser.START_TAG in readState()
64 int versionAtBoot = parser.getAttributeInt(null, "v", NO_VERSION); in readState()
66 int outerDepth = parser.getDepth(); in readState()
67 while ((type = parser.next()) != XmlPullParser.END_DOCUMENT in readState()
68 && (type != XmlPullParser.END_TAG || parser.getDepth() > outerDepth)) { in readState()
73 String tagName = parser.getName(); in readState()
78 readPackage(parser, userPackageModes); in readState()
80 readUidOps(parser, uidModes); in readState()
82 readUser(parser, userPackageModes); in readState()
[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/
DSystemConfig.java623 final XmlPullParser parser = Xml.newPullParser(); in readAllPermissions() local
626 readPermissions(parser, Environment.buildPath( in readAllPermissions()
630 readPermissions(parser, Environment.buildPath( in readAllPermissions()
640 readPermissions(parser, Environment.buildPath( in readAllPermissions()
642 readPermissions(parser, Environment.buildPath( in readAllPermissions()
648 readPermissions(parser, Environment.buildPath( in readAllPermissions()
651 readPermissions(parser, Environment.buildPath( in readAllPermissions()
659 readPermissions(parser, Environment.buildPath( in readAllPermissions()
661 readPermissions(parser, Environment.buildPath( in readAllPermissions()
668 readPermissions(parser, Environment.buildPath( in readAllPermissions()
[all …]
/frameworks/base/services/core/java/com/android/server/locksettings/recoverablekeystore/serialization/
DKeyChainSnapshotDeserializer.java88 TypedXmlPullParser parser = Xml.resolvePullParser(inputStream); in deserializeInternal() local
90 parser.nextTag(); in deserializeInternal()
91 parser.require(XmlPullParser.START_TAG, NAMESPACE, TAG_KEY_CHAIN_SNAPSHOT); in deserializeInternal()
94 while (parser.next() != XmlPullParser.END_TAG) { in deserializeInternal()
95 if (parser.getEventType() != XmlPullParser.START_TAG) { in deserializeInternal()
99 String name = parser.getName(); in deserializeInternal()
103 builder.setSnapshotVersion(readIntTag(parser, TAG_SNAPSHOT_VERSION)); in deserializeInternal()
108 readBlobTag(parser, TAG_RECOVERY_KEY_MATERIAL)); in deserializeInternal()
112 builder.setCounterId(readLongTag(parser, TAG_COUNTER_ID)); in deserializeInternal()
116 builder.setServerParams(readBlobTag(parser, TAG_SERVER_PARAMS)); in deserializeInternal()
[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/core/tests/vibrator/src/android/os/vibrator/persistence/
DVibrationEffectXmlSerializationTest.java90 TypedXmlPullParser parser = createXmlPullParser(xml); in testParseElement_fromVibrationTag_succeedAndParserPointsToEndVibrationTag() local
91 assertParseElementSucceeds(parser, effect); in testParseElement_fromVibrationTag_succeedAndParserPointsToEndVibrationTag()
92 parser.next(); in testParseElement_fromVibrationTag_succeedAndParserPointsToEndVibrationTag()
93 assertEndOfDocument(parser); in testParseElement_fromVibrationTag_succeedAndParserPointsToEndVibrationTag()
97 parser = createXmlPullParser("<next-tag>" + xml + "</next-tag>"); in testParseElement_fromVibrationTag_succeedAndParserPointsToEndVibrationTag()
99 parser.next(); in testParseElement_fromVibrationTag_succeedAndParserPointsToEndVibrationTag()
100 assertParseElementSucceeds(parser, effect); in testParseElement_fromVibrationTag_succeedAndParserPointsToEndVibrationTag()
101 parser.next(); in testParseElement_fromVibrationTag_succeedAndParserPointsToEndVibrationTag()
102 assertEndTag(parser, "next-tag"); in testParseElement_fromVibrationTag_succeedAndParserPointsToEndVibrationTag()
104 parser = createXmlPullParser(xml + "<next-tag>"); in testParseElement_fromVibrationTag_succeedAndParserPointsToEndVibrationTag()
[all …]
/frameworks/base/graphics/java/android/graphics/
DFontListParser.java84 XmlPullParser parser = Xml.newPullParser(); in parse() local
85 parser.setInput(in, null); in parse()
86 parser.nextTag(); in parse()
87 return readFamilies(parser, "/system/fonts/", new FontCustomizationParser.Result(), null, in parse()
126 XmlPullParser parser = Xml.newPullParser(); in parse() local
127 parser.setInput(is, null); in parse()
128 parser.nextTag(); in parse()
129 return readFamilies(parser, systemFontDir, oemCustomization, updatableFontMap, in parse()
151 @NonNull XmlPullParser parser, in readFamilies()
167 parser.require(XmlPullParser.START_TAG, null, "familyset"); in readFamilies()
[all …]
/frameworks/base/core/java/com/android/internal/util/
DXmlUtils.java263 public static void skipCurrentTag(XmlPullParser parser) in skipCurrentTag() argument
265 int outerDepth = parser.getDepth(); in skipCurrentTag()
267 while ((type=parser.next()) != XmlPullParser.END_DOCUMENT in skipCurrentTag()
269 || parser.getDepth() > outerDepth)) { in skipCurrentTag()
969 TypedXmlPullParser parser = Xml.newFastPullParser(); in readMapXml() local
970 parser.setInput(in, StandardCharsets.UTF_8.name()); in readMapXml()
971 return (HashMap<String, ?>) readValueXml(parser, new String[1]); in readMapXml()
989 TypedXmlPullParser parser = Xml.newFastPullParser(); in readListXml() local
990 parser.setInput(in, StandardCharsets.UTF_8.name()); in readListXml()
991 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.cpp218 XmlPullParser* parser = reinterpret_cast<XmlPullParser*>(user_data); in StartNamespaceHandler() local
220 parser->namespace_uris_.push(namespace_uri); in StartNamespaceHandler()
221 parser->event_queue_.push( in StartNamespaceHandler()
223 XML_GetCurrentLineNumber(parser->parser_), parser->depth_++, in StartNamespaceHandler()
230 XmlPullParser* parser = reinterpret_cast<XmlPullParser*>(user_data); in StartElementHandler() local
233 XML_GetCurrentLineNumber(parser->parser_), in StartElementHandler()
234 parser->depth_++}; in StartElementHandler()
249 parser->event_queue_.push(std::move(data)); in StartElementHandler()
254 XmlPullParser* parser = reinterpret_cast<XmlPullParser*>(user_data); in CharacterDataHandler() local
256 parser->event_queue_.push(EventData{Event::kText, XML_GetCurrentLineNumber(parser->parser_), in CharacterDataHandler()
[all …]
/frameworks/base/tools/aapt2/
DResourceParser.h75 bool Parse(xml::XmlPullParser* parser);
85 std::optional<FlattenedXmlSubTree> CreateFlattenSubTree(xml::XmlPullParser* parser);
94 bool FlattenXmlSubtree(xml::XmlPullParser* parser, std::string* out_raw_string,
105 std::unique_ptr<Item> ParseXml(xml::XmlPullParser* parser, const uint32_t type_mask,
108 bool ParseResources(xml::XmlPullParser* parser);
109 bool ParseResource(xml::XmlPullParser* parser, ParsedResource* out_resource);
111 bool ParseItem(xml::XmlPullParser* parser, ParsedResource* out_resource, uint32_t format);
112 bool ParseString(xml::XmlPullParser* parser, ParsedResource* out_resource);
113 bool ParseMacro(xml::XmlPullParser* parser, ParsedResource* out_resource);
114 bool ParsePublic(xml::XmlPullParser* parser, ParsedResource* out_resource);
[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/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.java219 XmlResourceParser parser = null; in loadAnimation() local
221 parser = context.getResources().getAnimation(id); in loadAnimation()
222 return createAnimationFromXml(context, parser); in loadAnimation()
227 if (parser != null) parser.close(); in loadAnimation()
231 private static Animation createAnimationFromXml(Context c, XmlPullParser parser) in createAnimationFromXml() argument
234 return createAnimationFromXml(c, parser, null, Xml.asAttributeSet(parser)); in createAnimationFromXml()
239 Context c, XmlPullParser parser, AnimationSet parent, AttributeSet attrs) in createAnimationFromXml() argument
246 int depth = parser.getDepth(); in createAnimationFromXml()
248 while (((type = parser.next()) != XmlPullParser.END_TAG || parser.getDepth() > depth) in createAnimationFromXml()
255 String name = parser.getName(); in createAnimationFromXml()
[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()
82 if (parser != null) parser.close(); in onCreate()
86 private Intent parseAlias(XmlPullParser parser) in parseAlias() argument
88 AttributeSet attrs = Xml.asAttributeSet(parser); in parseAlias()
93 while ((type=parser.next()) != XmlPullParser.END_DOCUMENT in parseAlias()
97 String nodeName = parser.getName(); in parseAlias()
101 + nodeName + " at " + parser.getPositionDescription()); in parseAlias()
[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/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 …]

12345678910>>...27