summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/android/settings/DateTimeSettings.java2
-rw-r--r--src/com/android/settings/DeviceInfoSettings.java2
-rw-r--r--src/com/android/settings/LocationSettings.java2
-rw-r--r--src/com/android/settings/Utils.java6
-rw-r--r--src/com/android/settings/WirelessSettings.java2
-rw-r--r--src/com/android/settings/deviceinfo/Status.java6
-rw-r--r--src/com/android/settings/fuelgauge/BatteryHistoryChart.java2
-rw-r--r--src/com/android/settings/fuelgauge/PowerUsageSummary.java2
-rw-r--r--src/com/android/settings/wifi/AdvancedWifiSettings.java2
9 files changed, 14 insertions, 12 deletions
diff --git a/src/com/android/settings/DateTimeSettings.java b/src/com/android/settings/DateTimeSettings.java
index 3935d59..1d8e341 100644
--- a/src/com/android/settings/DateTimeSettings.java
+++ b/src/com/android/settings/DateTimeSettings.java
@@ -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;
}
diff --git a/src/com/android/settings/DeviceInfoSettings.java b/src/com/android/settings/DeviceInfoSettings.java
index 76f5a8e..337233e 100644
--- a/src/com/android/settings/DeviceInfoSettings.java
+++ b/src/com/android/settings/DeviceInfoSettings.java
@@ -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));
}
diff --git a/src/com/android/settings/LocationSettings.java b/src/com/android/settings/LocationSettings.java
index 0824aab..ef438e6 100644
--- a/src/com/android/settings/LocationSettings.java
+++ b/src/com/android/settings/LocationSettings.java
@@ -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);
}
diff --git a/src/com/android/settings/Utils.java b/src/com/android/settings/Utils.java
index 73a9a30..2d2b654 100644
--- a/src/com/android/settings/Utils.java
+++ b/src/com/android/settings/Utils.java
@@ -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);
}
/**
diff --git a/src/com/android/settings/WirelessSettings.java b/src/com/android/settings/WirelessSettings.java
index e1fc882..b10b93f 100644
--- a/src/com/android/settings/WirelessSettings.java
+++ b/src/com/android/settings/WirelessSettings.java
@@ -129,7 +129,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));
}
diff --git a/src/com/android/settings/deviceinfo/Status.java b/src/com/android/settings/deviceinfo/Status.java
index 987fab8..57a8e94 100644
--- a/src/com/android/settings/deviceinfo/Status.java
+++ b/src/com/android/settings/deviceinfo/Status.java
@@ -194,7 +194,7 @@ public class Status extends PreferenceActivity {
mSignalStrength = findPreference(KEY_SIGNAL_STRENGTH);
mUptime = findPreference("up_time");
- if (Utils.isWifiOnly()) {
+ if (Utils.isWifiOnly(getApplicationContext())) {
for (String key : PHONE_RELATED_ENTRIES) {
removePreferenceFromScreen(key);
}
@@ -263,7 +263,7 @@ public class Status extends PreferenceActivity {
protected void onResume() {
super.onResume();
- if (!Utils.isWifiOnly()) {
+ if (!Utils.isWifiOnly(getApplicationContext())) {
mPhoneStateReceiver.registerIntent();
updateSignalStrength();
@@ -281,7 +281,7 @@ public class Status extends PreferenceActivity {
public void onPause() {
super.onPause();
- if (!Utils.isWifiOnly()) {
+ if (!Utils.isWifiOnly(getApplicationContext())) {
mPhoneStateReceiver.unregisterIntent();
mTelephonyManager.listen(mPhoneStateListener, PhoneStateListener.LISTEN_NONE);
}
diff --git a/src/com/android/settings/fuelgauge/BatteryHistoryChart.java b/src/com/android/settings/fuelgauge/BatteryHistoryChart.java
index 13a962d..a229888 100644
--- a/src/com/android/settings/fuelgauge/BatteryHistoryChart.java
+++ b/src/com/android/settings/fuelgauge/BatteryHistoryChart.java
@@ -378,7 +378,7 @@ public class BatteryHistoryChart extends View {
mNumHist = lastInteresting;
mHaveGps = (aggrStates&HistoryItem.STATE_GPS_ON_FLAG) != 0;
mHaveWifi = (aggrStates&HistoryItem.STATE_WIFI_RUNNING_FLAG) != 0;
- if (!com.android.settings.Utils.isWifiOnly()) {
+ if (!com.android.settings.Utils.isWifiOnly(getContext())) {
mHavePhoneSignal = true;
}
if (mHistEnd <= mHistStart) mHistEnd = mHistStart+1;
diff --git a/src/com/android/settings/fuelgauge/PowerUsageSummary.java b/src/com/android/settings/fuelgauge/PowerUsageSummary.java
index f28ba93..32ba279 100644
--- a/src/com/android/settings/fuelgauge/PowerUsageSummary.java
+++ b/src/com/android/settings/fuelgauge/PowerUsageSummary.java
@@ -713,7 +713,7 @@ public class PowerUsageSummary extends PreferenceFragment implements Runnable {
addBluetoothUsage(uSecNow);
addIdleUsage(uSecNow); // Not including cellular idle power
// Don't compute radio usage if it's a wifi-only device
- if (!com.android.settings.Utils.isWifiOnly()) {
+ if (!com.android.settings.Utils.isWifiOnly(getActivity())) {
addRadioUsage(uSecNow);
}
}
diff --git a/src/com/android/settings/wifi/AdvancedWifiSettings.java b/src/com/android/settings/wifi/AdvancedWifiSettings.java
index 7ec546b..7fb9871 100644
--- a/src/com/android/settings/wifi/AdvancedWifiSettings.java
+++ b/src/com/android/settings/wifi/AdvancedWifiSettings.java
@@ -97,7 +97,7 @@ public class AdvancedWifiSettings extends SettingsPreferenceFragment
ListPreference sleepPolicyPref = (ListPreference) findPreference(KEY_SLEEP_POLICY);
if (sleepPolicyPref != null) {
- if (Utils.isWifiOnly()) {
+ if (Utils.isWifiOnly(getActivity())) {
sleepPolicyPref.setEntries(R.array.wifi_sleep_policy_entries_wifi_only);
sleepPolicyPref.setSummary(R.string.wifi_setting_sleep_policy_summary_wifi_only);
}