summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Handle "VOICE" type as OTHER on Androidjellybean-stablejellybeanDaisuke Miyakawa2011-11-282-9/+16
| | | | | | | | | | | | vCard's "VOICE" type is the default type used in the format, while OTHER is the default type on Android. Our exporter treats Android's OTHER type as vCard's "VOICE", while our importer accepts the default type "VOICE" as Android's CUSTOM type with "VOICE" label, which confuses users: when they transfer phone numbers with OTHER type those numbers become "VOICE" on receiver sides. Bug: 5600504 Change-Id: Id30d2ca9b67b81798565224b881a734e8ee76516
* Allow vCard users to format phone numbers by themselvesDaisuke Miyakawa2011-09-214-5/+72
| | | | | | Bug: 5348938 Bug: 4177894 Change-Id: Iff9461d8c71c5800b0731c3708867003d75bb395
* Add API for setting the raw contacts URI.Martijn Coenen2011-09-151-0/+20
| | | | | | | Needed for when we are building vcards for a profile contact. Bug: 5300714 Change-Id: Ib4adc54d525ffaffe4d8955f4ba894d1a315099d
* Bluetooth : Modify build & parse vcardinshik2011-08-245-21/+104
| | | | | | | | | If the contacts have "p"or "w" instead of "," or ";" when some carkits are receiving them from andro id OS, some catkits cannot parse the contacts. Bug: 5178723 Change-Id: I536ca57aff561fb0637448bcddfd53a6ba8b28ef
* Relax URI checking on VCardComposer.Martijn Coenen2011-06-211-2/+3
| | | | | | | URI may be extended with additional query parameters (e.g. user profile). Change-Id: Ie5ef1ca76709df26609960c12826668afb75ce21
* Make local variable for photo private.Daisuke Miyakawa2011-04-051-10/+9
| | | | | | | Need I2ef49fde19549da6515b6a7c9a6953fa8834cbaf Bug: 4066223 Change-Id: I75e87b66268b817b78d9a6f093872ddac9466ff2
* Merge "Add hashCode()."Daisuke Miyakawa2011-04-051-13/+155
|\
| * Add hashCode().Daisuke Miyakawa2011-04-041-13/+155
| | | | | | | | | | Bug: 4066223 Change-Id: I917761014753605ee06f53cbc6499ca9fe9a7956
* | Merge "Remove VCardInterpreterCollection"Daisuke Miyakawa2011-04-052-91/+9
|\ \
| * | Remove VCardInterpreterCollectionDaisuke Miyakawa2011-04-012-91/+9
| |/ | | | | | | | | Bug: 4066223 Change-Id: I712d35582bf054e70ad2406256a57a4ee1381905
* / Add parseOne() capability.Daisuke Miyakawa2011-04-018-166/+307
|/ | | | | Bug: 4066223 Change-Id: I1699dd073a3b9647a5654d3fea4a2963430599da
* Refactor codeDaisuke Miyakawa2011-03-3124-1758/+2529
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1) introduce VCardProperty and make use of it everywhere Previously we had had two structures for it: VCardParserImpl_V21.PropertyData and VCardEntry#Property. The former was for holding raw data for property, while the latter was for holding resultant (encoded) values. Apparently we can share same structure. To do so, we need to let VCardInterpreter pass the structure to interpreter side, instead of splitting them into smaller pieces by using several propertyXXX() calls. Thus this change introduces onPropertyCreated(VCardProperty) in lieu of propertyXXX(). Now vCard parser side is responsible for encoding Quoted-Printable, BASE64, and several charsets. Users are still able to do them manually by using VCardEntry#getRawValue(). 2) add better handling for data inside VCardEntry Now VCardEntry has so many fields that it is harder to iterate those data, while the iteration itself is common use case for it. At least three functionalities are now using iteration: toString(), isEmpty(), and constructInsertOperations(). This change introduces inner iterator functionality. VCardEntry.EntryElementIterator allows users to implement their own iteration logic. VCardEntry#iterateAllData(VCardEntry.EntryElementIterator) iterates all data inside VCardEntry and pass them into the inner iterator. 3) make VCardParser abstract class VCardParser should provide some utility functionality like VCardParser#getInstance(), while currently users have to choose one of inherited classes like VCardParser_V21, which is hindering encapsulation. Currently no external library implements VCardParser, so this change isn't so harmful. Bug: 4167593 Bug: 4066223 Change-Id: Ic6bb453cf733cf1de356789b36dd90521dceff56
* remove legacy code.Daisuke Miyakawa2011-03-313-205/+33
| | | | | | | | | | | | | - remove createOneEntryLegacy() - remove OneEntryHandler Should be after - I3c5a58fef5a404b992a3c17578eeb63518294231 - Ie1eb516a8163febd4438e19df5bc0892726942cb - Ie21c8966b0bb5b73b3afd18bfe7c142b523413c4 Bug: 4066223 Change-Id: Id623814e8f5961aaf9cf9b4dcc92f75ace401148
* am a07bb8c5: (-s ours) Use correct backReferenceIndex in postal addressesDaisuke Miyakawa2011-03-240-0/+0
|\ | | | | | | | | * commit 'a07bb8c56b732e319a3d2d48703d4b3c204ea2cc': Use correct backReferenceIndex in postal addresses
| * Use correct backReferenceIndex in postal addressesDaisuke Miyakawa2011-03-242-4/+3
| | | | | | | | | | | | | | DO NOT MERGE. Bug: 4167593 Change-Id: Ia656336a78e7424d7055a1c22b54fa8d13adc461
* | Tolerate nested vCard.Daisuke Miyakawa2011-03-2222-424/+836
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Merge "Use same TAG in vCard"Daisuke Miyakawa2011-03-1111-42/+40
|\ \
| * | Use same TAG in vCardDaisuke Miyakawa2011-03-1111-42/+40
| | | | | | | | | | | | | | | | | | | | | Tiny cleanups are included Bug: 4066223 Change-Id: I0b121e93ea5c624325d44b8aa6bab42d9a9a24fb
* | | replace newer composeOneEntry method with older one.Daisuke Miyakawa2011-03-102-9/+10
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apparently forcing users to use OneEntryHandler every time doesn't make sense. onInit()/onTerminate() capability can be implemented as users' preferance and shouldn't be mandatory. Just returning real vCard Strings would be more preferable. This breaks current API. We need additional modifications to three packages. - Ibaafdf4e0e1e01713b721d216102ae711db7ba74 - Icca2019b10fc84e437efbc2606cd5703b3ea0a5f - I2667a91d90b1ce985a354a5a37de75bb8156cff8 Bug: 4066223 Change-Id: I91b65f881e1712ecf82c2e119a92bc70c43c623c
* | Reorganize codes, especially around vCard composition.Daisuke Miyakawa2011-03-0826-120/+205
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - suppress misc warnings - stop using VCardException in vCard composer which has been used only in test context - add VCardComposer#createOneEntryNew(). I'm planning to replace this with old VCardComposer#createOneEntry() I don't understand why we have callback mechanism for this kind of simple stuff. I could have been better on this. - add some documentation - mark initWithRawContacsEntityUri() (introduced recently) as deprecated. That was not a good idea =( Bug: 4066223 Change-Id: Ib533a435cac3b4e4fa31527d02b0657fc4bd0377
* | Tiny refactoring, clean up.Daisuke Miyakawa2011-03-044-59/+140
| | | | | | | | | | | | | | | | | | | | | | - isolate test-related stuffs - suppress warning - let constructor accept ContentResolver, which is useful when test has custom ContentResolver apart from Context object. - prohibit multiple init() calls Change-Id: I0da5af56bf04e8eafbef376668a09002cb62d3f5
* | Make vCard available without hidden APIs.Daisuke Miyakawa2011-03-032-13/+29
|/ | | | | | | Must be with I4b529a8805b1b0e219c16e93242b102659e8f2e7 Bug: 3143497 Change-Id: I0f90270fb13d13f56b70a07638271b22a065cedd
* Refrain wrong Writer#flush() call.Daisuke Miyakawa2011-02-231-38/+13
| | | | | | | | | | | | | | | - We cannot rely on finilizer ordering: FileOutputStream may be released before HandlerForOutputStream - Writer#flush() call in finalizer may lock file system for a long time (10> secs), which will let the VM assume there is deadlock - Writer#flush() will be called from Writer#close() so we don't need to call it explicitly. - There's a race condition between VCardComposer.finalize() and FileOutputSteram.finalize() since they may be called concurrently. - Use CloseGuard for detecting missing terminate() call. Change-Id: I1ddcaf2c4564476e81dc67d3ec6ec1c947872a84
* Reduce the number of applyBatch() callDaisuke Miyakawa2011-02-162-47/+82
| | | | | Bug: 3435697 Change-Id: I89b13097638407cc700f2faafd201cc142e4f9e0
* Stop using private APIs as much as possible.Daisuke Miyakawa2011-02-096-32/+69
| | | | | | | | | | | | | | - remove CharsetUtils stuffs - remove private APIs in PhoneNumberUtils/TextUtils. We keep the hidden flag "Data.FOR_EXPORT_ONLY", so this code still needs access to private API. We don't remove it right now since we may still need it while we confirmed that the other stuffs are "ok" to be removed. Some more investigation will be needed in the future to remove the flag. Bug: 3143497 Change-Id: I074a7798d2208c3e14a524bd5f307a91ac50f735
* Let the lib use properties in 4.0 rev 15Daisuke Miyakawa2011-01-233-21/+31
| | | | Change-Id: I048614aef9ec32cb124d057693dfe6d037a2223e
* Handle a case BASE64 doesn't contain two CRLFsDaisuke Miyakawa2011-01-106-5/+115
| | | | | | | | | Although BASE64 must contain two CRLFs at its end, sometimes we encounter the case where it doesn't. This change handles it if possible. Bug: 3330767 Change-Id: Ibe2be216a25fe1047034be1fdb17bb5d35ed1b5f
* Handle custom labels correctly.Daisuke Miyakawa2010-11-174-41/+97
| | | | | | | | | | Previous implementation uses upper-case strings instead of original expressions in vCard, so "X-Custom" becomes the custom type "CUSTOM" Add test case for this fix. Bug: 3207011 Change-Id: I287fd595a80453e18b2bb57600ea8d0bd8b78ffd
* Suppress inappropriate log around VCardBuilder.Daisuke Miyakawa2010-11-161-4/+7
| | | | | | | | | No primary/subprimary ContentValues just means there's no ContentValues with StructuredName in a given list, so the log tells completely wrong message to us. Bug: 3202342 Change-Id: I5a151e850fad9335f2396cfd9edf0750e64462d4
* Add logs to track the parser behavior.Daisuke Miyakawa2010-11-031-0/+2
| | | | | Bug: 3159855 Change-Id: Idee28c6cfb05bab0079aa755f402843da3d746bd
* Remove dependency toward org.apache.commons.codec.net.Daisuke Miyakawa2010-10-281-4/+43
| | | | | Bug: 3143497 Change-Id: Ibef852372875e5762576899bbcc61c37c8fd9331
* Modify vCard importer/exporter around sip handlingDaisuke Miyakawa2010-09-215-22/+82
| | | | | Bug: 2985401 Change-Id: I8216dd80bcb09669be807dd92452e69fe2a11a65
* Add RAW_CONTACT_ID for refraining NPE.Daisuke Miyakawa2010-09-151-0/+2
| | | | | BUg: 3004082 Change-Id: I4eda4b6ca019141091c422e81c02a2abc314b0b3
* Add FLAG_REFRAIN_IMAGE_EXPORT support.Daisuke Miyakawa2010-09-132-3/+13
| | | | | Bug: 2603200 Change-Id: I033a195e1d6860dda149eae14f81f1e02a73b200
* Fix TEL type support.Daisuke Miyakawa2010-09-082-29/+86
| | | | | | vCard 4.0 says it "is" URI, while it is phone number in vCard 3.0. Change-Id: I4533c6a013e3dc8fdd8d5bcae2f7fb55300039dc
* Make vCard importer for 2.1 remove "sip:" at the top of address.Daisuke Miyakawa2010-09-083-4/+14
| | | | Change-Id: Ifba934d2c0458f20ed23b315ffa17f5838fd284a
* Add import/export support for SIP with vCard 2.1.Daisuke Miyakawa2010-09-084-0/+41
| | | | | | | | There's no regitimate field, so X-SIP is used. Maybe there are other properties available for SIP. Bug: 2969777 Change-Id: Ib085d39488e38d4090b6eb8003a00842831c3a53
* Add SIP export support for vCard 3.0 and 4.0.Daisuke Miyakawa2010-09-085-35/+109
| | | | Change-Id: I5adc7d375b79c8ae9671938c78f9bdc57075aa28
* Add SIP support for vCard 3.0.Daisuke Miyakawa2010-09-045-12/+59
| | | | Change-Id: I48b7057dc802c37936e31fbe95798af6b2c06a5b
* Fix vCard importer so that it imports IM correctly.Daisuke Miyakawa2010-08-245-9/+35
| | | | | Bug: 2944990 Change-Id: I9aba68f03569b9288c4286b73bf3e4e4b84e6d1a
* Add tests for vCard 4.0 and fix some of existing logics.Daisuke Miyakawa2010-08-236-102/+372
| | | | | Bug: 2794181 Change-Id: I1cd8550f0ff096a2acb12fcc41dc7235251b09ea
* Add tests for vCard 4.0.Daisuke Miyakawa2010-08-236-35/+161
| | | | Change-Id: I29b26d9bc661238404de2e9d9bdfebf9035e05ed
* Misc fix for vCard testing.Daisuke Miyakawa2010-08-217-6/+149
| | | | | | | | | | - Add VCardTestRunner - Make AndroidManifest aware of newly added VCardTestRunner - Move VCardTestBase to test_utils as it is part of testing utility - Add VCardTestUtilsTests, confirming test utility correctly fails when the test should fail. Change-Id: I593912ce9e664e9346d6f567ccf75f8afc47f9a5
* Make vCard 4.0 parser support SORT-AS parameter.Daisuke Miyakawa2010-08-2016-208/+379
| | | | | | | | Add unit test for it. Fix bugs in foundation classes.. Change-Id: I8b5ca1fd49ef3e729ec85429fb8110efde5091f1
* Fix foundation classes for vCard importer/exporter.Daisuke Miyakawa2010-08-208-107/+143
| | | | | | A lot of tests are not actually tested =( Change-Id: Iea873573e8aced9660be9bf8d7900d85c9c68380
* Make foundation classes public.Daisuke Miyakawa2010-08-196-6/+6
| | | | | | | | Without making public, runtime cannot see the classes and induces unexpected errors. Bug: 2832816 Change-Id: Ifaefaca9364eff9027cde78b0144c08219e8831e
* Code clean-up: remove warnings around TestCase usage.Daisuke Miyakawa2010-08-187-60/+54
| | | | | | | | We don't need TestCase object but need AndroidTestCase anyway, so verifiers accept AndroidTestCase object, which is often dropped silently. Change-Id: I9bd45dd1d2481ccc8b95e62ea62c5e014f1d7057
* Add a few tests confirming the behavior of vCard library.Daisuke Miyakawa2010-08-186-35/+53
| | | | | | | | | | | | | | | | Fix test code as it doesn't convert multi-byte params to UTF-8 properly. Modified the content of v30_commpa_separated.vcf, as the original intent of the file is not realistic (I've never seen this kind of complicated form). Also, without successfully parsing it, we torelate it. Added comma-separated-types cases instead , as this might be a bit more serious (a whole parse may fail due to this form of types). Change-Id: I1403e1c1d81d4325b25ad12ff143a76f0b9ab3a7
* Make vCard importer/exporter aware of multi-byte parameters.Daisuke Miyakawa2010-08-177-23/+195
| | | | | | | Based on the change Ic877940242d87ef918bf8d4dac601d37b296259b Bug: 2922186 Change-Id: Id4cd674a0565670023b7bb1010b21d8349dd4daa
* Rename a test file for comma-separated values in VALUE fields.Daisuke Miyakawa2010-07-136-7/+34
| | | | | | | Also add TODO for supporting the values. Bug: 2835996 Change-Id: I02c9d8735cee943e307fbbe75f0635bad636c396