/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/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/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/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/base/core/java/com/android/server/ |
D | SystemConfig.java | 494 private void logNotAllowedInPartition(String name, File permFile, XmlPullParser parser) { in logNotAllowedInPartition() argument 496 + permFile + " at " + parser.getPositionDescription()); in logNotAllowedInPartition() 511 XmlPullParser parser = Xml.newPullParser(); in readPermissionsFromXml() local 512 parser.setInput(permReader); in readPermissionsFromXml() 515 while ((type=parser.next()) != parser.START_TAG in readPermissionsFromXml() 516 && type != parser.END_DOCUMENT) { in readPermissionsFromXml() 520 if (type != parser.START_TAG) { in readPermissionsFromXml() 524 if (!parser.getName().equals("permissions") && !parser.getName().equals("config")) { in readPermissionsFromXml() 526 + ": found " + parser.getName() + ", expected 'permissions' or 'config'"); in readPermissionsFromXml() 541 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/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/util/ |
D | FrameParserTest.java | 139 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/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/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 | 233 xml::XmlPullParser* parser, std::string* out_raw_string, StyleString* out_style_string, in FlattenXmlSubtree() argument 250 while (depth > 0 && xml::XmlPullParser::IsGoodEvent(parser->Next())) { in FlattenXmlSubtree() 251 const xml::XmlPullParser::Event event = parser->event(); in FlattenXmlSubtree() 270 current_text += parser->text(); in FlattenXmlSubtree() 271 raw_string += parser->text(); in FlattenXmlSubtree() 275 if (parser->element_namespace().empty()) { in FlattenXmlSubtree() 278 span_node->name = parser->element_name(); in FlattenXmlSubtree() 279 const auto end_attr_iter = parser->end_attributes(); in FlattenXmlSubtree() 280 for (auto attr_iter = parser->begin_attributes(); attr_iter != end_attr_iter; in FlattenXmlSubtree() 290 } 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/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/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/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/services/usage/java/com/android/server/usage/ |
D | UsageStatsXmlV1.java | 85 private static void loadUsageStats(XmlPullParser parser, IntervalStats statsOut) in loadUsageStats() argument 87 final String pkg = parser.getAttributeValue(null, PACKAGE_ATTR); in loadUsageStats() 95 parser, LAST_TIME_ACTIVE_ATTR); in loadUsageStats() 99 parser, LAST_TIME_VISIBLE_ATTR); in loadUsageStats() 106 parser, LAST_TIME_SERVICE_USED_ATTR); in loadUsageStats() 111 stats.mTotalTimeInForeground = XmlUtils.readLongAttribute(parser, TOTAL_TIME_ACTIVE_ATTR); in loadUsageStats() 114 stats.mTotalTimeVisible = XmlUtils.readLongAttribute(parser, TOTAL_TIME_VISIBLE_ATTR); in loadUsageStats() 120 stats.mTotalTimeForegroundServiceUsed = XmlUtils.readLongAttribute(parser, in loadUsageStats() 126 stats.mLastEvent = XmlUtils.readIntAttribute(parser, LAST_EVENT_ATTR); in loadUsageStats() 127 stats.mAppLaunchCount = XmlUtils.readIntAttribute(parser, APP_LAUNCH_COUNT_ATTR, in loadUsageStats() [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 | CrossProfileIntentFilter.java | 66 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 …]
|
D | PackageSignatures.java | 107 void readXml(XmlPullParser parser, ArrayList<Signature> readSignatures) in readXml() argument 112 String countStr = parser.getAttributeValue(null, "count"); in readXml() 116 + " no count at " + parser.getPositionDescription()); in readXml() 117 XmlUtils.skipCurrentTag(parser); in readXml() 122 String schemeVersionStr = parser.getAttributeValue(null, "schemeVersion"); in readXml() 127 + parser.getPositionDescription()); in readXml() 134 int pos = readCertsListXml(parser, readSignatures, signatureList, count, false, builder); in readXml() 140 + " <cert> entries" + parser.getPositionDescription()); in readXml() 153 private int readCertsListXml(XmlPullParser parser, ArrayList<Signature> readSignatures, in readCertsListXml() argument 159 int outerDepth = parser.getDepth(); in readCertsListXml() [all …]
|
/frameworks/base/core/java/android/preference/ |
D | GenericInflater.java | 247 public T inflate(XmlPullParser parser, P root) { in inflate() argument 248 return inflate(parser, root, root != null); in inflate() 269 XmlResourceParser parser = getContext().getResources().getXml(resource); in inflate() local 271 return inflate(parser, root, attachToRoot); in inflate() 273 parser.close(); in inflate() 298 public T inflate(XmlPullParser parser, P root, in inflate() argument 301 final AttributeSet attrs = Xml.asAttributeSet(parser); in inflate() 308 while ((type = parser.next()) != parser.START_TAG in inflate() 309 && type != parser.END_DOCUMENT) { in inflate() 313 if (type != parser.START_TAG) { in inflate() [all …]
|