Loading core/java/android/pim/vcard/VCardComposer.java +8 −4 Original line number Diff line number Diff line Loading @@ -103,7 +103,7 @@ public class VCardComposer { private OutputStream mOutputStream; // mWriter will close this. private Writer mWriter; private boolean mFinishIsCalled = false; private boolean mOnTerminateIsCalled = false; /** * Input stream will be closed on the detruction of this object. Loading Loading @@ -152,6 +152,7 @@ public class VCardComposer { } public void onTerminate() { mOnTerminateIsCalled = true; if (mWriter != null) { try { // Flush and sync the data so that a user is able to pull Loading @@ -177,7 +178,7 @@ public class VCardComposer { @Override public void finalize() { if (!mFinishIsCalled) { if (!mOnTerminateIsCalled) { onTerminate(); } } Loading Loading @@ -604,11 +605,11 @@ public class VCardComposer { // FN property builder.append(VCARD_PROPERTY_FULL_NAME); builder.append(VCARD_ATTR_SEPARATOR); if (!VCardUtils.containsOnlyAscii(encodedFullname)) { builder.append(VCARD_ATTR_SEPARATOR); builder.append(mVCardAttributeCharset); builder.append(VCARD_DATA_SEPARATOR); } builder.append(VCARD_DATA_SEPARATOR); builder.append(encodedFullname); builder.append(VCARD_COL_SEPARATOR); } else if (!TextUtils.isEmpty(displayName)) { Loading Loading @@ -1242,6 +1243,9 @@ public class VCardComposer { case Email.TYPE_OTHER: builder.append(Constants.ATTR_TYPE_INTERNET); break; case Email.TYPE_MOBILE: builder.append(Constants.ATTR_TYPE_CELL); break; default: Log.e(LOG_TAG, "Unknown Email type: " + type); builder.append(Constants.ATTR_TYPE_INTERNET); Loading core/java/android/pim/vcard/VCardParser_V30.java +9 −2 Original line number Diff line number Diff line Loading @@ -47,6 +47,8 @@ public class VCardParser_V30 extends VCardParser_V21 { private String mPreviousLine; private boolean mEmittedAgentWarning = false; @Override protected String getVersion() { return Constants.VERSION_V30; Loading Loading @@ -221,7 +223,7 @@ public class VCardParser_V30 extends VCardParser_V21 { } @Override protected void handleAgent(String propertyValue) throws VCardException { protected void handleAgent(String propertyValue) { // The way how vCard 3.0 supports "AGENT" is completely different from vCard 2.0. // // e.g. Loading @@ -238,7 +240,12 @@ public class VCardParser_V30 extends VCardParser_V21 { // CID:JQPUBLIC.part3.960129T083020.xyzMail@host3.com // // This is not VCARD. Should we support this? throw new VCardException("AGENT in vCard 3.0 is not supported yet."); // throw new VCardException("AGENT in vCard 3.0 is not supported yet."); if (!mEmittedAgentWarning) { Log.w(LOG_TAG, "AGENT in vCard 3.0 is not supported yet. Ignore it"); mEmittedAgentWarning = true; } // Just ignore the line for now, since we cannot know how to handle it... } /** Loading Loading
core/java/android/pim/vcard/VCardComposer.java +8 −4 Original line number Diff line number Diff line Loading @@ -103,7 +103,7 @@ public class VCardComposer { private OutputStream mOutputStream; // mWriter will close this. private Writer mWriter; private boolean mFinishIsCalled = false; private boolean mOnTerminateIsCalled = false; /** * Input stream will be closed on the detruction of this object. Loading Loading @@ -152,6 +152,7 @@ public class VCardComposer { } public void onTerminate() { mOnTerminateIsCalled = true; if (mWriter != null) { try { // Flush and sync the data so that a user is able to pull Loading @@ -177,7 +178,7 @@ public class VCardComposer { @Override public void finalize() { if (!mFinishIsCalled) { if (!mOnTerminateIsCalled) { onTerminate(); } } Loading Loading @@ -604,11 +605,11 @@ public class VCardComposer { // FN property builder.append(VCARD_PROPERTY_FULL_NAME); builder.append(VCARD_ATTR_SEPARATOR); if (!VCardUtils.containsOnlyAscii(encodedFullname)) { builder.append(VCARD_ATTR_SEPARATOR); builder.append(mVCardAttributeCharset); builder.append(VCARD_DATA_SEPARATOR); } builder.append(VCARD_DATA_SEPARATOR); builder.append(encodedFullname); builder.append(VCARD_COL_SEPARATOR); } else if (!TextUtils.isEmpty(displayName)) { Loading Loading @@ -1242,6 +1243,9 @@ public class VCardComposer { case Email.TYPE_OTHER: builder.append(Constants.ATTR_TYPE_INTERNET); break; case Email.TYPE_MOBILE: builder.append(Constants.ATTR_TYPE_CELL); break; default: Log.e(LOG_TAG, "Unknown Email type: " + type); builder.append(Constants.ATTR_TYPE_INTERNET); Loading
core/java/android/pim/vcard/VCardParser_V30.java +9 −2 Original line number Diff line number Diff line Loading @@ -47,6 +47,8 @@ public class VCardParser_V30 extends VCardParser_V21 { private String mPreviousLine; private boolean mEmittedAgentWarning = false; @Override protected String getVersion() { return Constants.VERSION_V30; Loading Loading @@ -221,7 +223,7 @@ public class VCardParser_V30 extends VCardParser_V21 { } @Override protected void handleAgent(String propertyValue) throws VCardException { protected void handleAgent(String propertyValue) { // The way how vCard 3.0 supports "AGENT" is completely different from vCard 2.0. // // e.g. Loading @@ -238,7 +240,12 @@ public class VCardParser_V30 extends VCardParser_V21 { // CID:JQPUBLIC.part3.960129T083020.xyzMail@host3.com // // This is not VCARD. Should we support this? throw new VCardException("AGENT in vCard 3.0 is not supported yet."); // throw new VCardException("AGENT in vCard 3.0 is not supported yet."); if (!mEmittedAgentWarning) { Log.w(LOG_TAG, "AGENT in vCard 3.0 is not supported yet. Ignore it"); mEmittedAgentWarning = true; } // Just ignore the line for now, since we cannot know how to handle it... } /** Loading