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

Commit 3e229076 authored by Robert Greenwalt's avatar Robert Greenwalt Committed by Android Git Automerger
Browse files

am cc4b4016: Fix the reporting of NO_CONNECTIVITY.

Merge commit 'cc4b4016' into eclair-plus-aosp

* commit 'cc4b4016':
  Fix the reporting of NO_CONNECTIVITY.
parents 6d626d41 cc4b4016
Loading
Loading
Loading
Loading
+20 −13
Original line number Diff line number Diff line
@@ -811,13 +811,16 @@ public class ConnectivityService extends IConnectivityManager.Stub {
                    info.getExtraInfo());
        }

        NetworkStateTracker newNet = tryFailover(prevNetType);
        NetworkStateTracker newNet = null;
        if (mNetAttributes[prevNetType].isDefault()) {
            newNet = tryFailover(prevNetType);
            if (newNet != null) {
                NetworkInfo switchTo = newNet.getNetworkInfo();
                intent.putExtra(ConnectivityManager.EXTRA_OTHER_NETWORK_INFO, switchTo);
            } else {
                intent.putExtra(ConnectivityManager.EXTRA_NO_CONNECTIVITY, true);
            }
        }
        // do this before we broadcast the change
        handleConnectivityChange();

@@ -831,7 +834,7 @@ public class ConnectivityService extends IConnectivityManager.Stub {
        }
    }

    // returns -1 if no failover available
    // returns null if no failover available
    private NetworkStateTracker tryFailover(int prevNetType) {
        /*
         * If this is a default network, check if other defaults are available
@@ -953,13 +956,17 @@ public class ConnectivityService extends IConnectivityManager.Stub {
            info.setFailover(false);
        }

        NetworkStateTracker newNet = tryFailover(info.getType());
        NetworkStateTracker newNet = null;
        if (mNetAttributes[info.getType()].isDefault()) {
            newNet = tryFailover(info.getType());
            if (newNet != null) {
                NetworkInfo switchTo = newNet.getNetworkInfo();
                intent.putExtra(ConnectivityManager.EXTRA_OTHER_NETWORK_INFO, switchTo);
            } else {
                intent.putExtra(ConnectivityManager.EXTRA_NO_CONNECTIVITY, true);
            }
        }

        // do this before we broadcast the change
        handleConnectivityChange();