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

Commit 8c834c07 authored by Shreyas Basarge's avatar Shreyas Basarge
Browse files

SyncManager on JobScheduler

SyncManager now uses JobScheduler for scheduling
and persistence purposes.

Change-Id: I38c92aedbf4d891ca297644d0b706835aaedfcd6
parent bc0ce990
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -7852,6 +7852,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
@@ -9036,6 +9037,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
@@ -8140,6 +8140,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
@@ -9350,6 +9351,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
@@ -7855,6 +7855,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
@@ -9041,6 +9042,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