|
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 |
|
@@ -506,17 +507,20 @@ private boolean retryAfterDisconnected(String reason) { |
506 | 507 | return retry; |
507 | 508 | } |
508 | 509 |
|
509 | | - private void reconnectAfterFail(FailCause lastFailCauseCode, String reason) { |
| 510 | + private void reconnectAfterFail(FailCause lastFailCauseCode, String reason, int retryOverride) { |
510 | 511 | if (mState == State.FAILED) { |
511 | 512 | /** |
512 | 513 | * For now With CDMA we never try to reconnect on |
513 | 514 | * error and instead just continue to retry |
514 | 515 | * at the last time until the state is changed. |
515 | 516 | * TODO: Make this configurable? |
516 | 517 | */ |
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 | + } |
518 | 523 | startAlarmForReconnect(nextReconnectDelay, reason); |
519 | | - mDataConnections.get(0).increaseRetryCount(); |
520 | 524 |
|
521 | 525 | if (!shouldPostNotification(lastFailCauseCode)) { |
522 | 526 | log("NOT Posting Data Connection Unavailable notification " |
@@ -674,7 +678,17 @@ protected void onDataSetupComplete(AsyncResult ar) { |
674 | 678 | notifyNoData(cause); |
675 | 679 | return; |
676 | 680 | } |
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 | + } |
678 | 692 | } |
679 | 693 | } |
680 | 694 |
|
@@ -907,9 +921,9 @@ protected void onDataStateChanged(AsyncResult ar) { |
907 | 921 | } |
908 | 922 | } |
909 | 923 |
|
910 | | - private void startDelayedRetry(FailCause cause, String reason) { |
| 924 | + private void startDelayedRetry(FailCause cause, String reason, int retryOverride) { |
911 | 925 | notifyNoData(cause); |
912 | | - reconnectAfterFail(cause, reason); |
| 926 | + reconnectAfterFail(cause, reason, retryOverride); |
913 | 927 | } |
914 | 928 |
|
915 | 929 | @Override |
|
0 commit comments