diff options
author | Daniel Lehmann <lehmannd@google.com> | 2010-03-12 13:44:31 -0800 |
---|---|---|
committer | Daniel Lehmann <lehmannd@google.com> | 2010-03-12 13:44:31 -0800 |
commit | 63e914096ebfc767dc764519e41a2f4d8e578791 (patch) | |
tree | 3617fd8530a1fd3cbbc5b15cfe960ccb2a30ef4e /core/java/android/pim | |
parent | 7b00978dc739ed2213ed8e511c69cfb412798109 (diff) | |
download | frameworks_base-63e914096ebfc767dc764519e41a2f4d8e578791.zip frameworks_base-63e914096ebfc767dc764519e41a2f4d8e578791.tar.gz frameworks_base-63e914096ebfc767dc764519e41a2f4d8e578791.tar.bz2 |
Framework changes to allow VCards containing multiple entries
Bug:2501468
Change-Id: I004997c6ed9351e2600e7446615af9e60a14fda8
Diffstat (limited to 'core/java/android/pim')
-rw-r--r-- | core/java/android/pim/vcard/VCardEntryCommitter.java | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/core/java/android/pim/vcard/VCardEntryCommitter.java b/core/java/android/pim/vcard/VCardEntryCommitter.java index 3cd64b0..2f99e4a 100644 --- a/core/java/android/pim/vcard/VCardEntryCommitter.java +++ b/core/java/android/pim/vcard/VCardEntryCommitter.java @@ -19,6 +19,8 @@ import android.content.ContentResolver; import android.net.Uri; import android.util.Log; +import java.util.ArrayList; + /** * <P> * {@link VCardEntryHandler} implementation which commits the entry to ContentResolver. @@ -35,7 +37,7 @@ public class VCardEntryCommitter implements VCardEntryHandler { private final ContentResolver mContentResolver; private long mTimeToCommit; - private Uri mLastCreatedUri; + private ArrayList<Uri> mCreatedUris = new ArrayList<Uri>(); public VCardEntryCommitter(ContentResolver resolver) { mContentResolver = resolver; @@ -52,11 +54,21 @@ public class VCardEntryCommitter implements VCardEntryHandler { public void onEntryCreated(final VCardEntry contactStruct) { long start = System.currentTimeMillis(); - mLastCreatedUri = contactStruct.pushIntoContentResolver(mContentResolver); + mCreatedUris.add(contactStruct.pushIntoContentResolver(mContentResolver)); mTimeToCommit += System.currentTimeMillis() - start; } + // TODO: Compatibility function to not break the build. Will be removed shortly + @Deprecated public Uri getLastCreatedUri() { - return mLastCreatedUri; + return mCreatedUris.size() == 0 ? null : mCreatedUris.get(mCreatedUris.size() - 1); + } + + /** + * Returns the list of created Uris. This list should not be modified by the caller as it is + * not a clone. + */ + public ArrayList<Uri> getCreatedUris() { + return mCreatedUris; } }
\ No newline at end of file |