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

Commit 3957b3c1 authored by Irfan Sheriff's avatar Irfan Sheriff Committed by Android (Google) Code Review
Browse files

Merge "scan only when wifi is enabled" into froyo

parents 8c8185b2 2215c7f8
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -169,7 +169,9 @@ public class WifiSettings extends PreferenceActivity implements DialogInterface.
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case MENU_ID_SCAN:
                if (mWifiManager.isWifiEnabled()) {
                    mScanner.resume();
                }
                return true;
            case MENU_ID_ADVANCED:
                startActivity(new Intent(this, AdvancedSettings.class));
@@ -428,6 +430,10 @@ public class WifiSettings extends PreferenceActivity implements DialogInterface.
    }

    private void updateConnectionState(DetailedState state) {
        /* sticky broadcasts can call this when wifi is disabled */
        if (!mWifiManager.isWifiEnabled())
            return;

        if (state == DetailedState.OBTAINING_IPADDR) {
            mScanner.pause();
        } else {