# FontRequestEmojiCompatConfig.RetryPolicy

Artifact: [androidx.emoji2:emoji2](https://developer.android.com/jetpack/androidx/releases/emoji2) [View Source](https://cs.android.com/search?q=file:androidx/emoji2/text/FontRequestEmojiCompatConfig.java+class:androidx.emoji2.text.FontRequestEmojiCompatConfig.RetryPolicy) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/emoji2#1.0.0)

*** ** * ** ***


```
public abstract class FontRequestEmojiCompatConfig.RetryPolicy
```

<br />

Known direct subclasses [FontRequestEmojiCompatConfig.ExponentialBackoffRetryPolicy](https://developer.android.com/reference/androidx/emoji2/text/FontRequestEmojiCompatConfig.ExponentialBackoffRetryPolicy)

|---|---|
| `https://developer.android.com/reference/androidx/emoji2/text/FontRequestEmojiCompatConfig.ExponentialBackoffRetryPolicy` | A retry policy implementation that doubles the amount of time in between retries. |

*** ** * ** ***

Retry policy used when the font provider is not ready to give the font file. To control the thread the retries are handled on, see `https://developer.android.com/reference/androidx/emoji2/text/FontRequestEmojiCompatConfig#setLoadingExecutor(java.util.concurrent.Executor)`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/emoji2/text/FontRequestEmojiCompatConfig.RetryPolicy#RetryPolicy()()` |

| ### Public methods |
|---|---|
| `abstract long` | `https://developer.android.com/reference/androidx/emoji2/text/FontRequestEmojiCompatConfig.RetryPolicy#getRetryDelay()()` Called each time the metadata loading fails. |

## Public constructors

### RetryPolicy

Added in 1.0.0

```
public RetryPolicy()
```

## Public methods

### getRetryDelay

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/emoji2#1.0.0)

```
public abstract long getRetryDelay()
```

Called each time the metadata loading fails. This is primarily due to a pending download of the font. If a value larger than zero is returned, metadata loader will retry after the given milliseconds. If `zero` is returned, metadata loader will retry immediately. If a value less than 0 is returned, the metadata loader will stop retrying and EmojiCompat will get into `https://developer.android.com/reference/androidx/emoji2/text/EmojiCompat#LOAD_STATE_FAILED()` state.
Note that the retry may happen earlier than you specified if the font provider notifies that the download is completed.

| Returns |
|---|---|
| `long` | long milliseconds to wait until next retry |