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

Commit 7b5c2340 authored by Matthew Williams's avatar Matthew Williams Committed by Android Git Automerger
Browse files

am e389d1ea: Merge "Remove SyncRequest.setPriority from public API" into lmp-preview-dev

* commit 'e389d1ea63b0a9caa6d069254ac661ca6420917f':
  Remove SyncRequest.setPriority from public API
parents ad423df3 c2c1a395
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -7930,7 +7930,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;
  }
@@ -7945,7 +7944,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);
+9 −22
Original line number Diff line number Diff line
@@ -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" +
@@ -476,18 +478,6 @@ public class SyncRequest implements Parcelable {
            return this;
        }

        /**
         * @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) ||