History log of /frameworks/base/core/java/android/pim/vcard/VCardComposer.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
c86f0779d6aa60d7eb446fb33742dac6bfc3b6b8 20-Apr-2010 Daisuke Miyakawa <dmiyakawa@google.com> Make vCard allow users to refrain image export. Useful when
receivers cannot accept image data.

Bug: 2603200
Change-Id: I3c490b2de37ebb2780df4a27a440df3b0afacb3a
/frameworks/base/core/java/android/pim/vcard/VCardComposer.java
d5e4fdc8a4743abc0d9fe3cb952a78f9ad078c6b 31-Mar-2010 Fred Quintana <fredq@google.com> some changes due to an API review
- make EntityIterator extend Iterator and thus not throw a
RemoteException, instead converting it into a RuntimeException.
- rename ActiveSyncInfo to SyncInfo
- change getActiveSync to getCurrentSync
- remove the accessors in SyncInfo and instead make the final
fields publicly accessible
- made AbstractThreadedSyncAdapter.cancelSync not take a thread

Change-Id: I99fde5585bc5f1e95f4873ffbba189074a8d6372
http://b/issue?id=2553539
http://b/issue?id=2553541
http://b/issue?id=2553550
/frameworks/base/core/java/android/pim/vcard/VCardComposer.java
0dcb69292eb267258d122e0912810e4fd54c43b7 23-Feb-2010 Daisuke Miyakawa <dmiyakawa@google.com> Purge CallLog.
/frameworks/base/core/java/android/pim/vcard/VCardComposer.java
989edfde740b0dfddddba9782cced333624484dd 16-Feb-2010 Dmitri Plotnikov <dplotnikov@google.com> Fixing the use of entities in VCardExporter.

Bug: 2377678
Change-Id: I05768fd2ce28406b1fc32005343fa1eeaaecdd24
/frameworks/base/core/java/android/pim/vcard/VCardComposer.java
51e43a348158c343d6da4ff7bccf91de9bacdf42 15-Feb-2010 Daisuke Miyakawa <dmiyakawa@google.com> Add error handling codes into vCard composer.

Bug: 2377678
/frameworks/base/core/java/android/pim/vcard/VCardComposer.java
1301341f13fab2ced33a6f4dc0f0e8f609217105 04-Jan-2010 Daisuke Miyakawa <dmiyakawa@google.com> Fix test breakage in vCard exporter.

Due to the change Iae8dbac1, all tests for vCard exporeter has failed.
This change fixes the breakage by using a kind of dirty Dependency Injection.

Current test framework for vCard exporter strongly depends on the assumption that
ContentValues objects are able to be directly passed to objects which use
ContentResolver, while the change above disabled the feature by removing
queryEntities().

This change makes VCardComposer forcibly uses queryEntities() via Reflection.
I agree that this change is not so clean, but works fine for now.
/frameworks/base/core/java/android/pim/vcard/VCardComposer.java
2ec6c5699181316e5a5c2cd293c006ac4a8bb101 10-Dec-2009 Fred Quintana <fredq@google.com> am 328c0e79: - removed the concept of Entity from the ContentProvider APIs - removed the parcelling ability from Entity and EntityIterator and made them public - added an EntityIterator abstract implementation that allow easy wrapping of a Cursor - changed the VCard c

Merge commit '328c0e7986aa6bb7752ec6de3da9c999920bb55f' into eclair-mr2-plus-aosp

* commit '328c0e7986aa6bb7752ec6de3da9c999920bb55f':
- removed the concept of Entity from the ContentProvider APIs
/frameworks/base/core/java/android/pim/vcard/VCardComposer.java
a6d81e3ee4cf12ade1ef6701b5f1fcdd390fc98a 19-Nov-2009 Daisuke Miyakawa <dmiyakawa@google.com> Make vCard code refrain from using NEIGHBORHOOD field when importing.

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

Internal issue number: 2195990
/frameworks/base/core/java/android/pim/vcard/VCardComposer.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/VCardComposer.java
3d745c2b925ccc7c6591dbb3dfd21649782af991 16-Nov-2009 Daisuke Miyakawa <dmiyakawa@google.com> Make vCard composer use Base64 class for encoding String into bytes instead of using its own implementation.

Internal issue number: 2195990
/frameworks/base/core/java/android/pim/vcard/VCardComposer.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/VCardComposer.java
f05ec9237ec907be3f2c581a950149435bd585fb 13-Nov-2009 Jaikumar Ganesh <jaikumar@google.com> Update VCardComposer getOwnerPhoneNumberVcard() to support empty vcard for 0.vcf

Add check in getOwnerPhoneNumberVcard(). If the incoming phonenumber is empty,
do not add "TEL" to vcard data.

Manual merge from eclair branch
/frameworks/base/core/java/android/pim/vcard/VCardComposer.java
592988d307e8d305ca163c4e58da0fb350054194 12-Nov-2009 Daisuke Miyakawa <dmiyakawa@google.com> Add unit tests for Japanization and fix several bugs.

Internal issue number: 2195990
/frameworks/base/core/java/android/pim/vcard/VCardComposer.java
0cda59112526c03f3b8be0eb885926b7515df756 11-Nov-2009 Daisuke Miyakawa <dmiyakawa@google.com> Make vCard composer use ContentValues object with non-empty name unless the object is not marked as IS_SUPER_PRIMARY.

Previous change selected the first ContactValues object even when its name fields are all empty.
This time, vCard composer checks the name fields and skip the object withouth valid name.
One exception is the object with IS_SUPER_PRIMARY flag. If IS_SUPER_PRIMARY flag is set, the object will be
selected even when the object does not have valid name.

Add a unit test for this fix.

Internal issue number: 2252304
/frameworks/base/core/java/android/pim/vcard/VCardComposer.java
f2ad61c83da509270b8c5e9583b503ced928315d 10-Nov-2009 Daisuke Miyakawa <dmiyakawa@google.com> Make vCard exporter check invalid phone numbers and re-format them if needed.

Also add a unit test for the case.

Internal issue number: 2246410
/frameworks/base/core/java/android/pim/vcard/VCardComposer.java
4fe2c57c3c123dfd0c335b2390a661bcb7b546fb 05-Nov-2009 Daisuke Miyakawa <dmiyakawa@google.com> Add tests for Japanization part of vCard.

Fix several bugs around name construction.

Internal issue number: 2195990
/frameworks/base/core/java/android/pim/vcard/VCardComposer.java
f035b47774aabf7397aec5c5459ac9860ad63bab 04-Nov-2009 Daisuke Miyakawa <dmiyakawa@google.com> Make test compontent support multiple vCard input.

Internal issue number: 2195990
/frameworks/base/core/java/android/pim/vcard/VCardComposer.java
6cb76ac37f1b4a36d81db7d7e8652d82b6f1b8b5 03-Nov-2009 Daisuke Miyakawa <dmiyakawa@google.com> Rename the term "attribute"/"attr" to "parameter"/param".

We had been using "parameter"/"param" by mistake, while both vCard
formats uses theterm "attribute"/"attr". This is confusing.

Internal issue number: 2233884
/frameworks/base/core/java/android/pim/vcard/VCardComposer.java
f5633bc7e2fddbd1104d129b9d55d74fa8c2666b 28-Oct-2009 Daisuke Miyakawa <dmiyakawa@google.com> Fix test breakage in testNickNameV21().

Internal issue number: 2079082
/frameworks/base/core/java/android/pim/vcard/VCardComposer.java
837cba33c59ea4bb622878f77fc262436e01ce2b 27-Oct-2009 Daisuke Miyakawa <dmiyakawa@google.com> Add partial support of Android-specific properties.

In the near future, all the values which cannot be converted to
vCard property is expressed as "X-ANDROID-CUSTOM" property + MIME_TYPE.

Example (Nick name):
X-ANDROID-CUSTOM:vnd.android.cursor.item/nickname;Nicky;;;;;;;;;;;;;

All the data are stored ordered by its column name ("data1" - "data15").
Currently the code assumes the max num is 15.

Internal Issue number: 2079082
/frameworks/base/core/java/android/pim/vcard/VCardComposer.java
d263a064f7a77768c3e70a98f286960b67dc1aa5 27-Oct-2009 Daisuke Miyakawa <dmiyakawa@google.com> Add a test for vCard composer.

Also modify the behavior of vCard composer so that it honer FN than N toward
DISPLAY_NAME.

Internal issuen number: 2195990
/frameworks/base/core/java/android/pim/vcard/VCardComposer.java
99a0a2cd73503513891565a4aaf99e209bd262d2 14-Oct-2009 Daisuke Miyakawa <dmiyakawa@google.com> Add tests and fix vCard code.

Now, basic tests are almost ready.

TODO:
- importer test toward multiple vCard input (though it was tested with real usage)
- exporter tests for multiple composition
- tests with non-Ascii
- tests with special types like TYPE_DOCOMO

ISSUE:
In order to fully check the validity of exporter, we may have to develop
some vCard importer which rejects vCard which is valid but a kind of dubious.

Internal Issue Number: 2160039
/frameworks/base/core/java/android/pim/vcard/VCardComposer.java
7c6770c26ba819bcad3d9522e046f9d1fdf9e222 13-Oct-2009 Daisuke Miyakawa <dmiyakawa@google.com> Add the flag "FLAG_APPEND_TYPE_PARAM" to VCardConfig, which
enables vCard composer to append "TYPE=" to type param/attribute
everytime possible, which should fix the issue 2180800.

issue number: 2180800
/frameworks/base/core/java/android/pim/vcard/VCardComposer.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/VCardComposer.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/VCardComposer.java
0dd32c1b27947dc772cebd1b3229c796746150ef 06-Oct-2009 Daisuke Miyakawa <dmiyakawa@google.com> Make VCardComposer create the instance for mHandlerList.

Previously the creation was delayed until addHandler(), which
had been required to be called.

However, after VCardComoser's support toward PBAP stuffs,
the guarantee was not true any more.

So by creating the instance in constructor, we refrain NPE during
finalize() when PBAP uses VCardComposer.
/frameworks/base/core/java/android/pim/vcard/VCardComposer.java
c868acf442a69429056a574c67a5e0187e2b9536 01-Oct-2009 Fred Quintana <fredq@google.com> show events in the UI
/frameworks/base/core/java/android/pim/vcard/VCardComposer.java
30a2e36754fb2d26f699dfcd66064dfcb57cce50 30-Sep-2009 Daisuke Miyakawa <dmiyakawa@google.com> Fix vCard composer in three points.

- Make it allow composer users to emit Quoted-Printabled primary ("N", "FN", etc.) properties.
- Make it strictly check whether it is necessary for the composer to emit CHARSET infomation.
-- Added the logic "not vCard 3.0, or, CHARSET is not UTF-8".
- Clean up the code (again...)
/frameworks/base/core/java/android/pim/vcard/VCardComposer.java
a2ba9a199962eb1b14ac3e0aa0fbc4c557298c96 29-Sep-2009 Daisuke Miyakawa <dmiyakawa@google.com> Clean up vCard code.

With this change, the vCard composer does not emit any information
about CHARSET until it is really needed for parsing it (e.g. when
non-ascii chacacters are included in some value). This "may" be
effective toward external vCard importers which are not able to
understand non-ascii characters and CHARSET info itself.

Also now vCard composer does not use Quoted Printable until it is
really needed (e.g. until when the composer find non-"7bit"
characters are included in some value. "7bit" is defined in vCard 2.1,
which is "<7bit us-ascii printable chars, excluding CR LF>".

The vCard composer detects duplicate phone numbers, email addresses,
and remove them in default. The duplication would come from
aggregation done by the new ContactsProvider introduced in Eclair.
Even when two Accounts have two exactly same addresses, we cannot
ask ContactsProvider to exclude them since current implementation of
ContactsProvider2#queryEntities() does not acceps Contacts.CONTENT_URI
but only RawContacts.CONTENT_URI, which inevitably returns same
email addresses with different Accounts (ACCOUNT_NAME and ACCOUNT_TYPE
should be different. If not, the original contact itself should have
the duplication).

The vCard composer now detects null returned from queryEntities().
The null value is potentially harmful for vCard file, since it forces
the (old) vCard composer to emit meaningless line like "BDAY:".

Internal Issue number: 2150768, 2151954, 2154235
/frameworks/base/core/java/android/pim/vcard/VCardComposer.java
f2e0d7bb788ff04ebbe1ece2ecb806cbcf66fffd 28-Sep-2009 Daisuke Miyakawa <dmiyakawa@google.com> Three changes.

- Add FOR_EXPORT_ONLY to Data column.
- Make VCardComposer use Contacts instead of RawContacts.
- Make VCardComposer honor FOR_CONTACT_ONLY regardless of
the intention of any caller, which makes composer unable to
compose any contact with "is_restricted" flag, which is unseen
from outside the contacts provider.

Internal Issue number: 2147248, 2143207
/frameworks/base/core/java/android/pim/vcard/VCardComposer.java
21ac410319696f7ffd89074c286c29505ba4fca4 25-Sep-2009 Daisuke Miyakawa <dmiyakawa@google.com> Two changes toward vCard composer.

- Separate the two cases: mCursor == null and mCursor.getCount() == 0.
- Make error messages viewable from user applications, which enables them to
translate those messages.

Internal issue number: 2138187, 27103
/frameworks/base/core/java/android/pim/vcard/VCardComposer.java
91a00d3a421868ad06441f131eaca8fcbbbb4fa1 25-Sep-2009 Fred Quintana <fredq@google.com> fix typo
/frameworks/base/core/java/android/pim/vcard/VCardComposer.java
f5808415263d687eb125535e04ba374e33b785da 25-Sep-2009 Fred Quintana <fredq@google.com> rename misc to birthday
/frameworks/base/core/java/android/pim/vcard/VCardComposer.java
ccca121ecd880fbc36c7d307025fbc32d1c61af9 25-Sep-2009 Daisuke Miyakawa <dmiyakawa@google.com> Add "TYPE=" to type attribute when appropriate.

Internal issue number: 2142140
/frameworks/base/core/java/android/pim/vcard/VCardComposer.java
7497b78c561d4c7ad7626060219ec1767a5a69fa 24-Sep-2009 Daisuke Miyakawa <dmiyakawa@google.com> Add appendType() utility method.

Some fix toward coll history related code is included.
/frameworks/base/core/java/android/pim/vcard/VCardComposer.java
f2bed60bd4921bf71a9cf05b46f000f1cdb20af8 24-Sep-2009 Daisuke Miyakawa <dmiyakawa@google.com> Add final to appropriate variables.
/frameworks/base/core/java/android/pim/vcard/VCardComposer.java
b55e60e1d88c02078c3d6bc0f408fb0065a1e93c 24-Sep-2009 Daisuke Miyakawa <dmiyakawa@google.com> Fix vCard code.
/frameworks/base/core/java/android/pim/vcard/VCardComposer.java
c3eef96b701df3b6534092843bf251d828a1cb20 24-Sep-2009 Lixin Yue <L.X.YUE@motorola.com> Add call log support to pim.vcard.VCardComposer

Change-Id: I6573b22aa42d60720b93d0f4c3b03fb8213208f2
/frameworks/base/core/java/android/pim/vcard/VCardComposer.java
6ba23c59f24b443cd21c6289fa0aac3df8f17017 10-Sep-2009 Jeff Sharkey <jsharkey@android.com> Handle cases where TYPE can be undefined, such as EAS.

When TYPE not provided, assume a default value and check
that label isn't empty when CUSTOM is used.
/frameworks/base/core/java/android/pim/vcard/VCardComposer.java
718eaff0fadd999f488417fab1c05dca13ca0451 07-Sep-2009 Daisuke Miyakawa <dmiyakawa@google.com> Fix small bugs in VCardComposer.java.

- The logic for emitting "FN" is wrong.
- FileWriter's "double close" problem should occur in the current implementation.
- Let VCardParser_V31.java ignore AGENT field instead of throwing an unkind VCardNotSupportedException.
/frameworks/base/core/java/android/pim/vcard/VCardComposer.java
f75c94f7a9ff6fbc898162d3c9d94e8ac41dd778 01-Sep-2009 Daisuke Miyakawa <dmiyakawa@google.com> Make vCard composer handle null of Photo entry correctly.

Internal bug id: 2088922
/frameworks/base/core/java/android/pim/vcard/VCardComposer.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/VCardComposer.java