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

Commit 7edbc609 authored by Robert Greenwalt's avatar Robert Greenwalt Committed by Android (Google) Code Review
Browse files

Merge "Use the new isNetworkSupported api for wifi-only"

parents 7fe1435b 8af88fb8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -94,7 +94,7 @@ public class DateTimeSettings extends SettingsPreferenceFragment
        mAutoTimeZonePref = (CheckBoxPreference) findPreference(KEY_AUTO_TIME_ZONE);
        // Override auto-timezone if it's a wifi-only device or if we're still in setup wizard.
        // TODO: Remove the wifiOnly test when auto-timezone is implemented based on wifi-location.
        if (Utils.isWifiOnly() || isFirstRun) {
        if (Utils.isWifiOnly(getActivity()) || isFirstRun) {
            getPreferenceScreen().removePreference(mAutoTimeZonePref);
            autoTimeZoneEnabled = false;
        }
+1 −1
Original line number Diff line number Diff line
@@ -87,7 +87,7 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment {
                PROPERTY_URL_SAFETYLEGAL);

        // Remove Baseband version if wifi-only device
        if (Utils.isWifiOnly()) {
        if (Utils.isWifiOnly(getActivity())) {
            getPreferenceScreen().removePreference(findPreference(KEY_BASEBAND_VERSION));
        }

+1 −1
Original line number Diff line number Diff line
@@ -101,7 +101,7 @@ public class LocationSettings extends SettingsPreferenceFragment
        }

        // Change the summary for wifi-only devices
        if (Utils.isWifiOnly()) {
        if (Utils.isWifiOnly(getActivity())) {
            mNetwork.setSummaryOn(R.string.location_neighborhood_level_wifi);
        }

+4 −2
Original line number Diff line number Diff line
@@ -290,8 +290,10 @@ public class Utils {
        return telephony != null && telephony.isVoiceCapable();
    }

    public static boolean isWifiOnly() {
        return "wifi-only".equals(SystemProperties.get("ro.carrier"));
    public static boolean isWifiOnly(Context context) {
        ConnectivityManager cm = (ConnectivityManager)context.getSystemService(
                Context.CONNECTIVITY_SERVICE);
        return (cm.isNetworkSupported(ConnectivityManager.TYPE_MOBILE) == false);
    }

    /**
+1 −1
Original line number Diff line number Diff line
@@ -135,7 +135,7 @@ public class WirelessSettings extends SettingsPreferenceFragment {
        }

        // Remove Mobile Network Settings if it's a wifi-only device.
        if (Utils.isWifiOnly()) {
        if (Utils.isWifiOnly(getActivity())) {
            getPreferenceScreen().removePreference(findPreference(KEY_MOBILE_NETWORK_SETTINGS));
        }

Loading