Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 43e08e34 authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change 8945

* changes:
  Expose type constants and accessor for unit tests.
parents 700a52ac bc25407b
Loading
Loading
Loading
Loading
+15 −6
Original line number Diff line number Diff line
@@ -26,10 +26,14 @@ import java.util.Map;
import java.util.HashMap;

public class ContentProviderOperation implements Parcelable {
    private final static int TYPE_INSERT = 1;
    private final static int TYPE_UPDATE = 2;
    private final static int TYPE_DELETE = 3;
    private final static int TYPE_COUNT = 4;
    /** @hide exposed for unit tests */
    public final static int TYPE_INSERT = 1;
    /** @hide exposed for unit tests */
    public final static int TYPE_UPDATE = 2;
    /** @hide exposed for unit tests */
    public final static int TYPE_DELETE = 3;
    /** @hide exposed for unit tests */
    public final static int TYPE_COUNT = 4;

    private final int mType;
    private final Uri mUri;
@@ -167,6 +171,11 @@ public class ContentProviderOperation implements Parcelable {
        return mUri;
    }

    /** @hide exposed for unit tests */
    public int getType() {
        return mType;
    }

    public boolean isWriteOperation() {
        return mType == TYPE_DELETE || mType == TYPE_INSERT || mType == TYPE_UPDATE;
    }