diff options
-rw-r--r-- | api/current.xml | 57 | ||||
-rw-r--r-- | core/java/android/content/ContentProviderOperation.java | 15 | ||||
-rw-r--r-- | core/java/android/content/OperationApplicationException.java | 18 |
3 files changed, 89 insertions, 1 deletions
diff --git a/api/current.xml b/api/current.xml index 403a961..3e616a4 100644 --- a/api/current.xml +++ b/api/current.xml @@ -27066,6 +27066,17 @@ visibility="public" > </method> +<method name="isYieldAllowed" + return="boolean" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> <method name="newAssertQuery" return="android.content.ContentProviderOperation.Builder" abstract="false" @@ -27292,6 +27303,19 @@ <parameter name="values" type="android.content.ContentValues"> </parameter> </method> +<method name="withYieldAllowed" + return="android.content.ContentProviderOperation.Builder" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="yieldAllowed" type="boolean"> +</parameter> +</method> </class> <class name="ContentProviderResult" extends="java.lang.Object" @@ -35833,6 +35857,39 @@ <parameter name="cause" type="java.lang.Throwable"> </parameter> </constructor> +<constructor name="OperationApplicationException" + type="android.content.OperationApplicationException" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="numSuccessfulYieldPoints" type="int"> +</parameter> +</constructor> +<constructor name="OperationApplicationException" + type="android.content.OperationApplicationException" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="message" type="java.lang.String"> +</parameter> +<parameter name="numSuccessfulYieldPoints" type="int"> +</parameter> +</constructor> +<method name="getNumSuccessfulYieldPoints" + return="int" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> </class> <class name="ReceiverCallNotAllowedException" extends="android.util.AndroidRuntimeException" 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; + } } } diff --git a/core/java/android/content/OperationApplicationException.java b/core/java/android/content/OperationApplicationException.java index d4101bf..2fc19bb 100644 --- a/core/java/android/content/OperationApplicationException.java +++ b/core/java/android/content/OperationApplicationException.java @@ -21,16 +21,34 @@ package android.content; * constraints. */ public class OperationApplicationException extends Exception { + private final int mNumSuccessfulYieldPoints; + public OperationApplicationException() { super(); + mNumSuccessfulYieldPoints = 0; } public OperationApplicationException(String message) { super(message); + mNumSuccessfulYieldPoints = 0; } public OperationApplicationException(String message, Throwable cause) { super(message, cause); + mNumSuccessfulYieldPoints = 0; } public OperationApplicationException(Throwable cause) { super(cause); + mNumSuccessfulYieldPoints = 0; + } + public OperationApplicationException(int numSuccessfulYieldPoints) { + super(); + mNumSuccessfulYieldPoints = numSuccessfulYieldPoints; + } + public OperationApplicationException(String message, int numSuccessfulYieldPoints) { + super(message); + mNumSuccessfulYieldPoints = numSuccessfulYieldPoints; + } + + public int getNumSuccessfulYieldPoints() { + return mNumSuccessfulYieldPoints; } } |