summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Performance: Fix importing vcard slowly problemHEADreplicant-6.0-0004-transitionreplicant-6.0-0004-rc6replicant-6.0-0004-rc5-transitionreplicant-6.0-0004-rc5replicant-6.0-0004-rc4replicant-6.0-0004-rc3replicant-6.0-0004-rc2replicant-6.0-0004-rc1replicant-6.0-0004replicant-6.0-0003replicant-6.0-0002replicant-6.0-0001stable/cm-13.0-ZNH5Ystable/cm-13.0-ZNH2KBstable/cm-13.0-ZNH2Kstable/cm-13.0-ZNH0Ecm-13.0blong2015-10-061-1/+6
| | | | | | | Enlarge the batch size to reduce db times and save importing time. Change-Id: Ic5e259abeefb2081d454d7444ff94a456cea7419 CRs-Fixed: 875712
* vcard: Add support to generate vcard jar.Shashank Mittal2015-10-061-0/+11
| | | | | | Add support to generate vcard jar. Change-Id: I7a7ccac4c5f348b406c64b5f9d745427bb2b18c0
* Save away unknown properties that begin with X-.Rakesh Iyer2015-04-091-0/+12
| | | | | | | | | | | | | | PBAP sends over call logs using the vcard format and uses the X-IRMC-DATETIME property to add in the timestamp of the calls. The current VCardEntry drops entries that are not recognized, and since these aren't recongized, they are dropped. Given that X- properties can be anything, this change saves them away in a list that the caller can check and parse if they desire to do so. Change-Id: Iece345cc5b1f0ac3b7c8fbc29c78cc4deff11b22
* Add "get contact id and raw contact uri" callbackRicky Wai2015-03-171-5/+54
| | | | | Bug: 19551325 Change-Id: Iac18e5015fe78145551d7a60a17446a4a38b3be7
* Fix import of iOS vcardsJay Shrauner2014-07-234-72/+175
| | | | | | | | Fix handling of multiline data blocks in v3.0 vcards with \r\r\n line terminators. Bug:16433675 Change-Id: I77c7c94fa1b13e18e53459e94c3c73ad53b7d8e2
* am 2ce674dd: am 7f72d2dd: Can\'t send my wife\'s vcard between devicesTom Taylor2014-04-080-0/+0
|\ | | | | | | | | * commit '2ce674dd8b76a6248463107f8e9d69b054097f7f': Can't send my wife's vcard between devices
| * am 7f72d2dd: Can\'t send my wife\'s vcard between devicesTom Taylor2014-04-083-1/+76
| |\ | | | | | | | | | | | | * commit '7f72d2dd76a6b95ff11411a62fa1329ca68edc9d': Can't send my wife's vcard between devices
| | * Can't send my wife's vcard between devicesTom Taylor2014-04-073-1/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug 13751984 If X-ANDROID-CUSTOM follows a photo's hex data, that line will get included as part of the photo data and will cause Base64.decode() to throw an exception. The code that gathers the hex data needs to finish if it sees X-ANDROID-CUSTOM. Added a test case to test this "bad" vcard. Change-Id: Ie60a1d09354a9c8a9dab603da01e9c7aff5eb070 (cherry picked from commit a326bcbb665b08f5c20122616452c6e3be8389ac)
* | | Can't send my wife's vcard between devicesTom Taylor2014-04-043-1/+76
|/ / | | | | | | | | | | | | | | | | | | | | Bug 13751984 If X-ANDROID-CUSTOM follows a photo's hex data, that line will get included as part of the photo data and will cause Base64.decode() to throw an exception. The code that gathers the hex data needs to finish if it sees X-ANDROID-CUSTOM. Added a test case to test this "bad" vcard. Change-Id: Ie60a1d09354a9c8a9dab603da01e9c7aff5eb070
* | Merge "This code hasn't used CharsetUtils since 2011. Time to let it die."Elliott Hughes2013-09-253-70/+0
|\ \ | |/ |/|
| * This code hasn't used CharsetUtils since 2011. Time to let it die.Elliott Hughes2013-09-243-70/+0
|/ | | | Change-Id: I4ca551fc6bb7dac5c7fa4efd89448e0db9c78849
* am 7a2ac040: Store encoding in upper case.Chiao Cheng2012-11-141-8/+7
|\ | | | | | | | | * commit '7a2ac0405decebde94bb4e3a139d62162e6e15a0': Store encoding in upper case.
| * Store encoding in upper case.Chiao Cheng2012-11-121-8/+7
| | | | | | | | | | | | | | Instead of checking for up case each time or using equalsIgnoreCase. Bug: 7292017 Change-Id: I3954a2e0fdb757d157bcf3dff77ed2749a9577d8
* | am 8aa2ab8a: Allow importer to handle missing encoding attribute for FN.Chiao Cheng2012-11-120-0/+0
|\| | | | | | | | | * commit '8aa2ab8a2f4284cdbc9392e8597ab6d4fd302c50': Allow importer to handle missing encoding attribute for FN.
| * Allow importer to handle missing encoding attribute for FN.Chiao Cheng2012-11-095-13/+66
| | | | | | | | | | | | | | | | - Removed separators from FN properties. - Adding fix on importer side since we cannot fix exporters that already exist. Bug: 7292017 Change-Id: I61c691c24828e63aac1920384e16461da7a03881
* | am d5a731fa: (-s ours) Fix missing encoding attribute on FN field.Chiao Cheng2012-11-090-0/+0
|\| | | | | | | | | * commit 'd5a731faf1f749ad7031c13ca5a8cdb516c79b72': Fix missing encoding attribute on FN field.
| * Fix missing encoding attribute on FN field.Chiao Cheng2012-11-083-38/+95
| | | | | | | | | | | | | | | | | | When FN field is built from display name, the encoding attribute is missing. Created common method to build N and FN fields so they will not be out of sync in the future. Bug: 7292017 Change-Id: I7faceb316b639d626a54bdd455df1e748b22face
* | Allow importer to handle missing encoding attribute for FN.Chiao Cheng2012-10-195-13/+66
| | | | | | | | | | | | | | | | - Removed separators from FN properties. - Adding fix on importer side since we cannot fix exporters that already exist. Bug: 7292017 Change-Id: I61c691c24828e63aac1920384e16461da7a03881
* | Fix missing encoding attribute on FN field.Chiao Cheng2012-10-153-38/+95
|/ | | | | | | | | When FN field is built from display name, the encoding attribute is missing. Created common method to build N and FN fields so they will not be out of sync in the future. Bug: 7292017 Change-Id: I7faceb316b639d626a54bdd455df1e748b22face
* Allowing multiline addresses to support microsoft vCard.cm-10.1-M1Chiao Cheng2012-08-243-57/+147
| | | | | | | | | | Multiline addresses are not allowed in vCard 2.1 but it has been encountered in microsoft mobile vCard. This adds support for this by checking the next line. If the next line contains a colon, we assume it's a new property. Otherwise, we assume it's a continuation. Bug: 5188556 Change-Id: I4607eda901a1d535c759b5026f6702eb47290cb8
* Making vcard photo parsing more robust to decode errors.Chiao Cheng2012-08-154-12/+43
| | | | | | | | Base64.decode throws IllegalArgumentException which is not handled and results in crash reports for users. Switching to VCardException which should have better UI handling. Change-Id: I3fa12b8a703c3eed181caade0bfda2271435b377
* Fix for malformed photo entry.Chiao Cheng2012-08-153-17/+90
| | | | | | | | | | | | Blackberry vcard photo entry is not terminated with standard vcard 2.1 terminator. The vcard code is suppose to handle this irregularity already but there was a bug where it would not work unless the next entry contained a ':' right after the property name (i.e. "END:VCARD"). Cases with next entries such as "TEL;TYPE=CELL:" was missed. Note the ":" is not right after TEL. Bug: 6979337 Change-Id: Ifa3dbb377b9da97ef7570c0f8eca8a1cb5e727a9
* 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