Skip to content

Commit c97d0e4

Browse files
Wink SavilleAndroid (Google) Code Review
authored andcommitted
Merge "Support suggestedRetryTime in CDMA DCT" into ics-mr1
2 parents 705665a + 6de972a commit c97d0e4

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
import com.android.internal.telephony.DataConnectionTracker;
4242
import com.android.internal.telephony.EventLogTags;
4343
import com.android.internal.telephony.RetryManager;
44+
import com.android.internal.telephony.RILConstants;
4445
import com.android.internal.telephony.Phone;
4546
import com.android.internal.util.AsyncChannel;
4647

@@ -506,17 +507,20 @@ private boolean retryAfterDisconnected(String reason) {
506507
return retry;
507508
}
508509

509-
private void reconnectAfterFail(FailCause lastFailCauseCode, String reason) {
510+
private void reconnectAfterFail(FailCause lastFailCauseCode, String reason, int retryOverride) {
510511
if (mState == State.FAILED) {
511512
/**
512513
* For now With CDMA we never try to reconnect on
513514
* error and instead just continue to retry
514515
* at the last time until the state is changed.
515516
* TODO: Make this configurable?
516517
*/
517-
int nextReconnectDelay = mDataConnections.get(0).getRetryTimer();
518+
int nextReconnectDelay = retryOverride;
519+
if (nextReconnectDelay < 0) {
520+
nextReconnectDelay = mDataConnections.get(0).getRetryTimer();
521+
mDataConnections.get(0).increaseRetryCount();
522+
}
518523
startAlarmForReconnect(nextReconnectDelay, reason);
519-
mDataConnections.get(0).increaseRetryCount();
520524

521525
if (!shouldPostNotification(lastFailCauseCode)) {
522526
log("NOT Posting Data Connection Unavailable notification "
@@ -674,7 +678,17 @@ protected void onDataSetupComplete(AsyncResult ar) {
674678
notifyNoData(cause);
675679
return;
676680
}
677-
startDelayedRetry(cause, reason);
681+
682+
int retryOverride = -1;
683+
if (ar.exception instanceof DataConnection.CallSetupException) {
684+
retryOverride =
685+
((DataConnection.CallSetupException)ar.exception).getRetryOverride();
686+
}
687+
if (retryOverride == RILConstants.MAX_INT) {
688+
if (DBG) log("No retry is suggested.");
689+
} else {
690+
startDelayedRetry(cause, reason, retryOverride);
691+
}
678692
}
679693
}
680694

@@ -907,9 +921,9 @@ protected void onDataStateChanged(AsyncResult ar) {
907921
}
908922
}
909923

910-
private void startDelayedRetry(FailCause cause, String reason) {
924+
private void startDelayedRetry(FailCause cause, String reason, int retryOverride) {
911925
notifyNoData(cause);
912-
reconnectAfterFail(cause, reason);
926+
reconnectAfterFail(cause, reason, retryOverride);
913927
}
914928

915929
@Override

0 commit comments

Comments
 (0)