diff options
author | Brandon Bennett <bennetb@gmail.com> | 2013-04-15 01:49:04 -0600 |
---|---|---|
committer | Brandon Bennett <bennetb@gmail.com> | 2013-04-15 11:06:22 -0600 |
commit | d3361b7d2a1b6d61607292887c39014ab1d269ff (patch) | |
tree | b831924d23644fa02210ab32db80aa642e07e033 /core | |
parent | de19822372f7f70892731ab89a7da4eeda420c24 (diff) | |
download | frameworks_base-d3361b7d2a1b6d61607292887c39014ab1d269ff.zip frameworks_base-d3361b7d2a1b6d61607292887c39014ab1d269ff.tar.gz frameworks_base-d3361b7d2a1b6d61607292887c39014ab1d269ff.tar.bz2 |
QS/PW: Check for mobile data instead of telephony permissions (1/2)
For QuickSettings and Power Widget check if there is
ConnectivityManager.TYPE_MOBILE network avaialbe directly instead of relying
on a checking for the PackageManager.FEATURE_TELEPHONY permission. Some
devices like tilapia (Nexus 7 GSM) has mobile data but does not set the
telephony permission.
Patchset 2:
- Use ConnectivityManager.isNetworkSupported() instead of checking for a null
value returned from ConnectivityManager.getNetworkInfo(). Thanks
- Have MobileNetworkTile use the QSUtil deviceSupportsMobileData method
Change-Id: I71bd6217cbe08622f805de4ae30a87df11340f5f
Fixes: CYAN-803
Diffstat (limited to 'core')
-rw-r--r-- | core/java/com/android/internal/util/cm/QSUtils.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/java/com/android/internal/util/cm/QSUtils.java b/core/java/com/android/internal/util/cm/QSUtils.java index 72a285b..3da9a7c 100644 --- a/core/java/com/android/internal/util/cm/QSUtils.java +++ b/core/java/com/android/internal/util/cm/QSUtils.java @@ -31,9 +31,9 @@ public class QSUtils { return (dm.getWifiDisplayStatus().getFeatureState() != WifiDisplayStatus.FEATURE_STATE_UNAVAILABLE); } - public static boolean deviceSupportsTelephony(Context ctx) { - PackageManager pm = ctx.getPackageManager(); - return pm.hasSystemFeature(PackageManager.FEATURE_TELEPHONY); + public static boolean deviceSupportsMobileData(Context ctx) { + ConnectivityManager cm = (ConnectivityManager) ctx.getSystemService(Context.CONNECTIVITY_SERVICE); + return cm.isNetworkSupported(ConnectivityManager.TYPE_MOBILE); } public static boolean deviceSupportsBluetooth() { |