FileDocCategorySizeDatePackage
PeriodicSync.javaAPI DocAndroid 5.1 API4884Thu Mar 12 22:22:10 GMT 2015android.content

PeriodicSync

public class PeriodicSync extends Object implements android.os.Parcelable
Value type that contains information about a periodic sync.

Fields Summary
public final android.accounts.Account
account
The account to be synced. Can be null.
public final String
authority
The authority of the sync. Can be null.
public final android.os.Bundle
extras
Any extras that parameters that are to be passed to the sync adapter.
public final long
period
How frequently the sync should be scheduled, in seconds. Kept around for API purposes.
public final long
flexTime
How much flexibility can be taken in scheduling the sync, in seconds. {@hide}
public static final Creator
CREATOR
Constructors Summary
public PeriodicSync(android.accounts.Account account, String authority, android.os.Bundle extras, long periodInSeconds)
Creates a new PeriodicSync, copying the Bundle. This constructor is no longer used.

        this.account = account;
        this.authority = authority;
        if (extras == null) {
            this.extras = new Bundle();
        } else {
            this.extras = new Bundle(extras);
        }
        this.period = periodInSeconds;
        // Old API uses default flex time. No-one should be using this ctor anyway.
        this.flexTime = 0L;
    
public PeriodicSync(PeriodicSync other)
Create a copy of a periodic sync. {@hide}

        this.account = other.account;
        this.authority = other.authority;
        this.extras = new Bundle(other.extras);
        this.period = other.period;
        this.flexTime = other.flexTime;
    
public PeriodicSync(android.accounts.Account account, String authority, android.os.Bundle extras, long period, long flexTime)
A PeriodicSync for a sync with a specified provider. {@hide}

        this.account = account;
        this.authority = authority;
        this.extras = new Bundle(extras);
        this.period = period;
        this.flexTime = flexTime;
    
private PeriodicSync(android.os.Parcel in)

        this.account = in.readParcelable(null);
        this.authority = in.readString();
        this.extras = in.readBundle();
        this.period = in.readLong();
        this.flexTime = in.readLong();
    
Methods Summary
public intdescribeContents()

        return 0;
    
public booleanequals(java.lang.Object o)


    
        
        if (o == this) {
            return true;
        }
        if (!(o instanceof PeriodicSync)) {
            return false;
        }
        final PeriodicSync other = (PeriodicSync) o;
        return account.equals(other.account)
                && authority.equals(other.authority)
                && period == other.period
                && syncExtrasEquals(extras, other.extras);
    
public static booleansyncExtrasEquals(android.os.Bundle b1, android.os.Bundle b2)
Periodic sync extra comparison function. {@hide}

        if (b1.size() != b2.size()) {
            return false;
        }
        if (b1.isEmpty()) {
            return true;
        }
        for (String key : b1.keySet()) {
            if (!b2.containsKey(key)) {
                return false;
            }
            if (!b1.get(key).equals(b2.get(key))) {
                return false;
            }
        }
        return true;
    
public java.lang.StringtoString()

        return "account: " + account +
               ", authority: " + authority +
               ". period: " + period + "s " +
               ", flex: " + flexTime;
    
public voidwriteToParcel(android.os.Parcel dest, int flags)

        dest.writeParcelable(account, flags);
        dest.writeString(authority);
        dest.writeBundle(extras);
        dest.writeLong(period);
        dest.writeLong(flexTime);