History log of /frameworks/base/core/java/android/pim/vcard/VCardParser_V21.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
69831d9dc16c1d36739328910e5d7c0fb7d327fe 02-Sep-2010 Daisuke Miyakawa <dmiyakawa@google.com> VCard refactoring backport.

Change-Id: Icf265ce7f83c1e2bd5db0c3d9bd4c142afd6db34
/frameworks/base/core/java/android/pim/vcard/VCardParser_V21.java
50c6668a279f54430862240edf150a840eae7247 18-Jan-2010 Daisuke Miyakawa <dmiyakawa@google.com> Make vCard importer support lower case params.

Bug: 2339066
/frameworks/base/core/java/android/pim/vcard/VCardParser_V21.java
9030dd125a18bcf630c784d695a6d5ee132a7081 13-Jan-2010 Daisuke Miyakawa <dmiyakawa@google.com> Handle null correctly.

Bug: 2353544
/frameworks/base/core/java/android/pim/vcard/VCardParser_V21.java
a750fdd765ec253ffa8bf3d4848d5c3a35e1979b 20-Nov-2009 Daisuke Miyakawa <dmiyakawa@google.com> Fix a problem in which Android custom fields are not emitted correctly in non-Ascii languages.

Internal issue number: 2195990
/frameworks/base/core/java/android/pim/vcard/VCardParser_V21.java
49c0decf46d4f7082a17e595fba2c501a8369452 18-Nov-2009 Daisuke Miyakawa <dmiyakawa@google.com> Code clean up.

Internal issue number: 2195990
/frameworks/base/core/java/android/pim/vcard/VCardParser_V21.java
d2145b97fb6d5eb4ef0f746869e9390e5a6853d6 17-Nov-2009 Daisuke Miyakawa <dmiyakawa@google.com> Clean up codes and remove/modify stale codes/comments.

Internal issue number: 2195990
/frameworks/base/core/java/android/pim/vcard/VCardParser_V21.java
1b9e2bec6381ac7e7d0cfe0db549c5396d2ba7ce 17-Nov-2009 Daisuke Miyakawa <dmiyakawa@google.com> Split vCard composer into two parts: VCardComposer and VCardBuilder.

As for VCardBuilder, there was a class with the same name, but this implementation is fundamentally different.
This time, VCardBuilder is like StringBuilder. It enables developers to create their own vCard by themselves.

Make Constants public and rename it to VCardConstants.

Internal issue number: 2242528, 2195990
/frameworks/base/core/java/android/pim/vcard/VCardParser_V21.java
5a1f2d2de026b582fbe8b1a46a83ad33760a2c48 16-Nov-2009 Daisuke Miyakawa <dmiyakawa@google.com> Rename several files so that readers would not be confused.

Add unit tests around Phone-number handling and fix some bugs.

Internal issue number: 2195990
/frameworks/base/core/java/android/pim/vcard/VCardParser_V21.java
0e983864fca215513de9664573dcc3bbadf41e79 09-Nov-2009 Daisuke Miyakawa <dmiyakawa@google.com> Support vCard format emitted by Windows Mobile 6.5, which contains invalid "VALUE" params and
"AGENT" line.

Internal Issue number: 2247192
/frameworks/base/core/java/android/pim/vcard/VCardParser_V21.java
344416e8349db9748cdb468146f09e4e2b33c4cb 07-Nov-2009 Daisuke Miyakawa <dmiyakawa@google.com> Make vCard parser invalid lines in vCard file which look like some comment.

e.g. "# Comment?"

In both vCard 2.1 and vCard 3.0, this syntax is never allowed, but some actual exporter seems to emit this kind of comment sometimes.

Both vCard 2.1 and vCard 3.0 allows some property to use multiple lines, so this change may cause another problem.
For example, if the "NOTE" property uses Quoted-Printable type, has several lines, and one of the lines starts with '#', we cannot know whether the line is "comment" or not.
Fortunately, in this change, the line is parsed as part of "NOTE" property, so I think there's no problem "right now", which does not mean that it is completely fine with vCard files Android will encounter in the future.

Internal issue number: 2245363
/frameworks/base/core/java/android/pim/vcard/VCardParser_V21.java
ba2b21bee817c58e9b22c57e02ef6201e1cda1bd 12-Oct-2009 Daisuke Miyakawa <dmiyakawa@google.com> Implement unit tests for vCard exporter, which depends on the sucess in vCard importer.

In order to share the logic between tests for importer and those for exporter,
PropertyNodesVerifier is now a separated class and drastically modified.
Now the class accept "unordered" expected PropertyNode objects, which allows vCard
composer to not care the exact order of each elements.

MockCursor is added, which may be added into the public API in the future, but in
the test directory for now.
Another MockContentProvider is (temporarily) developed so that it can be accepted by
MockContentResolver#addProvider(), which does not allow IContentProvider and its
descendants but only exact ContentProvider, while the original MockContentProvider in
android.test.mock.MockContentProvider implements IContentProvider.

The test development is still on-going, but this test suffices minimal requirement of
vCard tests.

Internal issue number: 2160039
/frameworks/base/core/java/android/pim/vcard/VCardParser_V21.java
021de736237f6d408d61c1c4f884f98125cc081a 09-Oct-2009 Daisuke Miyakawa <dmiyakawa@google.com> Clean-up vCard code.

Note that refactor is still on-going. Some changes done now may be
reverted in the future.

- Move reusable constants from VCardComposer to Constants.
- Make ContactStruct appropriately refers to Constants.
- Move PBAP-related code at the bottom of vCard composer
- Remove some redundant code.

Internal issue number: 2160039
/frameworks/base/core/java/android/pim/vcard/VCardParser_V21.java
5a016488da5ff6c1ecdff0b1febd836cc1711531 09-Oct-2009 Daisuke Miyakawa <dmiyakawa@google.com> Merge commit 'refs/changes/08/29008/8' of ssh://dmiyakawa@android-git.corp.google.com:29418/platform/frameworks/base into cleanup_import

Conflicts:

core/java/android/pim/vcard/ContactStruct.java
5c3e687965a49e4e54196a049337544a6eed61d9 06-Oct-2009 Daisuke Miyakawa <dmiyakawa@google.com> Develop ContentResolver-based unit tests for vCard importer and fix vCard code
along with the tests

Make test code not only check the validity of VCardParser but also check
the validity of the data insertion part of ContactStruct class, using
MockContentResolver/MockContentProvider. With these tests, we are now really sure
vCard side appropriately sends vCard data into the resolver.

Fix ContactStruct so that it properly handles ORG property and TITLE property,
though it still does not see Group information. There's no vCard found which
uses Group and ORG and TITLE in convolted orders...

e.g. Current implementation misinterprets the following case, but we're not sure
whether any exporter emits data in this kind of complicated form...
group2.ORG:ComparyA
group1.ORG:CompanyB
group1.TITLE:TitleForA
group2.TITLE:TitleForB

Expected: CompanyA + TitleForA, CompanyB + TitleForB
Actual: CompanyA + TitleForB, CompanyB + TitleForA

Also change the parser part a little, so that some component can be reused via
the other part of vCard code.

Added several additional files for the tests, which ensures that
- ORG/TITLE properties are handled as we expect.
- PREF is appropriately handled and passed to the resolver as "IS_PRIMARY" flag.
-- We discarded the code which ensures that "IS_PRIMARY" is added to only one
field in each type, after the local discussion (the duplication or no primary
state should be handled by the resolver).

Internal Issue number: 2160039
/frameworks/base/core/java/android/pim/vcard/VCardParser_V21.java
f4ddea769098e24a7316b9ee895d323005433c2c 23-Aug-2009 Daisuke Miyakawa <dmiyakawa@google.com> 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
/frameworks/base/core/java/android/pim/vcard/VCardParser_V21.java
7674b81a05a8aa0b7a1be1bb04e041f6d2106fe2 09-Jul-2009 Daisuke Miyakawa <dmiyakawa@google.com> Refactor VCard-related code.

Move VCard code from android/syncml/pim to android/pim since the code is not
related to SyncML at all; Previous code was misplaced, I suppose.

Reorganize "Builder" structure:
Create VCardBuilderBase.java as a base class for "Builder" classes.

Separate VCardDataBuilder to several components.
Now, VCardBuilder is able to accept EntryHandlers (interface) which handle each VCard entry.
Add EntriCommitter and ProgressShower as ones of EntryHandler implementations.

Stop using VNode/PropertyNode in the actual importing path. Instead, VCard importer directly
creates ContactStruct object.

PropertyNode is still used in test codes, since it does not drop any kind of information
while ContactStruct does.

All codes are made hidden (with package.html) like the files in syncml directory;
These files are only for Contacts app.

Issue
- due to internal issue 1975498, any performance test cannot be conducted.

Next todos
- Add tests for ContactStruct.
- remove android/syncml directory.
- Rename several methods; old names are based on V??? structure, which does not make sense in the current code.
- Use ContentProviderOperation instead of relying on beginTransaction()/endTransaction().
- Use ContactsContact in Eclair

Related internal issues
- 1784580, 1728351
/frameworks/base/core/java/android/pim/vcard/VCardParser_V21.java