Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Ctors](https://developer.android.com/reference/android/provider/SyncStateContract.Helpers#pubctors) \| [Methods](https://developer.android.com/reference/android/provider/SyncStateContract.Helpers#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/provider/SyncStateContract.Helpers#inhmethods)

# SyncStateContract.Helpers

*** ** * ** ***


`
public
static
final

class
SyncStateContract.Helpers
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.provider.SyncStateContract.Helpers |

<br />

*** ** * ** ***

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/provider/SyncStateContract.Helpers#Helpers()() ` |

| ### Public methods ||
|---|---|
| ` static byte[]` | ` https://developer.android.com/reference/android/provider/SyncStateContract.Helpers#get(android.content.ContentProviderClient,%20android.net.Uri,%20android.accounts.Account)(https://developer.android.com/reference/android/content/ContentProviderClient provider, https://developer.android.com/reference/android/net/Uri uri, https://developer.android.com/reference/android/accounts/Account account) ` Get the sync state that is associated with the account or null. |
| ` static https://developer.android.com/reference/android/util/Pair<https://developer.android.com/reference/android/net/Uri, byte[]>` | ` https://developer.android.com/reference/android/provider/SyncStateContract.Helpers#getWithUri(android.content.ContentProviderClient,%20android.net.Uri,%20android.accounts.Account)(https://developer.android.com/reference/android/content/ContentProviderClient provider, https://developer.android.com/reference/android/net/Uri uri, https://developer.android.com/reference/android/accounts/Account account) ` |
| ` static https://developer.android.com/reference/android/net/Uri` | ` https://developer.android.com/reference/android/provider/SyncStateContract.Helpers#insert(android.content.ContentProviderClient,%20android.net.Uri,%20android.accounts.Account,%20byte[])(https://developer.android.com/reference/android/content/ContentProviderClient provider, https://developer.android.com/reference/android/net/Uri uri, https://developer.android.com/reference/android/accounts/Account account, byte[] data) ` |
| ` static https://developer.android.com/reference/android/content/ContentProviderOperation` | ` https://developer.android.com/reference/android/provider/SyncStateContract.Helpers#newSetOperation(android.net.Uri,%20android.accounts.Account,%20byte[])(https://developer.android.com/reference/android/net/Uri uri, https://developer.android.com/reference/android/accounts/Account account, byte[] data) ` Creates and returns a ContentProviderOperation that assigns the data array as the sync state for the given account. |
| ` static https://developer.android.com/reference/android/content/ContentProviderOperation` | ` https://developer.android.com/reference/android/provider/SyncStateContract.Helpers#newUpdateOperation(android.net.Uri,%20byte[])(https://developer.android.com/reference/android/net/Uri uri, byte[] data) ` Creates and returns a ContentProviderOperation that assigns the data array as the sync state for the given account. |
| ` static void` | ` https://developer.android.com/reference/android/provider/SyncStateContract.Helpers#set(android.content.ContentProviderClient,%20android.net.Uri,%20android.accounts.Account,%20byte[])(https://developer.android.com/reference/android/content/ContentProviderClient provider, https://developer.android.com/reference/android/net/Uri uri, https://developer.android.com/reference/android/accounts/Account account, byte[] data) ` Assigns the data array as the sync state for the given account. |
| ` static void` | ` https://developer.android.com/reference/android/provider/SyncStateContract.Helpers#update(android.content.ContentProviderClient,%20android.net.Uri,%20byte[])(https://developer.android.com/reference/android/content/ContentProviderClient provider, https://developer.android.com/reference/android/net/Uri uri, byte[] data) ` |

| ### Inherited methods |
|---|---|
| From class ` https://developer.android.com/reference/java/lang/Object ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/lang/Object#clone()() ` Creates and returns a copy of this object. | | ` boolean` | ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. | | ` void` | ` https://developer.android.com/reference/java/lang/Object#finalize()() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final https://developer.android.com/reference/java/lang/Class<?>` | ` https://developer.android.com/reference/java/lang/Object#getClass()() ` Returns the runtime class of this `Object`. | | ` int` | ` https://developer.android.com/reference/java/lang/Object#hashCode()() ` Returns a hash code value for the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notify()() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notifyAll()() ` Wakes up all threads that are waiting on this object's monitor. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/lang/Object#toString()() ` Returns a string representation of the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait()() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||

## Public constructors

### Helpers

```
public Helpers ()
```

<br />

<br />

## Public methods

### get

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

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

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

<br />

| Parameters ||
|---|---|
| `provider` | `ContentProviderClient`: the `https://developer.android.com/reference/android/content/ContentProviderClient` that is to be used to communicate with the `https://developer.android.com/reference/android/content/ContentProvider` that contains the sync state. <br /> |
| `uri` | `Uri`: the uri of the sync state <br /> |
| `account` | `Account`: the `https://developer.android.com/reference/android/accounts/Account` whose sync state should be returned <br /> |

| Returns ||
|---|---|
| `byte[]` | the sync state or null if there is no sync state associated with the account <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/os/RemoteException` | if there is a failure communicating with the remote `https://developer.android.com/reference/android/content/ContentProvider` |

### getWithUri

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static Pair<Uri, byte[]> getWithUri (ContentProviderClient provider, 
                Uri uri, 
                Account account)
```

<br />

<br />

| Parameters ||
|---|---|
| `provider` | `ContentProviderClient` <br /> |
| `uri` | `Uri` <br /> |
| `account` | `Account` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/util/Pair<https://developer.android.com/reference/android/net/Uri, byte[]>` | <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/os/RemoteException` |   |

### insert

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static Uri insert (ContentProviderClient provider, 
                Uri uri, 
                Account account, 
                byte[] data)
```

<br />

<br />

| Parameters ||
|---|---|
| `provider` | `ContentProviderClient` <br /> |
| `uri` | `Uri` <br /> |
| `account` | `Account` <br /> |
| `data` | `byte` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/Uri` | <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/os/RemoteException` |   |

### newSetOperation

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
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.

<br />

| Parameters ||
|---|---|
| `uri` | `Uri`: the uri of the sync state <br /> |
| `account` | `Account`: the `https://developer.android.com/reference/android/accounts/Account` whose sync state should be set <br /> |
| `data` | `byte`: the byte\[\] that contains the sync state <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/ContentProviderOperation` | the new ContentProviderOperation that assigns the data array as the account's sync state <br /> |

### newUpdateOperation

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
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.

<br />

| Parameters ||
|---|---|
| `uri` | `Uri`: the uri of the specific sync state to set <br /> |
| `data` | `byte`: the byte\[\] that contains the sync state <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/ContentProviderOperation` | the new ContentProviderOperation that assigns the data array as the account's sync state <br /> |

### set

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

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

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

<br />

| Parameters ||
|---|---|
| `provider` | `ContentProviderClient`: the `https://developer.android.com/reference/android/content/ContentProviderClient` that is to be used to communicate with the `https://developer.android.com/reference/android/content/ContentProvider` that contains the sync state. <br /> |
| `uri` | `Uri`: the uri of the sync state <br /> |
| `account` | `Account`: the `https://developer.android.com/reference/android/accounts/Account` whose sync state should be set <br /> |
| `data` | `byte`: the byte\[\] that contains the sync state <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/os/RemoteException` | if there is a failure communicating with the remote `https://developer.android.com/reference/android/content/ContentProvider` |

### update

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

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

<br />

<br />

| Parameters ||
|---|---|
| `provider` | `ContentProviderClient` <br /> |
| `uri` | `Uri` <br /> |
| `data` | `byte` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/os/RemoteException` |   |