Package com.microej.kernel.green.ntp
Class RetryHelper
- java.lang.Object
-
- com.microej.kernel.green.ntp.RetryHelper
-
public class RetryHelper extends java.lang.Object
Utility class to handle fail and retry process in case time can't be retrieved or connectivityManager is null.
-
-
Constructor Summary
Constructors Constructor Description RetryHelper(NTPService retryUpdate, int period, int maxAttempt)
Instantiates aRetryHelper
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
scheduleRetryUpdate(long delay, long period)
Schedule an update.void
stop()
Stops the retry.
-
-
-
Constructor Detail
-
RetryHelper
public RetryHelper(@NonNull NTPService retryUpdate, int period, int maxAttempt)
Instantiates aRetryHelper
.- Parameters:
retryUpdate
- the callback to be called to try updating the time.period
- the period in milliseconds between two retry.maxAttempt
- the max attempts (0 for infinite).
-
-