diff options
author | Daniel Sandler <dsandler@android.com> | 2012-01-25 08:57:27 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-01-25 08:57:27 -0800 |
commit | efbf376afd9e37112dcd44c607d5e865da07eec7 (patch) | |
tree | 12cb1f910dd0468d576f7369341e784ebc48a532 /packages/SystemUI | |
parent | 172870f37dc233922757d35d3180071fa84c59ef (diff) | |
parent | 416a1c1ada0ad553613eb439823a68d3f51b1579 (diff) | |
download | frameworks_base-efbf376afd9e37112dcd44c607d5e865da07eec7.zip frameworks_base-efbf376afd9e37112dcd44c607d5e865da07eec7.tar.gz frameworks_base-efbf376afd9e37112dcd44c607d5e865da07eec7.tar.bz2 |
am 416a1c1a: am 185c0ef7: Merge "Stop showing "No internet connection" when there is one." into ics-mr1
* commit '416a1c1ada0ad553613eb439823a68d3f51b1579':
Stop showing "No internet connection" when there is one.
Diffstat (limited to 'packages/SystemUI')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java | 74 |
1 files changed, 47 insertions, 27 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java index d09e680..a44ad5f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java @@ -890,34 +890,40 @@ public class NetworkController extends BroadcastReceiver { if (!mHasMobileDataFeature) { mDataSignalIconId = mPhoneSignalIconId = 0; - } else if (mDataConnected) { - mobileLabel = mNetworkName; + mobileLabel = ""; + } else { + // We want to show the carrier name even if data is not being routed over that link, so + // we look only at the service state here. + mobileLabel = hasService() + ? mNetworkName + : context.getString(R.string.status_bar_settings_signal_meter_disconnected); if (DEBUG) { mobileLabel += "yyyyYYYYyyyyYYYY"; } - combinedSignalIconId = mDataSignalIconId; - switch (mDataActivity) { - case TelephonyManager.DATA_ACTIVITY_IN: - mMobileActivityIconId = R.drawable.stat_sys_signal_in; - break; - case TelephonyManager.DATA_ACTIVITY_OUT: - mMobileActivityIconId = R.drawable.stat_sys_signal_out; - break; - case TelephonyManager.DATA_ACTIVITY_INOUT: - mMobileActivityIconId = R.drawable.stat_sys_signal_inout; - break; - default: - mMobileActivityIconId = 0; - break; - } - combinedLabel = mobileLabel; - combinedActivityIconId = mMobileActivityIconId; - combinedSignalIconId = mDataSignalIconId; // set by updateDataIcon() - mContentDescriptionCombinedSignal = mContentDescriptionDataType; - } else { - mobileLabel = mHasMobileDataFeature ? - context.getString(R.string.status_bar_settings_signal_meter_disconnected) : ""; + // Now for things that should only be shown when actually using mobile data. + if (mDataConnected) { + combinedSignalIconId = mDataSignalIconId; + switch (mDataActivity) { + case TelephonyManager.DATA_ACTIVITY_IN: + mMobileActivityIconId = R.drawable.stat_sys_signal_in; + break; + case TelephonyManager.DATA_ACTIVITY_OUT: + mMobileActivityIconId = R.drawable.stat_sys_signal_out; + break; + case TelephonyManager.DATA_ACTIVITY_INOUT: + mMobileActivityIconId = R.drawable.stat_sys_signal_inout; + break; + default: + mMobileActivityIconId = 0; + break; + } + + combinedLabel = mobileLabel; + combinedActivityIconId = mMobileActivityIconId; + combinedSignalIconId = mDataSignalIconId; // set by updateDataIcon() + mContentDescriptionCombinedSignal = mContentDescriptionDataType; + } } if (mWifiConnected) { @@ -949,6 +955,12 @@ public class NetworkController extends BroadcastReceiver { combinedLabel = wifiLabel; combinedSignalIconId = mWifiIconId; // set by updateWifiIcons() mContentDescriptionCombinedSignal = mContentDescriptionWifi; + } else { + if (mHasMobileDataFeature) { + wifiLabel = ""; + } else { + wifiLabel = context.getString(R.string.status_bar_settings_signal_meter_disconnected); + } } if (mBluetoothTethered) { @@ -969,9 +981,17 @@ public class NetworkController extends BroadcastReceiver { mDataTypeIconId = 0; // combined values from connected wifi take precedence over airplane mode - if (!mWifiConnected) { - wifiLabel = context.getString(R.string.status_bar_settings_signal_meter_disconnected); - combinedLabel = wifiLabel; + if (mWifiConnected) { + // Suppress "No internet connection." from mobile if wifi connected. + mobileLabel = ""; + } else { + if (mHasMobileDataFeature) { + // let the mobile icon show "No internet connection." + wifiLabel = ""; + } else { + wifiLabel = context.getString(R.string.status_bar_settings_signal_meter_disconnected); + combinedLabel = wifiLabel; + } mContentDescriptionCombinedSignal = mContentDescriptionPhoneSignal; combinedSignalIconId = mDataSignalIconId; } |