public class RetryManager extends Object
The format of the configuration string is the apn type followed by a series of parameters separated by a comma. There are two name value pair parameters plus a series of delay times. The units of of these delay times is unspecified. The name value pairs which may be specified are:
apn type specifies the APN type that the retry pattern will apply for. "others" is for all other APN types not specified in the config. max_retries is the number of times that incrementRetryCount maybe called before isRetryNeeded will return false. if value is infinite then isRetryNeeded will always return true. default_randomizationTime will be used as the randomizationTime for delay times which have no supplied randomizationTime. If default_randomizationTime is not defined it defaults to 0.
The other parameters define The series of delay times and each may have an optional randomization value separated from the delay time by a colon.
Examples:
"mms:1000, 2000, 3000"
"default:max_retries=10, default_randomization=500, 1000, 2000, 3000"
"supl:default_randomization=100, 1000, 2000, 4000:500, 5000:500"
"others:max_retries=infinite,1000,2000,3000
Modifier and Type | Field and Description |
---|---|
static boolean |
DBG |
static String |
LOG_TAG |
static long |
NO_RETRY
The value indicating no retry is needed
|
static long |
NO_SUGGESTED_RETRY_DELAY
The value indicating modem did not suggest any retry delay
|
static boolean |
VDBG |
Constructor and Description |
---|
RetryManager(Phone phone,
String apnType)
Retry manager constructor
|
Modifier and Type | Method and Description |
---|---|
void |
dump(FileDescriptor fd,
PrintWriter pw,
String[] args) |
long |
getDelayForNextApn(boolean failFastEnabled)
Get the delay for trying the next waiting APN from the list.
|
long |
getInterApnDelay(boolean failFastEnabled)
Get the delay between APN setting trying.
|
ApnSetting |
getNextApnSetting()
Get the next APN setting for data call setup.
|
ArrayList<ApnSetting> |
getWaitingApns()
Get the list of waiting APNs.
|
void |
markApnPermanentFailed(ApnSetting apn)
Mark the APN setting permanently failed.
|
void |
setModemSuggestedDelay(long delay)
Save the modem suggested delay for retrying the current APN.
|
void |
setWaitingApns(ArrayList<ApnSetting> waitingApns)
Set waiting APNs for retrying in case needed.
|
String |
toString()
Returns a string representation of the object.
|
public static final String LOG_TAG
public static final boolean DBG
public static final boolean VDBG
public static final long NO_RETRY
public static final long NO_SUGGESTED_RETRY_DELAY
public ApnSetting getNextApnSetting()
public long getDelayForNextApn(boolean failFastEnabled)
failFastEnabled
- True if fail fast mode enabled. In this case we'll use a shorter
delay.public void markApnPermanentFailed(ApnSetting apn)
apn
- APN setting to be marked as permanently failedpublic void setWaitingApns(ArrayList<ApnSetting> waitingApns)
waitingApns
- Waiting APN listpublic ArrayList<ApnSetting> getWaitingApns()
public void setModemSuggestedDelay(long delay)
delay
- The delay in millisecondspublic long getInterApnDelay(boolean failFastEnabled)
failFastEnabled
- True if fail fast mode enabled, which a shorter delay will be usedpublic String toString()
Object
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@
', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
public void dump(FileDescriptor fd, PrintWriter pw, String[] args)