OSDN Git Service

Honor '+' in phone export in vCard.
authorDaisuke Miyakawa <dmiyakawa@google.com>
Wed, 3 Feb 2010 20:42:26 +0000 (12:42 -0800)
committerDaisuke Miyakawa <dmiyakawa@google.com>
Wed, 3 Feb 2010 20:42:26 +0000 (12:42 -0800)
Currently no test because of temporal reason. I'll do in the near future...

Bug: 2417138

core/java/android/pim/vcard/VCardBuilder.java

index 09ac1fd..0a6415d 100644 (file)
@@ -689,7 +689,9 @@ public class VCardBuilder {
         final int length = phoneNumber.length();
         for (int i = 0; i < length; i++) {
             final char ch = phoneNumber.charAt(i);
-            if (Character.isDigit(ch)) {
+            // TODO: add a test case for string with '+', and care the other possible issues
+            // which may happen by ignoring non-digits other than '+'.
+            if (Character.isDigit(ch) || ch == '+') {
                 builder.append(ch);
             } else if ((ch == ';' || ch == '\n') && builder.length() > 0) {
                 phoneList.add(builder.toString());