PeriodicSyncpublic class PeriodicSync extends Object implements android.os.ParcelableValue type that contains information about a periodic sync. |
Fields Summary |
---|
public final android.accounts.Account | accountThe account to be synced. Can be null. | public final String | authorityThe authority of the sync. Can be null. | public final android.os.Bundle | extrasAny extras that parameters that are to be passed to the sync adapter. | public final long | periodHow frequently the sync should be scheduled, in seconds. Kept around for API purposes. | public final long | flexTimeHow 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 int | describeContents()
return 0;
| public boolean | equals(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 boolean | syncExtrasEquals(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.String | toString()
return "account: " + account +
", authority: " + authority +
". period: " + period + "s " +
", flex: " + flexTime;
| public void | writeToParcel(android.os.Parcel dest, int flags)
dest.writeParcelable(account, flags);
dest.writeString(authority);
dest.writeBundle(extras);
dest.writeLong(period);
dest.writeLong(flexTime);
|
|