OSDN Git Service

Remove SyncRequest.setPriority from public API
authorMatthew Williams <mjwilliams@google.com>
Tue, 10 Jun 2014 03:06:03 +0000 (20:06 -0700)
committerMatthew Williams <mjwilliams@google.com>
Tue, 10 Jun 2014 03:18:25 +0000 (20:18 -0700)
Bug: 15517262
Change-Id: If62b6f3bf339011dd504889aa24c71a22cb08ed8

api/current.txt
core/java/android/content/SyncRequest.java

index d18fddc..53006ae 100644 (file)
@@ -7887,7 +7887,6 @@ package android.content {
 
   public class SyncRequest implements android.os.Parcelable {
     method public int describeContents();
-    method public boolean isExpedited();
     method public void writeToParcel(android.os.Parcel, int);
     field public static final android.os.Parcelable.Creator CREATOR;
   }
@@ -7902,7 +7901,6 @@ package android.content {
     method public android.content.SyncRequest.Builder setIgnoreSettings(boolean);
     method public android.content.SyncRequest.Builder setManual(boolean);
     method public android.content.SyncRequest.Builder setNoRetry(boolean);
-    method public android.content.SyncRequest.Builder setPriority(int);
     method public android.content.SyncRequest.Builder setSyncAdapter(android.accounts.Account, java.lang.String);
     method public android.content.SyncRequest.Builder syncOnce();
     method public android.content.SyncRequest.Builder syncPeriodic(long, long);
index 869f85c..7619c6d 100644 (file)
@@ -21,6 +21,11 @@ import android.os.Bundle;
 import android.os.Parcel;
 import android.os.Parcelable;
 
+/**
+ * Convenience class to construct sync requests. See {@link android.content.SyncRequest.Builder}
+ * for an explanation of the various functions. The resulting object is passed through to the
+ * framework via {@link android.content.ContentResolver#requestSync(SyncRequest)}.
+ */
 public class SyncRequest implements Parcelable {
     private static final String TAG = "SyncRequest";
     /** Account to pass to the sync adapter. Can be null. */
@@ -57,6 +62,10 @@ public class SyncRequest implements Parcelable {
         return mIsPeriodic;
     }
 
+    /**
+     * {@hide}
+     * @return whether this sync is expedited.
+     */
     public boolean isExpedited() {
         return mIsExpedited;
     }
@@ -199,14 +208,8 @@ public class SyncRequest implements Parcelable {
          * discriminate between equivalent syncs.
          */
         private Bundle mSyncConfigExtras;
-        /** Expected upload transfer in bytes. */
-        private long mTxBytes = -1L;
-        /** Expected download transfer in bytes. */
-        private long mRxBytes = -1L;
         /** Whether or not this sync can occur on metered networks. Default false. */
         private boolean mDisallowMetered;
-        /** Priority of this sync relative to others from calling app [-2, 2]. Default 0. */
-        private int mPriority = 0;
         /**
          * Whether this builder is building a periodic sync, or a one-time sync.
          */
@@ -314,7 +317,6 @@ public class SyncRequest implements Parcelable {
             return this;
         }
 
-        /** {@hide} */
         private void setupInterval(long at, long before) {
             if (before > at) {
                 throw new IllegalArgumentException("Specified run time for the sync must be" +
@@ -477,18 +479,6 @@ public class SyncRequest implements Parcelable {
         }
 
         /**
-         * @param priority the priority of this request among all requests from the calling app.
-         * Range of [-2,2] similar to how this is done with notifications.
-         */
-        public Builder setPriority(int priority) {
-            if (priority < -2 || priority > 2) {
-                throw new IllegalArgumentException("Priority must be within range [-2, 2]");
-            }
-            mPriority = priority;
-            return this;
-        }
-
-        /**
          * Performs validation over the request and throws the runtime exception
          * <code>IllegalArgumentException</code> if this validation fails.
          *
@@ -522,9 +512,6 @@ public class SyncRequest implements Parcelable {
                 mSyncConfigExtras.putBoolean(ContentResolver.SYNC_EXTRAS_IGNORE_BACKOFF, true);
                 mSyncConfigExtras.putBoolean(ContentResolver.SYNC_EXTRAS_IGNORE_SETTINGS, true);
             }
-            mSyncConfigExtras.putLong(ContentResolver.SYNC_EXTRAS_EXPECTED_UPLOAD, mTxBytes);
-            mSyncConfigExtras.putLong(ContentResolver.SYNC_EXTRAS_EXPECTED_DOWNLOAD, mRxBytes);
-            mSyncConfigExtras.putInt(ContentResolver.SYNC_EXTRAS_PRIORITY, mPriority);
             if (mSyncType == SYNC_TYPE_PERIODIC) {
                 // If this is a periodic sync ensure than invalid extras were not set.
                 if (ContentResolver.invalidPeriodicExtras(mCustomExtras) ||