RetryPolicy.RetryConfig
@ExperimentalRetryPolicy
class RetryPolicy.RetryConfig
Represents the outcome of a RetryPolicy decision.
Summary
Nested types |
|---|
|
A builder class for creating and customizing |
Constants |
|
|---|---|
const RetryPolicy.RetryConfig |
A RetryConfig indicating that the initialization should be retried after the default delay (determined by |
const RetryPolicy.RetryConfig |
A RetryConfig indicating that the initialization should be retried after a minimum delay of 100 milliseconds. |
const RetryPolicy.RetryConfig |
A RetryConfig indicating that no further retries should be attempted. |
Public functions |
|
|---|---|
java-static Long |
Returns the recommended default delay to optimize retry attempts and camera recovery. |
Long |
Gets the delay time in milliseconds before the next retry attempt should be made. |
Boolean |
Determines whether the initialization should be retried. |
Constants
DEFAULT_DELAY_RETRY
const val DEFAULT_DELAY_RETRY: RetryPolicy.RetryConfig
A RetryConfig indicating that the initialization should be retried after the default delay (determined by getDefaultRetryDelayInMillis). This delay provides sufficient time for typical device recovery processes, balancing retry efficiency and minimizing user wait time.
MINI_DELAY_RETRY
const val MINI_DELAY_RETRY: RetryPolicy.RetryConfig
A RetryConfig indicating that the initialization should be retried after a minimum delay of 100 milliseconds. This short delay serves two purposes:
- Reduced Latency: Minimizes the wait time for the camera to become available, improving user experience.
- Camera Self-Recovery: Provides a brief window for the camera to potentially recover from temporary issues.
NOT_RETRY
const val NOT_RETRY: RetryPolicy.RetryConfig
A RetryConfig indicating that no further retries should be attempted.
Public functions
getDefaultRetryDelayInMillis
java-static fun getDefaultRetryDelayInMillis(): Long
Returns the recommended default delay to optimize retry attempts and camera recovery.
| Returns | |
|---|---|
Long |
The default delay value, carefully calibrated based on extensive lab testing to:
|
getRetryDelayInMillis
fun getRetryDelayInMillis(): Long
Gets the delay time in milliseconds before the next retry attempt should be made.
| Returns | |
|---|---|
Long |
The delay time in milliseconds. |
shouldRetry
fun shouldRetry(): Boolean
Determines whether the initialization should be retried.
| Returns | |
|---|---|
Boolean |
true if the initialization should be retried, false otherwise. |