|
41 | 41 | import com.android.internal.telephony.DataConnectionTracker; |
42 | 42 | import com.android.internal.telephony.EventLogTags; |
43 | 43 | import com.android.internal.telephony.RetryManager; |
| 44 | +import com.android.internal.telephony.RILConstants; |
44 | 45 | import com.android.internal.telephony.Phone; |
45 | 46 | import com.android.internal.util.AsyncChannel; |
46 | 47 | import com.android.internal.telephony.RILConstants; |
@@ -511,17 +512,20 @@ private boolean retryAfterDisconnected(String reason) { |
511 | 512 | return retry; |
512 | 513 | } |
513 | 514 |
|
514 | | - private void reconnectAfterFail(FailCause lastFailCauseCode, String reason) { |
| 515 | + private void reconnectAfterFail(FailCause lastFailCauseCode, String reason, int retryOverride) { |
515 | 516 | if (mState == State.FAILED) { |
516 | 517 | /** |
517 | 518 | * For now With CDMA we never try to reconnect on |
518 | 519 | * error and instead just continue to retry |
519 | 520 | * at the last time until the state is changed. |
520 | 521 | * TODO: Make this configurable? |
521 | 522 | */ |
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 | + } |
523 | 528 | startAlarmForReconnect(nextReconnectDelay, reason); |
524 | | - mDataConnections.get(0).increaseRetryCount(); |
525 | 529 |
|
526 | 530 | if (!shouldPostNotification(lastFailCauseCode)) { |
527 | 531 | log("NOT Posting Data Connection Unavailable notification " |
@@ -679,7 +683,17 @@ protected void onDataSetupComplete(AsyncResult ar) { |
679 | 683 | notifyNoData(cause); |
680 | 684 | return; |
681 | 685 | } |
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 | + } |
683 | 697 | } |
684 | 698 | } |
685 | 699 |
|
@@ -912,9 +926,9 @@ protected void onDataStateChanged(AsyncResult ar) { |
912 | 926 | } |
913 | 927 | } |
914 | 928 |
|
915 | | - private void startDelayedRetry(FailCause cause, String reason) { |
| 929 | + private void startDelayedRetry(FailCause cause, String reason, int retryOverride) { |
916 | 930 | notifyNoData(cause); |
917 | | - reconnectAfterFail(cause, reason); |
| 931 | + reconnectAfterFail(cause, reason, retryOverride); |
918 | 932 | } |
919 | 933 |
|
920 | 934 | @Override |
|
0 commit comments