Skip to content

Commit 7da207b

Browse files
Wink SavilleAndroid Git Automerger
authored andcommitted
am a3534ad: am c97d0e4: Merge "Support suggestedRetryTime in CDMA DCT" into ics-mr1
* commit 'a3534ad4a4b936a2629f4a0b854b814b3494ac7e': Support suggestedRetryTime in CDMA DCT
2 parents 39f0554 + a3534ad commit 7da207b

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
import com.android.internal.telephony.RILConstants;
@@ -511,17 +512,20 @@ private boolean retryAfterDisconnected(String reason) {
511512
return retry;
512513
}
513514

514-
private void reconnectAfterFail(FailCause lastFailCauseCode, String reason) {
515+
private void reconnectAfterFail(FailCause lastFailCauseCode, String reason, int retryOverride) {
515516
if (mState == State.FAILED) {
516517
/**
517518
* For now With CDMA we never try to reconnect on
518519
* error and instead just continue to retry
519520
* at the last time until the state is changed.
520521
* TODO: Make this configurable?
521522
*/
522-
int nextReconnectDelay = mDataConnections.get(0).getRetryTimer();
523+
int nextReconnectDelay = retryOverride;
524+
if (nextReconnectDelay < 0) {
525+
nextReconnectDelay = mDataConnections.get(0).getRetryTimer();
526+
mDataConnections.get(0).increaseRetryCount();
527+
}
523528
startAlarmForReconnect(nextReconnectDelay, reason);
524-
mDataConnections.get(0).increaseRetryCount();
525529

526530
if (!shouldPostNotification(lastFailCauseCode)) {
527531
log("NOT Posting Data Connection Unavailable notification "
@@ -679,7 +683,17 @@ protected void onDataSetupComplete(AsyncResult ar) {
679683
notifyNoData(cause);
680684
return;
681685
}
682-
startDelayedRetry(cause, reason);
686+
687+
int retryOverride = -1;
688+
if (ar.exception instanceof DataConnection.CallSetupException) {
689+
retryOverride =
690+
((DataConnection.CallSetupException)ar.exception).getRetryOverride();
691+
}
692+
if (retryOverride == RILConstants.MAX_INT) {
693+
if (DBG) log("No retry is suggested.");
694+
} else {
695+
startDelayedRetry(cause, reason, retryOverride);
696+
}
683697
}
684698
}
685699

@@ -912,9 +926,9 @@ protected void onDataStateChanged(AsyncResult ar) {
912926
}
913927
}
914928

915-
private void startDelayedRetry(FailCause cause, String reason) {
929+
private void startDelayedRetry(FailCause cause, String reason, int retryOverride) {
916930
notifyNoData(cause);
917-
reconnectAfterFail(cause, reason);
931+
reconnectAfterFail(cause, reason, retryOverride);
918932
}
919933

920934
@Override

0 commit comments

Comments
 (0)