/frameworks/base/tests/UsbTests/src/com/android/server/usb/ |
D | UsbDescriptorParserTests.java | 66 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/ |
D | LayoutParserWrapperTest.java | 38 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/ |
D | StackOverflowXmlParser.java | 39 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/ |
D | XmlConfigSource.java | 82 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/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/util/ |
D | FrameParserTest.java | 140 FrameParser parser = new FrameParser( in parseProbeResponseFrame() local 142 assertEquals(TEST_PROBE_RESPONSE_FRAME_PROTOCOL_STRING, parser.mMostSpecificProtocolString); in parseProbeResponseFrame() 143 assertEquals(TEST_PROBE_RESPONSE_FRAME_TYPE_STRING, parser.mTypeString); in parseProbeResponseFrame() 165 FrameParser parser = new FrameParser( in canParseStatusCodeOutOfNonHtOpenAuthenticationReply() local 179 assertEquals("802.11 Mgmt", parser.mMostSpecificProtocolString); in canParseStatusCodeOutOfNonHtOpenAuthenticationReply() 180 assertEquals("Authentication", parser.mTypeString); in canParseStatusCodeOutOfNonHtOpenAuthenticationReply() 181 assertEquals("17: Association denied; too many STAs", parser.mResultString); in canParseStatusCodeOutOfNonHtOpenAuthenticationReply() 187 FrameParser parser = new FrameParser( in canParseStatusCodeOutOfNonHtAssociationResponse() local 212 assertEquals("802.11 Mgmt", parser.mMostSpecificProtocolString); in canParseStatusCodeOutOfNonHtAssociationResponse() 213 assertEquals("Association Response", parser.mTypeString); in canParseStatusCodeOutOfNonHtAssociationResponse() [all …]
|
/frameworks/base/core/java/com/android/internal/util/ |
D | XmlUtils.java | 55 public static void skipCurrentTag(XmlPullParser parser) in skipCurrentTag() argument 57 int outerDepth = parser.getDepth(); in skipCurrentTag() 59 while ((type=parser.next()) != XmlPullParser.END_DOCUMENT in skipCurrentTag() 61 || parser.getDepth() > outerDepth)) { in skipCurrentTag() 739 XmlPullParser parser = Xml.newPullParser(); in readMapXml() local 740 parser.setInput(in, StandardCharsets.UTF_8.name()); in readMapXml() 741 return (HashMap<String, ?>) readValueXml(parser, new String[1]); in readMapXml() 760 XmlPullParser parser = Xml.newPullParser(); in readListXml() local 761 parser.setInput(in, StandardCharsets.UTF_8.name()); in readListXml() 762 return (ArrayList)readValueXml(parser, new String[1]); in readListXml() [all …]
|
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/util/ |
D | XmlUtilHelper.java | 62 public static void skipCurrentTag(XmlPullParser parser) in skipCurrentTag() argument 64 int outerDepth = parser.getDepth(); in skipCurrentTag() 66 while ((type=parser.next()) != XmlPullParser.END_DOCUMENT in skipCurrentTag() 68 || parser.getDepth() > outerDepth)) { in skipCurrentTag() 746 XmlPullParser parser = Xml.newPullParser(); in readMapXml() local 747 parser.setInput(in, StandardCharsets.UTF_8.name()); in readMapXml() 748 return (HashMap<String, ?>) readValueXml(parser, new String[1]); in readMapXml() 767 XmlPullParser parser = Xml.newPullParser(); in readListXml() local 768 parser.setInput(in, StandardCharsets.UTF_8.name()); in readListXml() 769 return (ArrayList)readValueXml(parser, new String[1]); in readListXml() [all …]
|
/frameworks/base/core/java/com/android/server/ |
D | SystemConfig.java | 589 private void logNotAllowedInPartition(String name, File permFile, XmlPullParser parser) { in logNotAllowedInPartition() argument 591 + permFile + " at " + parser.getPositionDescription()); in logNotAllowedInPartition() 607 XmlPullParser parser = Xml.newPullParser(); in readPermissionsFromXml() local 608 parser.setInput(permReader); in readPermissionsFromXml() 611 while ((type=parser.next()) != parser.START_TAG in readPermissionsFromXml() 612 && type != parser.END_DOCUMENT) { in readPermissionsFromXml() 616 if (type != parser.START_TAG) { in readPermissionsFromXml() 620 if (!parser.getName().equals("permissions") && !parser.getName().equals("config")) { in readPermissionsFromXml() 622 + ": found " + parser.getName() + ", expected 'permissions' or 'config'"); in readPermissionsFromXml() 637 XmlUtils.nextElement(parser); in readPermissionsFromXml() [all …]
|
/frameworks/base/services/core/java/com/android/server/locksettings/recoverablekeystore/serialization/ |
D | KeyChainSnapshotDeserializer.java | 87 XmlPullParser parser = Xml.newPullParser(); in deserializeInternal() local 88 parser.setInput(inputStream, OUTPUT_ENCODING); in deserializeInternal() 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() [all …]
|
/frameworks/base/graphics/java/android/graphics/ |
D | FontListParser.java | 52 XmlPullParser parser = Xml.newPullParser(); in parse() local 53 parser.setInput(in, null); in parse() 54 parser.nextTag(); in parse() 55 return readFamilies(parser, fontDir); in parse() 61 private static FontConfig readFamilies(XmlPullParser parser, String fontDir) in readFamilies() argument 66 parser.require(XmlPullParser.START_TAG, null, "familyset"); in readFamilies() 67 while (parser.next() != XmlPullParser.END_TAG) { in readFamilies() 68 if (parser.getEventType() != XmlPullParser.START_TAG) continue; in readFamilies() 69 String tag = parser.getName(); in readFamilies() 71 families.add(readFamily(parser, fontDir)); in readFamilies() [all …]
|
/frameworks/base/services/usage/java/com/android/server/usage/ |
D | UsageStatsXmlV1.java | 84 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/ |
D | ResourceParser.h | 68 bool Parse(xml::XmlPullParser* parser); 80 bool FlattenXmlSubtree(xml::XmlPullParser* parser, std::string* out_raw_string, 91 std::unique_ptr<Item> ParseXml(xml::XmlPullParser* parser, const uint32_t type_mask, 94 bool ParseResources(xml::XmlPullParser* parser); 95 bool ParseResource(xml::XmlPullParser* parser, ParsedResource* out_resource); 97 bool ParseItem(xml::XmlPullParser* parser, ParsedResource* out_resource, uint32_t format); 98 bool ParseString(xml::XmlPullParser* parser, ParsedResource* out_resource); 100 bool ParsePublic(xml::XmlPullParser* parser, ParsedResource* out_resource); 101 bool ParsePublicGroup(xml::XmlPullParser* parser, ParsedResource* out_resource); 102 bool ParseSymbolImpl(xml::XmlPullParser* parser, ParsedResource* out_resource); [all …]
|
D | ResourceParser.cpp | 237 xml::XmlPullParser* parser, std::string* out_raw_string, StyleString* out_style_string, in FlattenXmlSubtree() argument 254 while (depth > 0 && xml::XmlPullParser::IsGoodEvent(parser->Next())) { in FlattenXmlSubtree() 255 const xml::XmlPullParser::Event event = parser->event(); in FlattenXmlSubtree() 274 current_text += parser->text(); in FlattenXmlSubtree() 275 raw_string += parser->text(); in FlattenXmlSubtree() 279 if (parser->element_namespace().empty()) { in FlattenXmlSubtree() 282 span_node->name = parser->element_name(); in FlattenXmlSubtree() 283 const auto end_attr_iter = parser->end_attributes(); in FlattenXmlSubtree() 284 for (auto attr_iter = parser->begin_attributes(); attr_iter != end_attr_iter; in FlattenXmlSubtree() 294 } else if (parser->element_namespace() == sXliffNamespaceUri) { in FlattenXmlSubtree() [all …]
|
/frameworks/base/tools/aapt2/xml/ |
D | XmlPullParser_test.cpp | 39 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 …]
|
D | XmlPullParser.cpp | 216 XmlPullParser* parser = reinterpret_cast<XmlPullParser*>(user_data); in StartNamespaceHandler() local 218 parser->namespace_uris_.push(namespace_uri); in StartNamespaceHandler() 219 parser->event_queue_.push( in StartNamespaceHandler() 221 XML_GetCurrentLineNumber(parser->parser_), parser->depth_++, in StartNamespaceHandler() 228 XmlPullParser* parser = reinterpret_cast<XmlPullParser*>(user_data); in StartElementHandler() local 231 XML_GetCurrentLineNumber(parser->parser_), in StartElementHandler() 232 parser->depth_++}; in StartElementHandler() 247 parser->event_queue_.push(std::move(data)); in StartElementHandler() 252 XmlPullParser* parser = reinterpret_cast<XmlPullParser*>(user_data); in CharacterDataHandler() local 254 parser->event_queue_.push(EventData{Event::kText, XML_GetCurrentLineNumber(parser->parser_), in CharacterDataHandler() [all …]
|
/frameworks/opt/telephony/src/java/com/android/internal/telephony/test/ |
D | TestConferenceEventPackageParser.java | 89 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/services/core/java/com/android/server/tv/tunerresourcemanager/ |
D | UseCasePriorityHints.java | 117 XmlPullParser parser = Xml.newPullParser(); in parseInternal() local 118 parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, false); in parseInternal() 119 parser.setInput(in, null); in parseInternal() 120 parser.nextTag(); in parseInternal() 121 readUseCase(parser); in parseInternal() 140 private void readUseCase(XmlPullParser parser) in readUseCase() argument 142 parser.require(XmlPullParser.START_TAG, NS, "config"); in readUseCase() 143 while (parser.next() != XmlPullParser.END_TAG) { in readUseCase() 144 if (parser.getEventType() != XmlPullParser.START_TAG) { in readUseCase() 147 String name = parser.getName(); in readUseCase() [all …]
|
/frameworks/base/telephony/java/com/android/internal/telephony/util/ |
D | XmlUtils.java | 31 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/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/android/ |
D | BridgeXmlBlockParserTest.java | 50 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.TEXT, parser.next()); in testXmlBlockParser() 63 assertEquals(XmlPullParser.START_TAG, parser.next()); in testXmlBlockParser() 64 assertEquals("Button", parser.getName()); in testXmlBlockParser() 65 assertEquals(XmlPullParser.TEXT, parser.next()); in testXmlBlockParser() 66 assertEquals(XmlPullParser.END_TAG, parser.next()); in testXmlBlockParser() [all …]
|
/frameworks/base/core/java/android/view/animation/ |
D | AnimationUtils.java | 136 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/ |
D | VendorConfig.java | 129 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/core/java/android/app/ |
D | AliasActivity.java | 59 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/opt/setupwizard/library/main/src/com/android/setupwizardlib/items/ |
D | SimpleInflater.java | 66 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/packages/WallpaperCropper/src/com/android/gallery3d/exif/ |
D | ExifReader.java | 46 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/services/core/java/com/android/server/pm/ |
D | UserTypeFactory.java | 85 try (XmlResourceParser parser = in getUserTypes() argument 87 customizeBuilders(builders, parser); in getUserTypes() 222 XmlResourceParser parser) { in customizeBuilders() argument 224 XmlUtils.beginDocument(parser, "user-types"); in customizeBuilders() 225 for (XmlUtils.nextElement(parser); in customizeBuilders() 226 parser.getEventType() != XmlResourceParser.END_DOCUMENT; in customizeBuilders() 227 XmlUtils.nextElement(parser)) { in customizeBuilders() 229 final String elementName = parser.getName(); in customizeBuilders() 236 + parser.getPositionDescription()); in customizeBuilders() 237 XmlUtils.skipCurrentTag(parser); in customizeBuilders() [all …]
|