summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorDaisuke Miyakawa <dmiyakawa@google.com>2009-11-19 11:19:25 +0900
committerDaisuke Miyakawa <dmiyakawa@google.com>2009-11-19 11:21:39 +0900
commita6d81e3ee4cf12ade1ef6701b5f1fcdd390fc98a (patch)
treea94f4b51301fca3e002b9fbab6e304bfa9db2d26 /core
parentddd017f872bee40450c0e73dcf6608a9fdc49a05 (diff)
downloadframeworks_base-a6d81e3ee4cf12ade1ef6701b5f1fcdd390fc98a.zip
frameworks_base-a6d81e3ee4cf12ade1ef6701b5f1fcdd390fc98a.tar.gz
frameworks_base-a6d81e3ee4cf12ade1ef6701b5f1fcdd390fc98a.tar.bz2
Make vCard code refrain from using NEIGHBORHOOD field when importing.
Internal issue number: 2195990
Diffstat (limited to 'core')
-rw-r--r--core/java/android/pim/vcard/VCardComposer.java2
-rw-r--r--core/java/android/pim/vcard/VCardUtils.java17
2 files changed, 15 insertions, 4 deletions
diff --git a/core/java/android/pim/vcard/VCardComposer.java b/core/java/android/pim/vcard/VCardComposer.java
index 2037bc3..033ef89 100644
--- a/core/java/android/pim/vcard/VCardComposer.java
+++ b/core/java/android/pim/vcard/VCardComposer.java
@@ -58,10 +58,8 @@ import java.nio.charset.UnsupportedCharsetException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
-import java.util.HashSet;
import java.util.List;
import java.util.Map;
-import java.util.Set;
/**
* <p>
diff --git a/core/java/android/pim/vcard/VCardUtils.java b/core/java/android/pim/vcard/VCardUtils.java
index 885f7ba..80457bb 100644
--- a/core/java/android/pim/vcard/VCardUtils.java
+++ b/core/java/android/pim/vcard/VCardUtils.java
@@ -256,9 +256,22 @@ public class VCardUtils {
builder.withValue(StructuredPostal.LABEL, postalData.label);
}
+ final String streetString;
+ if (TextUtils.isEmpty(postalData.street)) {
+ if (TextUtils.isEmpty(postalData.extendedAddress)) {
+ streetString = null;
+ } else {
+ streetString = postalData.extendedAddress;
+ }
+ } else {
+ if (TextUtils.isEmpty(postalData.extendedAddress)) {
+ streetString = postalData.street;
+ } else {
+ streetString = postalData.street + " " + postalData.extendedAddress;
+ }
+ }
builder.withValue(StructuredPostal.POBOX, postalData.pobox);
- builder.withValue(StructuredPostal.NEIGHBORHOOD, postalData.extendedAddress);
- builder.withValue(StructuredPostal.STREET, postalData.street);
+ builder.withValue(StructuredPostal.STREET, streetString);
builder.withValue(StructuredPostal.CITY, postalData.localty);
builder.withValue(StructuredPostal.REGION, postalData.region);
builder.withValue(StructuredPostal.POSTCODE, postalData.postalCode);