48dd8e86a81d2ab40eb762975c8211c225002bf0 |
|
22-Mar-2011 |
Daisuke Miyakawa <dmiyakawa@google.com> |
Tolerate nested vCard. vCard 2.1 requires to handle nest (or grouping) while our parser has not supported it well. One support we have had is ignoring top element when FLAG_TORELATE_NEST is specified, which isn't appropriate. e.g. BEGIN:VCARD X-VENDER-SPECIFIC-META-INFO:XXXX ... BEGIN:VCARD (Actual content) END:VCARD END:VCARD This change lets the vCard lib import nested vCard. One problem around handling the case above is that, after having this change, we'll get two vCard elements instead of one, as the top element isn't ignored on parser level any more, while we don't want the top-level data. To solve the problem, this change also makes vCard importer ignore such empty data. This changes just flattens nested vCard. Caller needs to take care of grouping/nest case using VCardEntry#getChildren() if it wants to support grouping feature. - introduce "children" into VCardEntry, which enables users to handle nested vCard on their side. - make vCard parsers accept nest cases. - make vCard interpreters handle nest cases. - make VCardEntry ignore empty data during constructing insert opertions. - make tests accept nest cases. - add additional test cases for verifying more details. - add debug string capability. - remove codes for performance measurement. Bug: 4066223 Change-Id: Id8af659c2cc0bb0db59c8de239d9d95e9d440089
/frameworks/opt/vcard/java/com/android/vcard/VCardEntryHandler.java
|