diff options
author | Brian Attwell <brianattwell@google.com> | 2014-10-16 22:26:23 -0700 |
---|---|---|
committer | Brian Attwell <brianattwell@google.com> | 2014-10-17 20:49:11 +0000 |
commit | 65f2f87f80eef79cd7ab889be780e72e9462c282 (patch) | |
tree | d45bf050e9cd2515389f8d86788557db1ea47a81 /src | |
parent | 01de4e9979e103406108b710930a4537ea67398a (diff) | |
download | android_packages_apps_ContactsCommon-65f2f87f80eef79cd7ab889be780e72e9462c282.tar.gz android_packages_apps_ContactsCommon-65f2f87f80eef79cd7ab889be780e72e9462c282.tar.bz2 android_packages_apps_ContactsCommon-65f2f87f80eef79cd7ab889be780e72e9462c282.zip |
Don't open a single contact after importing 50
The vcard import notification shouldn't open a single contact,
on click, if more than one contacts where imported.
Bug: 17243892
Change-Id: I3f00b0fbbdb658d4f2165935beee35994393af17
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/contacts/common/vcard/ImportProcessor.java | 12 | ||||
-rw-r--r-- | src/com/android/contacts/common/vcard/NotificationImportExportListener.java | 4 |
2 files changed, 9 insertions, 7 deletions
diff --git a/src/com/android/contacts/common/vcard/ImportProcessor.java b/src/com/android/contacts/common/vcard/ImportProcessor.java index 37128755..219ec144 100644 --- a/src/com/android/contacts/common/vcard/ImportProcessor.java +++ b/src/com/android/contacts/common/vcard/ImportProcessor.java @@ -194,14 +194,14 @@ public class ImportProcessor extends ProcessorBase implements VCardEntryHandler Log.i(LOG_TAG, "Successfully finished importing one vCard file: " + uri); List<Uri> uris = committer.getCreatedUris(); if (mListener != null) { - if (uris != null && uris.size() > 0) { - // TODO: construct intent showing a list of imported contact list. + if (uris != null && uris.size() == 1) { mListener.onImportFinished(mImportRequest, mJobId, uris.get(0)); } else { - // Not critical, but suspicious. - Log.w(LOG_TAG, - "Created Uris is null or 0 length " + - "though the creation itself is successful."); + if (uris == null || uris.size() == 0) { + // Not critical, but suspicious. + Log.w(LOG_TAG, "Created Uris is null or 0 length " + + "though the creation itself is successful."); + } mListener.onImportFinished(mImportRequest, mJobId, null); } } diff --git a/src/com/android/contacts/common/vcard/NotificationImportExportListener.java b/src/com/android/contacts/common/vcard/NotificationImportExportListener.java index 03d69a9a..a85825f1 100644 --- a/src/com/android/contacts/common/vcard/NotificationImportExportListener.java +++ b/src/com/android/contacts/common/vcard/NotificationImportExportListener.java @@ -26,6 +26,7 @@ import android.content.Intent; import android.net.Uri; import android.os.Handler; import android.os.Message; +import android.provider.ContactsContract; import android.provider.ContactsContract.RawContacts; import android.widget.Toast; @@ -125,7 +126,8 @@ public class NotificationImportExportListener implements VCardImportExportListen RawContacts.CONTENT_URI, rawContactId)); intent = new Intent(Intent.ACTION_VIEW, contactUri); } else { - intent = null; + intent = new Intent(Intent.ACTION_VIEW); + intent.setType(ContactsContract.Contacts.CONTENT_TYPE); } final Notification notification = NotificationImportExportListener.constructFinishNotification(mContext, |