Commit Graph

40 Commits

Author SHA1 Message Date
Daisuke Miyakawa
629f94fac7 am ccc214b2: Merge change I6a0b14bd into eclair
Merge commit 'ccc214b21edaaddf46960388ec4d3e3ca89a01ae' into eclair-mr2

* commit 'ccc214b21edaaddf46960388ec4d3e3ca89a01ae':
  Make VCardComposer create the instance for mHandlerList.
2009-10-06 10:53:52 -07:00
Daisuke Miyakawa
0dd32c1b27 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.
2009-10-06 09:30:20 -07:00
Daisuke Miyakawa
71f97ac828 Add cancel() VCardDataBuilder, which is intended to remove
a false alerm "Nested VCard code is not supported now." when
importing vCard 3.0 file.

Internal Issue number: 2158261
2009-10-05 13:55:35 -07:00
Fred Quintana
c868acf442 show events in the UI 2009-09-30 21:29:33 -07:00
Daisuke Miyakawa
1f7c409edc Make ContactStruct handle Collection properly.
Internal Issue number: 2157922
2009-09-30 14:25:48 -07:00
Daisuke Miyakawa
30a2e36754 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...)
2009-09-30 10:52:27 -07:00
Costin Manolache
3348f14b3d Remove GAIA string 2009-09-29 22:52:05 -07:00
Daisuke Miyakawa
a2ba9a1999 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
2009-09-29 13:59:01 -07:00
Daisuke Miyakawa
f2e0d7bb78 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
2009-09-28 16:44:13 -07:00
Daisuke Miyakawa
21ac410319 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
2009-09-25 13:30:23 -07:00
Fred Quintana
91a00d3a42 fix typo 2009-09-24 16:45:37 -07:00
Fred Quintana
f580841526 rename misc to birthday 2009-09-24 16:39:17 -07:00
Daisuke Miyakawa
ccca121ecd Add "TYPE=" to type attribute when appropriate.
Internal issue number: 2142140
2009-09-24 15:52:40 -07:00
Daisuke Miyakawa
7497b78c56 Add appendType() utility method.
Some fix toward coll history related code is included.
2009-09-24 14:41:23 -07:00
Daisuke Miyakawa
f2bed60bd4 Add final to appropriate variables. 2009-09-24 13:24:07 -07:00
Daisuke Miyakawa
b55e60e1d8 Fix vCard code. 2009-09-24 13:11:20 -07:00
Lixin Yue
c3eef96b70 Add call log support to pim.vcard.VCardComposer
Change-Id: I6573b22aa42d60720b93d0f4c3b03fb8213208f2
2009-09-24 11:03:31 -07:00
Daisuke Miyakawa
de26b54bb6 Make ContactStruct explicitly set RawContacts.ACCOUNT_NAME and RawContacts.ACCOUNT_TYPE to null.
Contacts app's EditContactActivity now explicitly set those to null, so I thought vCard importer
also shold do so.

Internal issue number: 2141766

TODO:
Contacts app's side should be also modified to completely fix the issue above.
2009-09-23 18:11:09 -07:00
Daisuke Miyakawa
c32897a6ea Suppress Performance log emitted by vCard importer. 2009-09-22 22:22:34 -07:00
Daisuke Miyakawa
7a9e2f20af Add Website.TYPE information.
Related internal issue number: 2131626
2009-09-22 21:51:40 -07:00
Daisuke Miyakawa
5fd2ae90d3 Add each contact in vCard into "My Groups" if account is for Google's and it has such a group.
This fix should be temporal. Should be fixed in the near future.

Internal issue id: 2126265
2009-09-17 18:40:03 -07:00
Daisuke Miyakawa
d5bc296d94 Make vCard importer code use Account information if possible.
Internal isssue: 2116216, 2102720
2009-09-15 19:28:40 -07:00
Jeff Sharkey
6ba23c59f2 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.
2009-09-09 23:05:34 -07:00
Daisuke Miyakawa
718eaff0fa 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.
2009-09-07 22:14:08 +09:00
Dmitri Plotnikov
ceb7979636 [Issue 2087123] Suppressing all exception when trying to load a photo for the in-call UI 2009-09-02 19:13:58 -07:00
Daisuke Miyakawa
f75c94f7a9 Make vCard composer handle null of Photo entry correctly.
Internal bug id: 2088922
2009-09-01 07:17:20 +09:00
Daisuke Miyakawa
ee0e24c105 Use Email.TYPE_MOBILE 2009-09-01 05:36:34 +09:00
Daisuke Miyakawa
f4ddea7690 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
2009-08-25 15:39:06 +09:00
Ken Shirriff
1ce2e2e78d Fix recurrence parsing for all-day events.
The doozer server requires P1D instead of P86400S for all-day events.

bug=1594638
2009-08-21 14:37:25 -07:00
Dmitri Plotnikov
3c513ed95c Converting CallerInfo to new Contacts API. 2009-08-19 16:31:01 -07:00
Daisuke Miyakawa
7674b81a05 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
2009-07-17 07:50:00 -07:00
Ken Shirriff
3b95f53789 Changes for new sync.
Add ContentValues-based RecurrenceSet processing.
Add test stub needed by SSL caching.
2009-07-06 10:45:38 -07:00
Eric Fischer
5bd644caf7 Start using CLDR for some date-and-time strings and formats.
Use java.text.DateFormat where possible, since that is already using
the CLDR data for the things it supports.  Remove an unused date format
object from DatePickerDialog.

Add a new method for getting the standalone month names from applications,
although @hidden for now because it is an API change.

Pass the standalone month names down to native code in Time so that
tztime's strftime() can use them.

And then the bulk of the change: replace all the names for the months
and the days of the week, and AM and PM, and yesterday, today, and tomorrow,
with strings from CLDR.  And replace several of the date format strings
with ones derived from CLDR, but reformatted to use strftime() style
instead of SimpleDateFormat style.

All these resource changes go into new donottranslate-cldr.xml files
and are removed from strings.xml so that they aren't part of the
normal translation process and the translators don't have to bother
with them (and risk messing them up).
2009-05-15 10:15:50 -07:00
The Android Open Source Project
9066cfe988 auto import from //depot/cupcake/@135843 2009-03-03 19:31:44 -08:00
The Android Open Source Project
d83a98f4ce auto import from //depot/cupcake/@135843 2009-03-03 18:28:45 -08:00
The Android Open Source Project
076357b856 auto import from //depot/cupcake/@132589 2009-03-03 14:04:24 -08:00
The Android Open Source Project
3dec7d563a auto import from //depot/cupcake/@137055 2009-03-02 22:54:33 -08:00
The Android Open Source Project
da996f390e auto import from //branches/cupcake/...@131421 2009-02-13 12:57:50 -08:00
The Android Open Source Project
f013e1afd1 Code drop from //branches/cupcake/...@124589 2008-12-17 18:05:43 -08:00
The Android Open Source Project
54b6cfa9a9 Initial Contribution 2008-10-21 07:00:00 -07:00