summaryrefslogtreecommitdiffstats
path: root/core/java/android/content/ContentProviderOperation.java
diff options
context:
space:
mode:
authorFred Quintana <fredq@google.com>2009-08-28 14:36:42 -0700
committerFred Quintana <fredq@google.com>2009-08-28 17:01:16 -0700
commit56f67d21459ad3f136c73c8932904d4a495989c0 (patch)
tree7d13afccbdd481fc71aef6403c5baf65bba56c47 /core/java/android/content/ContentProviderOperation.java
parentcc927375cea38f44d810d9dd5ba87abb624d7e0c (diff)
downloadframeworks_base-56f67d21459ad3f136c73c8932904d4a495989c0.zip
frameworks_base-56f67d21459ad3f136c73c8932904d4a495989c0.tar.gz
frameworks_base-56f67d21459ad3f136c73c8932904d4a495989c0.tar.bz2
add the ability to specify yieldpoints in a ContentProviderOperation
Diffstat (limited to 'core/java/android/content/ContentProviderOperation.java')
-rw-r--r--core/java/android/content/ContentProviderOperation.java15
1 files changed, 14 insertions, 1 deletions
diff --git a/core/java/android/content/ContentProviderOperation.java b/core/java/android/content/ContentProviderOperation.java
index f5a4b75..238792b 100644
--- a/core/java/android/content/ContentProviderOperation.java
+++ b/core/java/android/content/ContentProviderOperation.java
@@ -44,6 +44,7 @@ public class ContentProviderOperation implements Parcelable {
private final Integer mExpectedCount;
private final ContentValues mValuesBackReferences;
private final Map<Integer, Integer> mSelectionArgsBackReferences;
+ private final boolean mYieldAllowed;
/**
* Creates a {@link ContentProviderOperation} by copying the contents of a
@@ -58,6 +59,7 @@ public class ContentProviderOperation implements Parcelable {
mExpectedCount = builder.mExpectedCount;
mSelectionArgsBackReferences = builder.mSelectionArgsBackReferences;
mValuesBackReferences = builder.mValuesBackReferences;
+ mYieldAllowed = builder.mYieldAllowed;
}
private ContentProviderOperation(Parcel source) {
@@ -68,7 +70,6 @@ public class ContentProviderOperation implements Parcelable {
mSelectionArgs = source.readInt() != 0 ? source.readStringArray() : null;
mExpectedCount = source.readInt() != 0 ? source.readInt() : null;
mValuesBackReferences = source.readInt() != 0
-
? ContentValues.CREATOR.createFromParcel(source)
: null;
mSelectionArgsBackReferences = source.readInt() != 0
@@ -80,6 +81,7 @@ public class ContentProviderOperation implements Parcelable {
mSelectionArgsBackReferences.put(source.readInt(), source.readInt());
}
}
+ mYieldAllowed = source.readInt() != 0;
}
public void writeToParcel(Parcel dest, int flags) {
@@ -125,6 +127,7 @@ public class ContentProviderOperation implements Parcelable {
} else {
dest.writeInt(0);
}
+ dest.writeInt(mYieldAllowed ? 1 : 0);
}
/**
@@ -167,6 +170,10 @@ public class ContentProviderOperation implements Parcelable {
return mUri;
}
+ public boolean isYieldAllowed() {
+ return mYieldAllowed;
+ }
+
/** @hide exposed for unit tests */
public int getType() {
return mType;
@@ -375,6 +382,7 @@ public class ContentProviderOperation implements Parcelable {
private Integer mExpectedCount;
private ContentValues mValuesBackReferences;
private Map<Integer, Integer> mSelectionArgsBackReferences;
+ private boolean mYieldAllowed;
/** Create a {@link Builder} of a given type. The uri must not be null. */
private Builder(int type, Uri uri) {
@@ -544,5 +552,10 @@ public class ContentProviderOperation implements Parcelable {
mExpectedCount = count;
return this;
}
+
+ public Builder withYieldAllowed(boolean yieldAllowed) {
+ mYieldAllowed = yieldAllowed;
+ return this;
+ }
}
}