diff options
author | Daniel Sandler <dsandler@android.com> | 2012-01-24 12:57:14 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-01-24 12:57:14 -0800 |
commit | 416a1c1ada0ad553613eb439823a68d3f51b1579 (patch) | |
tree | 61dc8dd2184c12c9e702a4f71be32e20fc62903e /packages | |
parent | 535b0264a4cfa790e549bd9cd09980788f1375f4 (diff) | |
parent | 185c0ef7e4aaa4bb978a6eb5c93c569585a07f56 (diff) | |
download | frameworks_base-416a1c1ada0ad553613eb439823a68d3f51b1579.zip frameworks_base-416a1c1ada0ad553613eb439823a68d3f51b1579.tar.gz frameworks_base-416a1c1ada0ad553613eb439823a68d3f51b1579.tar.bz2 |
am 185c0ef7: Merge "Stop showing "No internet connection" when there is one." into ics-mr1
* commit '185c0ef7e4aaa4bb978a6eb5c93c569585a07f56':
Stop showing "No internet connection" when there is one.
Diffstat (limited to 'packages')
-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; } |