summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/Utils.java
diff options
context:
space:
mode:
authorRobert Greenwalt <rgreenwalt@google.com>2011-08-31 11:17:47 -0700
committerRobert Greenwalt <rgreenwalt@google.com>2011-08-31 16:45:39 -0700
commit8af88fb8387259e51615709b2d1ea0260f7057fd (patch)
treee5ae0ac9f9696e68d38d02fdf205603fd858a150 /src/com/android/settings/Utils.java
parentca6d987a87698cda7ca216adb8e827b30111f984 (diff)
downloadpackages_apps_Settings-8af88fb8387259e51615709b2d1ea0260f7057fd.tar.gz
packages_apps_Settings-8af88fb8387259e51615709b2d1ea0260f7057fd.tar.bz2
packages_apps_Settings-8af88fb8387259e51615709b2d1ea0260f7057fd.zip
Use the new isNetworkSupported api for wifi-only
Didn't have an API for this before so people used a hacked system property (ro.carrier) to determine if the device supported mobile data. Added new API and switching callsites. bug:5087537 Change-Id: Ibd799559be102a9e2fd552d1a23d1afbcf8f4614
Diffstat (limited to 'src/com/android/settings/Utils.java')
-rw-r--r--src/com/android/settings/Utils.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/com/android/settings/Utils.java b/src/com/android/settings/Utils.java
index 73a9a30b0..2d2b6548c 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);
}
/**