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 /packages/SystemUI/src/com/android/systemui/statusbar/phone | |
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 'packages/SystemUI/src/com/android/systemui/statusbar/phone')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsController.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsController.java index d01954b..15860c9 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsController.java @@ -47,7 +47,7 @@ import static com.android.internal.util.cm.QSUtils.deviceSupportsBluetooth; import static com.android.internal.util.cm.QSUtils.deviceSupportsDockBattery; import static com.android.internal.util.cm.QSUtils.deviceSupportsImeSwitcher; import static com.android.internal.util.cm.QSUtils.deviceSupportsLte; -import static com.android.internal.util.cm.QSUtils.deviceSupportsTelephony; +import static com.android.internal.util.cm.QSUtils.deviceSupportsMobileData; import static com.android.internal.util.cm.QSUtils.deviceSupportsUsbTether; import static com.android.internal.util.cm.QSUtils.expandedDesktopEnabled; import static com.android.internal.util.cm.QSUtils.systemProfilesEnabled; @@ -153,14 +153,14 @@ public class QuickSettingsController { // Filter items not compatible with device boolean bluetoothSupported = deviceSupportsBluetooth(); - boolean telephonySupported = deviceSupportsTelephony(mContext); + boolean mobileDataSupported = deviceSupportsMobileData(mContext); boolean lteSupported = deviceSupportsLte(mContext); if (!bluetoothSupported) { TILES_DEFAULT.remove(TILE_BLUETOOTH); } - if (!telephonySupported) { + if (!mobileDataSupported) { TILES_DEFAULT.remove(TILE_WIFIAP); TILES_DEFAULT.remove(TILE_MOBILEDATA); TILES_DEFAULT.remove(TILE_NETWORKMODE); @@ -203,15 +203,15 @@ public class QuickSettingsController { qs = new RingerModeTile(mContext, this); } else if (tile.equals(TILE_SYNC)) { qs = new SyncTile(mContext, this); - } else if (tile.equals(TILE_WIFIAP) && telephonySupported) { + } else if (tile.equals(TILE_WIFIAP) && mobileDataSupported) { qs = new WifiAPTile(mContext, this); } else if (tile.equals(TILE_SCREENTIMEOUT)) { qs = new ScreenTimeoutTile(mContext, this); - } else if (tile.equals(TILE_MOBILEDATA) && telephonySupported) { + } else if (tile.equals(TILE_MOBILEDATA) && mobileDataSupported) { qs = new MobileNetworkTile(mContext, this); } else if (tile.equals(TILE_LOCKSCREEN)) { qs = new ToggleLockscreenTile(mContext, this); - } else if (tile.equals(TILE_NETWORKMODE) && telephonySupported) { + } else if (tile.equals(TILE_NETWORKMODE) && mobileDataSupported) { qs = new MobileNetworkTypeTile(mContext, this); } else if (tile.equals(TILE_AUTOROTATE)) { qs = new AutoRotateTile(mContext, this, mHandler); |