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

Commit a491c07f authored by Shreyas Basarge's avatar Shreyas Basarge Committed by Android (Google) Code Review
Browse files

Merge "SyncManager on JobScheduler"

parents 15d21b3a 8c834c07
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -7870,6 +7870,7 @@ package android.content {
    field public static final java.lang.String SYNC_EXTRAS_INITIALIZE = "initialize";
    field public static final java.lang.String SYNC_EXTRAS_MANUAL = "force";
    field public static final java.lang.String SYNC_EXTRAS_OVERRIDE_TOO_MANY_DELETIONS = "deletions_override";
    field public static final java.lang.String SYNC_EXTRAS_REQUIRE_CHARGING = "require_charging";
    field public static final java.lang.String SYNC_EXTRAS_UPLOAD = "upload";
    field public static final int SYNC_OBSERVER_TYPE_ACTIVE = 4; // 0x4
    field public static final int SYNC_OBSERVER_TYPE_PENDING = 2; // 0x2
@@ -9060,6 +9061,7 @@ 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 setRequiresCharging(boolean);
    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);
+2 −0
Original line number Diff line number Diff line
@@ -8158,6 +8158,7 @@ package android.content {
    field public static final java.lang.String SYNC_EXTRAS_INITIALIZE = "initialize";
    field public static final java.lang.String SYNC_EXTRAS_MANUAL = "force";
    field public static final java.lang.String SYNC_EXTRAS_OVERRIDE_TOO_MANY_DELETIONS = "deletions_override";
    field public static final java.lang.String SYNC_EXTRAS_REQUIRE_CHARGING = "require_charging";
    field public static final java.lang.String SYNC_EXTRAS_UPLOAD = "upload";
    field public static final int SYNC_OBSERVER_TYPE_ACTIVE = 4; // 0x4
    field public static final int SYNC_OBSERVER_TYPE_PENDING = 2; // 0x2
@@ -9374,6 +9375,7 @@ 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 setRequiresCharging(boolean);
    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);
+2 −0
Original line number Diff line number Diff line
@@ -7873,6 +7873,7 @@ package android.content {
    field public static final java.lang.String SYNC_EXTRAS_INITIALIZE = "initialize";
    field public static final java.lang.String SYNC_EXTRAS_MANUAL = "force";
    field public static final java.lang.String SYNC_EXTRAS_OVERRIDE_TOO_MANY_DELETIONS = "deletions_override";
    field public static final java.lang.String SYNC_EXTRAS_REQUIRE_CHARGING = "require_charging";
    field public static final java.lang.String SYNC_EXTRAS_UPLOAD = "upload";
    field public static final int SYNC_OBSERVER_TYPE_ACTIVE = 4; // 0x4
    field public static final int SYNC_OBSERVER_TYPE_PENDING = 2; // 0x2
@@ -9065,6 +9066,7 @@ 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 setRequiresCharging(boolean);
    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);
+7 −0
Original line number Diff line number Diff line
@@ -88,6 +88,13 @@ public abstract class ContentResolver {
     */
    public static final String SYNC_EXTRAS_EXPEDITED = "expedited";

    /**
     * If this extra is set to true, the sync request will be scheduled
     * only when the device is plugged in. This is equivalent to calling
     * setRequiresCharging(true) on {@link SyncRequest}.
     */
    public static final String SYNC_EXTRAS_REQUIRE_CHARGING = "require_charging";

    /**
     * @deprecated instead use
     * {@link #SYNC_EXTRAS_MANUAL}
+17 −1
Original line number Diff line number Diff line
@@ -246,6 +246,10 @@ public class SyncRequest implements Parcelable {
         * this sync is bound to a provider), otherwise null.
         */
        private String mAuthority;
        /**
         * Whether the sync requires the phone to be plugged in.
         */
        private boolean mRequiresCharging;

        public Builder() {
        }
@@ -341,6 +345,15 @@ public class SyncRequest implements Parcelable {
            return this;
        }

        /**
         * Specify whether the sync requires the phone to be plugged in.
         * @param requiresCharging true if sync requires the phone to be plugged in. Default false.
         */
        public Builder setRequiresCharging(boolean requiresCharging) {
            mRequiresCharging = true;
            return this;
        }

        /**
         * Specify an authority and account for this transfer.
         *
@@ -499,6 +512,9 @@ public class SyncRequest implements Parcelable {
            if (mDisallowMetered) {
                mSyncConfigExtras.putBoolean(ContentResolver.SYNC_EXTRAS_DISALLOW_METERED, true);
            }
            if (mRequiresCharging) {
                mSyncConfigExtras.putBoolean(ContentResolver.SYNC_EXTRAS_REQUIRE_CHARGING, true);
            }
            if (mIgnoreSettings) {
                mSyncConfigExtras.putBoolean(ContentResolver.SYNC_EXTRAS_IGNORE_SETTINGS, true);
            }
Loading