RetryPolicy.RetryConfig
@ExperimentalRetryPolicy
public final class RetryPolicy.RetryConfig
Represents the outcome of a RetryPolicy decision.
Summary
Nested types |
|---|
@ExperimentalRetryPolicyA builder class for creating and customizing |
Constants |
|
|---|---|
static final @NonNull RetryPolicy.RetryConfig |
A RetryConfig indicating that the initialization should be retried after the default delay (determined by |
static final @NonNull RetryPolicy.RetryConfig |
A RetryConfig indicating that the initialization should be retried after a minimum delay of 100 milliseconds. |
static final @NonNull RetryPolicy.RetryConfig |
A RetryConfig indicating that no further retries should be attempted. |
Public methods |
|
|---|---|
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
public static final @NonNull RetryPolicy.RetryConfig DEFAULT_DELAY_RETRY
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
public static final @NonNull RetryPolicy.RetryConfig MINI_DELAY_RETRY
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
public static final @NonNull RetryPolicy.RetryConfig NOT_RETRY
A RetryConfig indicating that no further retries should be attempted.
Public methods
getDefaultRetryDelayInMillis
public static long getDefaultRetryDelayInMillis()
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
public long getRetryDelayInMillis()
Gets the delay time in milliseconds before the next retry attempt should be made.
| Returns | |
|---|---|
long |
The delay time in milliseconds. |
shouldRetry
public boolean shouldRetry()
Determines whether the initialization should be retried.
| Returns | |
|---|---|
boolean |
true if the initialization should be retried, false otherwise. |