Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6ce96faa authored by Robert Greenwalt's avatar Robert Greenwalt
Browse files

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
parent 616195a3
Loading
Loading
Loading
Loading
+1 −9
Original line number Diff line number Diff line
@@ -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]) {
+1 −2
Original line number Diff line number Diff line
@@ -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;
+1 −2
Original line number Diff line number Diff line
@@ -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;