Skip to content
This repository has been archived by the owner on Jan 27, 2025. It is now read-only.

Commit

Permalink
Add fix and add some debugging.
Browse files Browse the repository at this point in the history
Bug: 8492574
Change-Id: I9cb1ab4ec3efb8186a4dd83736781835e1847720
  • Loading branch information
Wink Saville committed Mar 28, 2013
1 parent 1f2a232 commit c3b7c73
Showing 1 changed file with 30 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1146,7 +1146,10 @@ public boolean processMessage(Message msg) {
+ " != cp:" + cp);
}
}
if (DBG) log("DcActivatingState onSetupConnectionCompleted result=" + result);
if (DBG) {
log("DcActivatingState onSetupConnectionCompleted result=" + result
+ " dc=" + DataConnection.this);
}
switch (result) {
case SUCCESS:
// All is well
Expand All @@ -1173,6 +1176,11 @@ public boolean processMessage(Message msg) {
case ERR_RilError:
int delay = mDcRetryAlarmController.getSuggestedRetryTime(
DataConnection.this, ar);
if (DBG) {
log("DcActivatingState: ERR_RilError "
+ " delay=" + delay
+ " isRetryNeeded=" + mRetryManager.isRetryNeeded());
}
if (delay >= 0) {
mDcRetryAlarmController.startRetryAlarm(EVENT_RETRY_CONNECTION,
mTag, delay);
Expand Down Expand Up @@ -1203,17 +1211,20 @@ public boolean processMessage(Message msg) {

DcFailCause cause = DcFailCause.UNKNOWN;

if (DBG) {
log("DcActivatingState msg.what=EVENT_GET_LAST_FAIL_DONE"
+ " RefCount=" + mApnContexts.size());
}
if (ar.exception == null) {
int rilFailCause = ((int[]) (ar.result))[0];
cause = DcFailCause.fromInt(rilFailCause);
}
mDcFailCause = cause;

int retryDelay = mRetryManager.getRetryTimer();
if (DBG) {
log("DcActivatingState msg.what=EVENT_GET_LAST_FAIL_DONE"
+ " cause=" + cause
+ " retryDelay=" + retryDelay
+ " isRetryNeeded=" + mRetryManager.isRetryNeeded()
+ " dc=" + DataConnection.this);
}
if (mRetryManager.isRetryNeeded()) {
mDcRetryAlarmController.startRetryAlarm(EVENT_RETRY_CONNECTION, mTag,
retryDelay);
Expand Down Expand Up @@ -1277,9 +1288,11 @@ public boolean processMessage(Message msg) {
switch (msg.what) {
case EVENT_CONNECT: {
ConnectionParams cp = (ConnectionParams) msg.obj;
if (DBG) {
log("DcActiveState: EVENT_CONNECT cp=" + cp + " dc=" + DataConnection.this);
}
if (mApnContexts.contains(cp.mApnContext)) {
log("DcActiveState ERROR already added apnContext=" + cp.mApnContext
+ " to this DC=" + this);
log("DcActiveState ERROR already added apnContext=" + cp.mApnContext);
} else {
mApnContexts.add(cp.mApnContext);
if (DBG) {
Expand All @@ -1293,6 +1306,10 @@ public boolean processMessage(Message msg) {
}
case EVENT_DISCONNECT: {
DisconnectParams dp = (DisconnectParams) msg.obj;
if (DBG) {
log("DcActiveState: EVENT_DISCONNECT dp=" + dp
+ " dc=" + DataConnection.this);
}
if (mApnContexts.contains(dp.mApnContext)) {
if (DBG) {
log("DcActiveState msg.what=EVENT_DISCONNECT RefCount="
Expand All @@ -1312,16 +1329,16 @@ public boolean processMessage(Message msg) {
}
} else {
log("DcActiveState ERROR no such apnContext=" + dp.mApnContext
+ " in this DC=" + this);
+ " in this dc=" + DataConnection.this);
notifyDisconnectCompleted(dp, false);
}
retVal = HANDLED;
break;
}
case EVENT_DISCONNECT_ALL: {
if (DBG) {
log("DcActiveState msg.what=EVENT_DISCONNECT_ALL RefCount="
+ mApnContexts.size() + " clearing apn contexts");
log("DcActiveState EVENT_DISCONNECT clearing apn contexts,"
+ " dc=" + DataConnection.this);
}
mApnContexts.clear();
DisconnectParams dp = (DisconnectParams) msg.obj;
Expand All @@ -1334,6 +1351,9 @@ public boolean processMessage(Message msg) {
break;
}
case EVENT_LOST_CONNECTION: {
if (DBG) {
log("DcActiveState EVENT_LOST_CONNECTION dc=" + DataConnection.this);
}
if (mRetryManager.isRetryNeeded()) {
// We're going to retry
int delayMillis = mRetryManager.getRetryTimer();
Expand Down

0 comments on commit c3b7c73

Please sign in to comment.