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

Commit 2f973f5f authored by Tomasz Wasilczyk's avatar Tomasz Wasilczyk Committed by Android (Google) Code Review
Browse files

Merge "Don't crash quick settings if Wi-Fi is not supported."

parents 49764b13 959e7cd7
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -320,7 +320,7 @@ public class InternetDialog extends SystemUIDialog implements

        showProgressBar();
        final boolean isDeviceLocked = mInternetDialogController.isDeviceLocked();
        final boolean isWifiEnabled = mWifiManager.isWifiEnabled();
        final boolean isWifiEnabled = mWifiManager != null && mWifiManager.isWifiEnabled();
        final boolean isWifiScanEnabled = mInternetDialogController.isWifiScanEnabled();
        updateWifiToggle(isWifiEnabled, isDeviceLocked);
        updateConnectedWifi(isWifiEnabled, isDeviceLocked);
@@ -350,6 +350,7 @@ public class InternetDialog extends SystemUIDialog implements
        mSeeAllLayout.setOnClickListener(v -> onClickSeeMoreButton());
        mWiFiToggle.setOnCheckedChangeListener(
                (buttonView, isChecked) -> {
                    if (mWifiManager == null) return;
                    buttonView.setChecked(isChecked);
                    mWifiManager.setWifiEnabled(isChecked);
                });
@@ -375,8 +376,9 @@ public class InternetDialog extends SystemUIDialog implements
            Log.d(TAG, "setMobileDataLayout, isCarrierNetworkActive = " + isCarrierNetworkActive);
        }

        boolean isWifiEnabled = mWifiManager != null && mWifiManager.isWifiEnabled();
        if (!mInternetDialogController.hasActiveSubId()
                && (!mWifiManager.isWifiEnabled() || !isCarrierNetworkActive)) {
                && (!isWifiEnabled || !isCarrierNetworkActive)) {
            mMobileNetworkLayout.setVisibility(View.GONE);
        } else {
            mMobileNetworkLayout.setVisibility(View.VISIBLE);
+1 −1
Original line number Diff line number Diff line
@@ -827,7 +827,7 @@ public class InternetDialogController implements AccessPointController.AccessPoi
        if (!mLocationController.isLocationEnabled()) {
            return false;
        }
        return mWifiManager.isScanAlwaysAvailable();
        return mWifiManager != null && mWifiManager.isScanAlwaysAvailable();
    }

    static class WifiEntryConnectCallback implements WifiEntry.ConnectCallback {
+5 −0
Original line number Diff line number Diff line
@@ -117,6 +117,7 @@ public class AccessPointControllerImpl implements AccessPointController,
    }

    public boolean canConfigWifi() {
        if (!mWifiPickerTrackerFactory.isSupported()) return false;
        return !mUserManager.hasUserRestriction(UserManager.DISALLOW_CONFIG_WIFI,
                new UserHandle(mCurrentUser));
    }
@@ -312,6 +313,10 @@ public class AccessPointControllerImpl implements AccessPointController,
            mWorkerHandler = workerHandler;
        }

        private boolean isSupported() {
            return mWifiManager != null;
        }

        /**
         * Create a {@link WifiPickerTracker}
         *