diff options
| author | Daisuke Miyakawa <dmiyakawa@google.com> | 2009-08-23 10:01:32 +0900 |
|---|---|---|
| committer | Daisuke Miyakawa <dmiyakawa@google.com> | 2009-08-25 15:39:06 +0900 |
| commit | f4ddea769098e24a7316b9ee895d323005433c2c (patch) | |
| tree | b3397a8bd06d6d499bf089c2ea0aa5457e43b385 /core/java/android/syncml/pim | |
| parent | 2e951b5511750ebfbba28263ee5384bfa7f45128 (diff) | |
| download | frameworks_base-f4ddea769098e24a7316b9ee895d323005433c2c.zip frameworks_base-f4ddea769098e24a7316b9ee895d323005433c2c.tar.gz frameworks_base-f4ddea769098e24a7316b9ee895d323005433c2c.tar.bz2 | |
Refactor VCard handling code, phase 2, 3, 4, 5
Phase 2
Make VCard Importer use Data structures in ContactsContract instead of
using old Conatacts structure.
Phase 3
Developed VCardComposer, which was originally in Contacts package, but
now in base/core/java. Also made it use queryEntries() as per jsharkey's
suggestion.
Phase 4
Added VCardUtils and moved some common methods to it, some of which should be
in public API, but hidden for now.
Phase 5
Made VCardComposer emits (almost) valid vCard 3.0 data.
Confirmed with vCard data emitted by Mac.
Related issue:
1784580, 1728351, 1967349
Note:
Probable next step:
- Add "fast parse" mode in VCradBuilder, in which, VCardBuilder skip parsing the value of
each property. It will make the parsing faster.
-- Note that parsing the parameters of each entry cannot be skipped, since it may contains
the information about Encoding of the property. In other words, if the line is
in Quoted-Printable format, the next line may be the part of the property, not a
separated property, which should be parsed accordingly.
- Needs test
Diffstat (limited to 'core/java/android/syncml/pim')
| -rw-r--r-- | core/java/android/syncml/pim/vcard/VCardDataBuilder.java | 6 | ||||
| -rw-r--r-- | core/java/android/syncml/pim/vcard/VCardParser.java | 1 |
2 files changed, 5 insertions, 2 deletions
diff --git a/core/java/android/syncml/pim/vcard/VCardDataBuilder.java b/core/java/android/syncml/pim/vcard/VCardDataBuilder.java index a0513f1..f2a2733 100644 --- a/core/java/android/syncml/pim/vcard/VCardDataBuilder.java +++ b/core/java/android/syncml/pim/vcard/VCardDataBuilder.java @@ -28,6 +28,7 @@ import android.syncml.pim.PropertyNode; import android.syncml.pim.VBuilder; import android.syncml.pim.VNode; import android.syncml.pim.VParser; +import android.text.TextUtils; import android.util.CharsetUtils; import android.util.Log; @@ -403,7 +404,10 @@ public class VCardDataBuilder implements VBuilder { String targetCharset = CharsetUtils.nameForDefaultVendor(paramMap.getAsString("CHARSET")); String encoding = paramMap.getAsString("ENCODING"); - if (targetCharset == null || targetCharset.length() == 0) { + Log.d("@@@", String.format("targetCharset: \"%s\", encoding: \"%s\"", + targetCharset, encoding)); + + if (TextUtils.isEmpty(targetCharset)) { targetCharset = mTargetCharset; } diff --git a/core/java/android/syncml/pim/vcard/VCardParser.java b/core/java/android/syncml/pim/vcard/VCardParser.java index 6dad852d..9a590dd 100644 --- a/core/java/android/syncml/pim/vcard/VCardParser.java +++ b/core/java/android/syncml/pim/vcard/VCardParser.java @@ -17,7 +17,6 @@ package android.syncml.pim.vcard; import android.syncml.pim.VDataBuilder; -import android.syncml.pim.VParser; import android.util.Config; import android.util.Log; |
