# FontRequestEmojiCompatConfig.ExponentialBackoffRetryPolicy

# FontRequestEmojiCompatConfig.ExponentialBackoffRetryPolicy

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.ExponentialBackoffRetryPolicy)  
Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/emoji2#1.0.0)

*** ** * ** ***

Kotlin \|[Java](https://developer.android.com/reference/androidx/emoji2/text/FontRequestEmojiCompatConfig.ExponentialBackoffRetryPolicy "View this page in Java")


```
class FontRequestEmojiCompatConfig.ExponentialBackoffRetryPolicy : FontRequestEmojiCompatConfig.RetryPolicy
```

<br />

|---|---|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)                                                                                                                                      |||
| ↳ | [androidx.emoji2.text.FontRequestEmojiCompatConfig.RetryPolicy](https://developer.android.com/reference/kotlin/androidx/emoji2/text/FontRequestEmojiCompatConfig.RetryPolicy)                                        ||
|   | ↳ | [androidx.emoji2.text.FontRequestEmojiCompatConfig.ExponentialBackoffRetryPolicy](https://developer.android.com/reference/kotlin/androidx/emoji2/text/FontRequestEmojiCompatConfig.ExponentialBackoffRetryPolicy) |

*** ** * ** ***

A retry policy implementation that doubles the amount of time in between retries. If downloading hasn't finish within given amount of time, this policy give up and the EmojiCompat will get into [LOAD_STATE_FAILED](https://developer.android.com/reference/kotlin/androidx/emoji2/text/EmojiCompat#LOAD_STATE_FAILED()) state.

## Summary

|                                                                                                                                     ### Public constructors                                                                                                                                     |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ExponentialBackoffRetryPolicy](https://developer.android.com/reference/kotlin/androidx/emoji2/text/FontRequestEmojiCompatConfig.ExponentialBackoffRetryPolicy#ExponentialBackoffRetryPolicy(long))`(totalMs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`)` |

|                             ### Public functions                              |
|-------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | [getRetryDelay](https://developer.android.com/reference/kotlin/androidx/emoji2/text/FontRequestEmojiCompatConfig.ExponentialBackoffRetryPolicy#getRetryDelay())`()` Called each time the metadata loading fails. |

## Public constructors

### ExponentialBackoffRetryPolicy

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

```
ExponentialBackoffRetryPolicy(totalMs: Long)
```  

|                                        Parameters                                        |
|------------------------------------------------------------------------------------------|-------------------------------------------------|
| `totalMs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | A total amount of time to wait in milliseconds. |

## Public functions

### getRetryDelay

```
fun getRetryDelay(): Long
```

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 [LOAD_STATE_FAILED](https://developer.android.com/reference/kotlin/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](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | long milliseconds to wait until next retry |