diff options
author | Wink Saville <wink@google.com> | 2010-11-17 15:33:36 -0800 |
---|---|---|
committer | Wink Saville <wink@google.com> | 2010-11-17 15:33:36 -0800 |
commit | a20d02c2e1a13c8cfb1ed4ed2dff84a29080d4e4 (patch) | |
tree | 0792c3aedcee397356db8e7eb7b675f6378c1b76 /telephony/java | |
parent | 05434e9fa7a6ec844611bbd154c4a3eceafec538 (diff) | |
download | frameworks_base-a20d02c2e1a13c8cfb1ed4ed2dff84a29080d4e4.zip frameworks_base-a20d02c2e1a13c8cfb1ed4ed2dff84a29080d4e4.tar.gz frameworks_base-a20d02c2e1a13c8cfb1ed4ed2dff84a29080d4e4.tar.bz2 |
Fix GSM permanent failure handling, DO NOT MERGE.
Wait until all APN's have been tried before checking for permanent errors
and then, don't do retires only if all of the APN's had permanent errors.
Also, don't disable the requested apn type because if we do we won't
be able to setup data because there won't be an apn type.
This was tested by creating a new non existent APN, I chose:
Name="badapn1"
APN="badapn1"
Server="noapn.com"
Then selecting "badapn1" will cause a permanent error.
bug: 3202729
Change-Id: I182c7197456c849176ce08d7d1459359f8c3b30e
Diffstat (limited to 'telephony/java')
-rw-r--r-- | telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java index e7d57bc..ab9cf2a 100644 --- a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java +++ b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java @@ -115,7 +115,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker { * It is a subset of allApns and has the same format */ private ArrayList<ApnSetting> waitingApns = null; - + private int waitingApnsPermanentFailureCountDown = 0; private ApnSetting preferredApn = null; /* Currently active APN */ @@ -449,6 +449,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker { if (state == State.IDLE) { waitingApns = buildWaitingApns(); + waitingApnsPermanentFailureCountDown = waitingApns.size(); if (waitingApns.isEmpty()) { if (DBG) log("No APN found"); notifyNoData(GsmDataConnection.FailCause.MISSING_UNKNOWN_APN); @@ -1154,20 +1155,25 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker { TelephonyManager.getDefault().getNetworkType()); } - // No try for permanent failure - if (cause.isPermanentFail()) { - notifyNoData(cause); - phone.notifyDataConnection(Phone.REASON_APN_FAILED); - onEnableApn(apnTypeToId(mRequestedApnType), DISABLED); - return; - } - + // Count permanent failures and remove the APN we just tried + waitingApnsPermanentFailureCountDown -= cause.isPermanentFail() ? 1 : 0; waitingApns.remove(0); + if (DBG) log(String.format("onDataSetupComplete: waitingApns.size=%d" + + " waitingApnsPermanenatFailureCountDown=%d", + waitingApns.size(), waitingApnsPermanentFailureCountDown)); + + // See if there are more APN's to try if (waitingApns.isEmpty()) { - // No more to try, start delayed retry - startDelayedRetry(cause, reason); + if (waitingApnsPermanentFailureCountDown == 0) { + if (DBG) log("onDataSetupComplete: Permanent failures stop retrying"); + notifyNoData(cause); + phone.notifyDataConnection(Phone.REASON_APN_FAILED); + } else { + if (DBG) log("onDataSetupComplete: Not all permanent failures, retry"); + startDelayedRetry(cause, reason); + } } else { - // we still have more apns to try + if (DBG) log("onDataSetupComplete: Try next APN"); setState(State.SCANNING); // Wait a bit before trying the next APN, so that // we're not tying up the RIL command channel |