diff options
author | Fred Quintana <fredq@google.com> | 2009-05-15 15:10:40 -0700 |
---|---|---|
committer | Fred Quintana <fredq@google.com> | 2009-05-22 14:17:48 -0700 |
commit | 8943737692169f564cd34a9c8d471f3a5d438712 (patch) | |
tree | 7b017cbed472235c15d32e694b1fa18c5446c751 /core/java/android/content/ContentProviderResult.java | |
parent | fc5095f44ba46b57f4ef6179ee4d69ce3a7fe69a (diff) | |
download | frameworks_base-8943737692169f564cd34a9c8d471f3a5d438712.zip frameworks_base-8943737692169f564cd34a9c8d471f3a5d438712.tar.gz frameworks_base-8943737692169f564cd34a9c8d471f3a5d438712.tar.bz2 |
add ipc support to batching
Diffstat (limited to 'core/java/android/content/ContentProviderResult.java')
-rw-r--r-- | core/java/android/content/ContentProviderResult.java | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/core/java/android/content/ContentProviderResult.java b/core/java/android/content/ContentProviderResult.java index 2e34e40..34aaa6d 100644 --- a/core/java/android/content/ContentProviderResult.java +++ b/core/java/android/content/ContentProviderResult.java @@ -17,12 +17,14 @@ package android.content; import android.net.Uri; +import android.os.Parcelable; +import android.os.Parcel; /** * Contains the result of the application of a {@link ContentProviderOperation}. It is guaranteed * to have exactly one of {@link #uri} or {@link #count} set. */ -public class ContentProviderResult { +public class ContentProviderResult implements Parcelable { public final Uri uri; public final Integer count; @@ -36,4 +38,40 @@ public class ContentProviderResult { this.count = count; this.uri = null; } + + public ContentProviderResult(Parcel source) { + int type = source.readInt(); + if (type == 1) { + count = source.readInt(); + uri = null; + } else { + count = null; + uri = Uri.CREATOR.createFromParcel(source); + } + } + + public void writeToParcel(Parcel dest, int flags) { + if (uri == null) { + dest.writeInt(1); + dest.writeInt(count); + } else { + dest.writeInt(2); + uri.writeToParcel(dest, 0); + } + } + + public int describeContents() { + return 0; + } + + public static final Creator<ContentProviderResult> CREATOR = + new Creator<ContentProviderResult>() { + public ContentProviderResult createFromParcel(Parcel source) { + return new ContentProviderResult(source); + } + + public ContentProviderResult[] newArray(int size) { + return new ContentProviderResult[size]; + } + }; }
\ No newline at end of file |