to top
Android APIs
public class

SyncAdapterType

extends Object
implements Parcelable
java.lang.Object
   ↳ android.content.SyncAdapterType

Class Overview

Value type that represents a SyncAdapterType. This object overrides equals(Object) and hashCode(), making it suitable for use as the key of a Map

Summary

[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator<SyncAdapterType> CREATOR
public final String accountType
public final String authority
public final boolean isKey
Public Constructors
SyncAdapterType(String authority, String accountType, boolean userVisible, boolean supportsUploading)
SyncAdapterType(Parcel source)
Public Methods
boolean allowParallelSyncs()
int describeContents()
Describe the kinds of special objects contained in this Parcelable's marshalled representation.
boolean equals(Object o)
Compares this instance with the specified object and indicates if they are equal.
String getSettingsActivity()
int hashCode()
Returns an integer hash code for this object.
boolean isAlwaysSyncable()
If true then the SyncManager will never issue an initialization sync to the SyncAdapter and will instead automatically call setIsSyncable(android.accounts.Account, String, int) with a value of 1 for each account and provider that this sync adapter supports.
boolean isUserVisible()
static SyncAdapterType newKey(String authority, String accountType)
boolean supportsUploading()
String toString()
Returns a string containing a concise, human-readable description of this object.
void writeToParcel(Parcel dest, int flags)
Flatten this object in to a Parcel.
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Fields

public static final Creator<SyncAdapterType> CREATOR

Added in API level 5

public final String accountType

Added in API level 5

public final String authority

Added in API level 5

public final boolean isKey

Added in API level 5

Public Constructors

public SyncAdapterType (String authority, String accountType, boolean userVisible, boolean supportsUploading)

Added in API level 5

public SyncAdapterType (Parcel source)

Added in API level 5

Public Methods

public boolean allowParallelSyncs ()

Added in API level 11

Returns
  • True if this SyncAdapter supports syncing multiple accounts simultaneously. If false then the SyncManager will take care to only start one sync at a time using this SyncAdapter.

public int describeContents ()

Added in API level 5

Describe the kinds of special objects contained in this Parcelable's marshalled representation.

Returns
  • a bitmask indicating the set of special object types marshalled by the Parcelable.

public boolean equals (Object o)

Added in API level 5

Compares this instance with the specified object and indicates if they are equal. In order to be equal, o must represent the same object as this instance using a class-specific comparison. The general contract is that this comparison should be reflexive, symmetric, and transitive. Also, no object reference other than null is equal to null.

The default implementation returns true only if this == o. See Writing a correct equals method if you intend implementing your own equals method.

The general contract for the equals and hashCode() methods is that if equals returns true for any two objects, then hashCode() must return the same value for these objects. This means that subclasses of Object usually override either both methods or neither of them.

Parameters
o the object to compare this instance with.
Returns
  • true if the specified object is equal to this Object; false otherwise.

public String getSettingsActivity ()

Added in API level 14

Returns
  • The activity to use to invoke this SyncAdapter's settings activity. May be null.

public int hashCode ()

Added in API level 5

Returns an integer hash code for this object. By contract, any two objects for which equals(Object) returns true must return the same hash code value. This means that subclasses of Object usually override both methods or neither method.

Note that hash values must not change over time unless information used in equals comparisons also changes.

See Writing a correct hashCode method if you intend implementing your own hashCode method.

Returns
  • this object's hash code.

public boolean isAlwaysSyncable ()

Added in API level 11

If true then the SyncManager will never issue an initialization sync to the SyncAdapter and will instead automatically call setIsSyncable(android.accounts.Account, String, int) with a value of 1 for each account and provider that this sync adapter supports.

Returns
  • true if the SyncAdapter does not require initialization and if it is ok for the SyncAdapter to treat it as syncable automatically.

public boolean isUserVisible ()

Added in API level 5

public static SyncAdapterType newKey (String authority, String accountType)

Added in API level 5

public boolean supportsUploading ()

Added in API level 5

public String toString ()

Added in API level 5

Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:

   getClass().getName() + '@' + Integer.toHexString(hashCode())

See Writing a useful toString method if you intend implementing your own toString method.

Returns
  • a printable representation of this object.

public void writeToParcel (Parcel dest, int flags)

Added in API level 5

Flatten this object in to a Parcel.

Parameters
dest The Parcel in which the object should be written.
flags Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE.