Fields Summary |
---|
public final String | LOG_TAG |
protected static final boolean | DBG |
private final android.content.Context | mContext |
private final String | mApnType |
private DctConstants.State | mState |
private ArrayList | mWaitingApns |
private ArrayList | mOriginalWaitingApnsUsed to check if conditions (new RAT) are resulting in a new list which warrants a retry.
Set in the last trySetupData call. |
public final int | priority |
private AtomicInteger | mWaitingApnsPermanentFailureCountDownA zero indicates that all waiting APNs had a permanent error |
private ApnSetting | mApnSetting |
DcAsyncChannel | mDcAc |
String | mReason |
android.app.PendingIntent | mReconnectAlarmIntent |
AtomicBoolean | mDataEnableduser/app requested connection on this APN |
private final Object | mRefCountLock |
private int | mRefCount |
AtomicBoolean | mDependencyMetcarrier requirements met |
private final DcTrackerBase | mDcTracker |
private boolean | mConcurrentVoiceAndDataAllowedRemember this as a change in this value to a more permissive state
should cause us to retry even permanent failures |
Methods Summary |
---|
public void | decRefCount()
synchronized (mRefCountLock) {
if (mRefCount-- == 1) {
mDcTracker.setEnabled(mDcTracker.apnTypeToId(mApnType), false);
}
}
|
public void | decWaitingApnsPermFailCount()
mWaitingApnsPermanentFailureCountDown.decrementAndGet();
|
public void | dump(java.io.FileDescriptor fd, java.io.PrintWriter pw, java.lang.String[] args)
pw.println("ApnContext: " + this.toString());
|
public synchronized ApnSetting | getApnSetting()
log("getApnSetting: apnSetting=" + mApnSetting);
return mApnSetting;
|
public java.lang.String | getApnType()
return mApnType;
|
public synchronized DcAsyncChannel | getDcAc()
return mDcAc;
|
public boolean | getDependencyMet()
return mDependencyMet.get();
|
public synchronized ApnSetting | getNextWaitingApn()
ArrayList<ApnSetting> list = mWaitingApns;
ApnSetting apn = null;
if (list != null) {
if (!list.isEmpty()) {
apn = list.get(0);
}
}
return apn;
|
public synchronized java.util.ArrayList | getOriginalWaitingApns()
return mOriginalWaitingApns;
|
public synchronized java.lang.String | getReason()
return mReason;
|
public synchronized android.app.PendingIntent | getReconnectIntent()
return mReconnectAlarmIntent;
|
public synchronized DctConstants.State | getState()
return mState;
|
public synchronized java.util.ArrayList | getWaitingApns()
return mWaitingApns;
|
public int | getWaitingApnsPermFailCount()
return mWaitingApnsPermanentFailureCountDown.get();
|
public void | incRefCount()
synchronized (mRefCountLock) {
if (mRefCount++ == 0) {
mDcTracker.setEnabled(mDcTracker.apnTypeToId(mApnType), true);
}
}
|
public synchronized boolean | isConcurrentVoiceAndDataAllowed()
return mConcurrentVoiceAndDataAllowed;
|
public boolean | isConnectable()
return isReady() && ((mState == DctConstants.State.IDLE)
|| (mState == DctConstants.State.SCANNING)
|| (mState == DctConstants.State.RETRYING)
|| (mState == DctConstants.State.FAILED));
|
public boolean | isConnectedOrConnecting()
return isReady() && ((mState == DctConstants.State.CONNECTED)
|| (mState == DctConstants.State.CONNECTING)
|| (mState == DctConstants.State.SCANNING)
|| (mState == DctConstants.State.RETRYING));
|
public boolean | isDisconnected()
DctConstants.State currentState = getState();
return ((currentState == DctConstants.State.IDLE) ||
currentState == DctConstants.State.FAILED);
|
public boolean | isEnabled()
return mDataEnabled.get();
|
public boolean | isProvisioningApn()
String provisioningApn = mContext.getResources()
.getString(R.string.mobile_provisioning_apn);
if ((mApnSetting != null) && (mApnSetting.apn != null)) {
return (mApnSetting.apn.equals(provisioningApn));
} else {
return false;
}
|
public boolean | isReady()
return mDataEnabled.get() && mDependencyMet.get();
|
protected void | log(java.lang.String s)
Rlog.d(LOG_TAG, "[ApnContext:" + mApnType + "] " + s);
|
public synchronized void | removeWaitingApn(ApnSetting apn)
if (mWaitingApns != null) {
mWaitingApns.remove(apn);
}
|
public synchronized void | setApnSetting(ApnSetting apnSetting)
log("setApnSetting: apnSetting=" + apnSetting);
mApnSetting = apnSetting;
|
public synchronized void | setConcurrentVoiceAndDataAllowed(boolean allowed)
mConcurrentVoiceAndDataAllowed = allowed;
|
public synchronized void | setDataConnectionAc(DcAsyncChannel dcac)
if (DBG) {
log("setDataConnectionAc: old dcac=" + mDcAc + " new dcac=" + dcac
+ " this=" + this);
}
mDcAc = dcac;
|
public void | setDependencyMet(boolean met)
if (DBG) {
log("set mDependencyMet as " + met + " current state is " + mDependencyMet.get());
}
mDependencyMet.set(met);
|
public void | setEnabled(boolean enabled)
if (DBG) {
log("set enabled as " + enabled + ", current state is " + mDataEnabled.get());
}
mDataEnabled.set(enabled);
|
public synchronized void | setReason(java.lang.String reason)
if (DBG) {
log("set reason as " + reason + ",current state " + mState);
}
mReason = reason;
|
public synchronized void | setReconnectIntent(android.app.PendingIntent intent)
mReconnectAlarmIntent = intent;
|
public synchronized void | setState(DctConstants.State s)
if (DBG) {
log("setState: " + s + ", previous state:" + mState);
}
mState = s;
if (mState == DctConstants.State.FAILED) {
if (mWaitingApns != null) {
mWaitingApns.clear(); // when teardown the connection and set to IDLE
}
}
|
public synchronized void | setWaitingApns(java.util.ArrayList waitingApns)
mWaitingApns = waitingApns;
mOriginalWaitingApns = new ArrayList<ApnSetting>(waitingApns);
mWaitingApnsPermanentFailureCountDown.set(mWaitingApns.size());
|
public synchronized java.lang.String | toString()
// We don't print mDataConnection because its recursive.
return "{mApnType=" + mApnType + " mState=" + getState() + " mWaitingApns={" + mWaitingApns +
"} mWaitingApnsPermanentFailureCountDown=" + mWaitingApnsPermanentFailureCountDown +
" mApnSetting={" + mApnSetting + "} mReason=" + mReason +
" mDataEnabled=" + mDataEnabled + " mDependencyMet=" + mDependencyMet + "}";
|