Don't mark an APN disabled if setup fails

We need to leave the phone in a connectable state so that it connects whenever it's able
(reception or just timing).  If we mark it disabled on failure it wont try again.  The retry
comes from the phone layer, not from ConnectivityService.

Also Fix the Phone layer so it retries even if it disconnected by request (DATA_DISABLED).
This was a bug from long ago that didn't become visible until recently with fast wifi and slow
mobile teardown.

Change-Id: I04bf39fba0cb578c87d5fc6ea5d220820ff9f364
This commit is contained in:
Robert Greenwalt
2009-08-27 17:11:56 -07:00
parent 616195a3b3
commit 6ce96faa0c
3 changed files with 3 additions and 13 deletions

View File

@@ -280,16 +280,8 @@ public abstract class DataConnectionTracker extends Handler {
if (!dataEnabled[apnId]) {
dataEnabled[apnId] = true;
enabledCount++;
if (enabledCount == 1) {
if (onTrySetupData(null) == false) {
// failed to setup data - note we can't optimize by only adj
// these after a successfull call. dataEnabled must be set
// prior or we think data is not available.
dataEnabled[apnId] = false;
enabledCount--;
}
}
}
onTrySetupData(null);
} else {
// disable
if (dataEnabled[apnId]) {

View File

@@ -568,8 +568,7 @@ public final class CdmaDataConnectionTracker extends DataConnectionTracker {
private boolean retryAfterDisconnected(String reason) {
boolean retry = true;
if ( Phone.REASON_RADIO_TURNED_OFF.equals(reason) ||
Phone.REASON_DATA_DISABLED.equals(reason) ) {
if ( Phone.REASON_RADIO_TURNED_OFF.equals(reason) ) {
retry = false;
}
return retry;

View File

@@ -1010,8 +1010,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
private boolean retryAfterDisconnected(String reason) {
boolean retry = true;
if ( Phone.REASON_RADIO_TURNED_OFF.equals(reason) ||
Phone.REASON_DATA_DISABLED.equals(reason) ) {
if ( Phone.REASON_RADIO_TURNED_OFF.equals(reason) ) {
retry = false;
}
return retry;