[ Web Proxy ]
URL:
Viewing: https://developer.android.com/reference/android/provider/SyncStateContract.Helpers [Back]  [Original]

SyncStateContract.Helpers  |  API reference  |  Android Developers Skip to main content
Essentials Design & Plan Develop Google Play Blog
Search:
Android Studio
Android Developers [Android Developers]
Stay organized with collections Save and categorize content based on your preferences.
Added in API level 5

SyncStateContract.Helpers


public static final class SyncStateContract.Helpers
extends Object

java.lang.Object
   ↳ android.provider.SyncStateContract.Helpers


Summary

Public constructors

Helpers()

Public methods

static byte[] get(ContentProviderClient provider, Uri uri, Account account)

Get the sync state that is associated with the account or null.

static Pair<Uri, byte[]> getWithUri(ContentProviderClient provider, Uri uri, Account account)
static Uri insert(ContentProviderClient provider, Uri uri, Account account, byte[] data)
static ContentProviderOperation newSetOperation(Uri uri, Account account, byte[] data)

Creates and returns a ContentProviderOperation that assigns the data array as the sync state for the given account.

static ContentProviderOperation newUpdateOperation(Uri uri, byte[] data)

Creates and returns a ContentProviderOperation that assigns the data array as the sync state for the given account.

static void set(ContentProviderClient provider, Uri uri, Account account, byte[] data)

Assigns the data array as the sync state for the given account.

static void update(ContentProviderClient provider, Uri uri, byte[] data)

Inherited methods

Public constructors

Helpers

public Helpers ()

Public methods

get

Added in API level 5
public static byte[] get (ContentProviderClient provider, 
                Uri uri, 
                Account account)

Get the sync state that is associated with the account or null.

Parameters
provider ContentProviderClient: the ContentProviderClient that is to be used to communicate with the ContentProvider that contains the sync state.

uri Uri: the uri of the sync state

account Account: the Account whose sync state should be returned

Returns
byte[] the sync state or null if there is no sync state associated with the account

Throws
RemoteException if there is a failure communicating with the remote ContentProvider

getWithUri

Added in API level 5
public static Pair<Uri, byte[]> getWithUri (ContentProviderClient provider, 
                Uri uri, 
                Account account)

Parameters
provider ContentProviderClient

uri Uri

account Account

Returns
Pair<Uri, byte[]>

Throws
RemoteException

insert

Added in API level 5
public static Uri insert (ContentProviderClient provider, 
                Uri uri, 
                Account account, 
                byte[] data)

Parameters
provider ContentProviderClient

uri Uri

account Account

data byte

Returns
Uri

Throws
RemoteException

newSetOperation

Added in API level 5
public static ContentProviderOperation newSetOperation (Uri uri, 
                Account account, 
                byte[] data)

Creates and returns a ContentProviderOperation that assigns the data array as the sync state for the given account.

Parameters
uri Uri: the uri of the sync state

account Account: the Account whose sync state should be set

data byte: the byte[] that contains the sync state

Returns
ContentProviderOperation the new ContentProviderOperation that assigns the data array as the account's sync state

newUpdateOperation

Added in API level 5
public static ContentProviderOperation newUpdateOperation (Uri uri, 
                byte[] data)

Creates and returns a ContentProviderOperation that assigns the data array as the sync state for the given account.

Parameters
uri Uri: the uri of the specific sync state to set

data byte: the byte[] that contains the sync state

Returns
ContentProviderOperation the new ContentProviderOperation that assigns the data array as the account's sync state

set

Added in API level 5
public static void set (ContentProviderClient provider, 
                Uri uri, 
                Account account, 
                byte[] data)

Assigns the data array as the sync state for the given account.

Parameters
provider ContentProviderClient: the ContentProviderClient that is to be used to communicate with the ContentProvider that contains the sync state.

uri Uri: the uri of the sync state

account Account: the Account whose sync state should be set

data byte: the byte[] that contains the sync state

Throws
RemoteException if there is a failure communicating with the remote ContentProvider

update

Added in API level 5
public static void update (ContentProviderClient provider, 
                Uri uri, 
                byte[] data)

Parameters
provider ContentProviderClient

uri Uri

data byte

Throws
RemoteException

Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Last updated 2026-08-03 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-08-03 UTC."],[],[]]

Web Proxy Viewer  |  New URL  |  Original Page