public class ApnContext extends Object
Modifier and Type | Field and Description |
---|---|
protected static boolean |
DBG |
String |
LOG_TAG |
int |
priority |
Constructor and Description |
---|
ApnContext(Phone phone,
String apnType,
String logTag,
NetworkConfig config,
DcTracker tracker)
AonContext constructor
|
Modifier and Type | Method and Description |
---|---|
static int |
apnIdForApnName(String type) |
static int |
apnIdForNetworkRequest(NetworkRequest nr) |
static int |
apnIdForType(int networkType) |
void |
dump(FileDescriptor fd,
PrintWriter printWriter,
String[] args) |
ApnSetting |
getApnSetting()
Get the current APN setting.
|
String |
getApnType()
Get the APN type
|
int |
getConnectionGeneration() |
DcAsyncChannel |
getDcAc()
Get the data call async channel.
|
long |
getDelayForNextApn(boolean failFastEnabled)
Get the delay for trying the next APN setting if the current one failed.
|
boolean |
getDependencyMet() |
long |
getInterApnDelay(boolean failFastEnabled) |
List<NetworkRequest> |
getNetworkRequests() |
ApnSetting |
getNextApnSetting()
Get the next available APN to try.
|
String |
getReason()
Get the reason for data call connection.
|
PendingIntent |
getReconnectIntent()
Get the reconnect intent.
|
DctConstants.State |
getState()
Get the current data call state.
|
ArrayList<ApnSetting> |
getWaitingApns()
Get the list of waiting APNs.
|
boolean |
hasNoRestrictedRequests(boolean excludeDun) |
int |
incAndGetConnectionGeneration() |
boolean |
isConcurrentVoiceAndDataAllowed()
Get the state indicating concurrent voice/data allowed.
|
boolean |
isConnectable()
Check if the data call is in the state which allow connecting.
|
boolean |
isConnectedOrConnecting()
Check if the data call is in connected or connecting state.
|
boolean |
isDisconnected()
Check whether the data call is disconnected or not.
|
boolean |
isEnabled()
Check if the data call is enabled or not.
|
boolean |
isProvisioningApn() |
boolean |
isReady()
Check if ready for data call connection
|
void |
markApnPermanentFailed(ApnSetting apn)
Mark the current APN setting permanently failed, which means it will not be retried anymore.
|
void |
releaseDataConnection(String reason)
Release data connection.
|
void |
releaseNetwork(NetworkRequest networkRequest,
LocalLog log) |
void |
requestLog(String str) |
void |
requestNetwork(NetworkRequest networkRequest,
LocalLog log) |
void |
resetErrorCodeRetries() |
boolean |
restartOnError(int errorCode) |
void |
setApnSetting(ApnSetting apnSetting)
Set the APN setting.
|
void |
setConcurrentVoiceAndDataAllowed(boolean allowed)
Save the state indicating concurrent voice/data allowed.
|
void |
setDataConnectionAc(DcAsyncChannel dcac)
Set the data call async channel.
|
void |
setDependencyMet(boolean met) |
void |
setEnabled(boolean enabled)
Set data call enabled/disabled state.
|
void |
setModemSuggestedDelay(long delay)
Save the modem suggested delay for retrying the current APN.
|
void |
setReason(String reason)
Set the reason for data call connection.
|
void |
setReconnectIntent(PendingIntent intent)
Save the reconnect intent which can be used for cancelling later.
|
void |
setState(DctConstants.State s)
Set the current data call state.
|
void |
setWaitingApns(ArrayList<ApnSetting> waitingApns)
Set the list of APN candidates which will be used for data call setup later.
|
String |
toString()
Returns a string representation of the object.
|
public final String LOG_TAG
protected static final boolean DBG
public final int priority
public ApnContext(Phone phone, String apnType, String logTag, NetworkConfig config, DcTracker tracker)
phone
- phone objectapnType
- APN type (e.g. default, supl, mms, etc...)logTag
- Tag for loggingconfig
- Network configurationtracker
- Data call trackerpublic String getApnType()
public DcAsyncChannel getDcAc()
public void setDataConnectionAc(DcAsyncChannel dcac)
dcac
- The data call async channelpublic void releaseDataConnection(String reason)
reason
- The reason of releasing data connectionpublic PendingIntent getReconnectIntent()
public void setReconnectIntent(PendingIntent intent)
intent
- The reconnect intentpublic ApnSetting getApnSetting()
public void setApnSetting(ApnSetting apnSetting)
apnSetting
- APN settingpublic void setWaitingApns(ArrayList<ApnSetting> waitingApns)
waitingApns
- List of APN candidatespublic ApnSetting getNextApnSetting()
public void setModemSuggestedDelay(long delay)
delay
- The delay in millisecondspublic 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 settingpublic ArrayList<ApnSetting> getWaitingApns()
public void setConcurrentVoiceAndDataAllowed(boolean allowed)
allowed
- True if concurrent voice/data is allowedpublic boolean isConcurrentVoiceAndDataAllowed()
public void setState(DctConstants.State s)
s
- Current data call statepublic DctConstants.State getState()
public boolean isDisconnected()
public void setReason(String reason)
reason
- Reason for data call connectionpublic String getReason()
public boolean isReady()
public boolean isConnectable()
public boolean isConnectedOrConnecting()
public void setEnabled(boolean enabled)
enabled
- True if data call is enabledpublic boolean isEnabled()
public void setDependencyMet(boolean met)
public boolean getDependencyMet()
public boolean isProvisioningApn()
public void requestLog(String str)
public void requestNetwork(NetworkRequest networkRequest, LocalLog log)
public void releaseNetwork(NetworkRequest networkRequest, LocalLog log)
public List<NetworkRequest> getNetworkRequests()
public boolean hasNoRestrictedRequests(boolean excludeDun)
public void resetErrorCodeRetries()
public boolean restartOnError(int errorCode)
public int incAndGetConnectionGeneration()
public int getConnectionGeneration()
public long getInterApnDelay(boolean failFastEnabled)
public static int apnIdForType(int networkType)
public static int apnIdForNetworkRequest(NetworkRequest nr)
public static int apnIdForApnName(String type)
public 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 printWriter, String[] args)