Merge "Suppress mobile-out-of-service label if wifi connected." into ics-mr1

This commit is contained in:
Daniel Sandler
2012-01-26 13:02:32 -08:00
committed by Android (Google) Code Review
2 changed files with 20 additions and 9 deletions

View File

@ -63,6 +63,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:paddingRight="6dp"
> >
<ImageView <ImageView
@ -87,7 +88,6 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingRight="12dp" android:paddingRight="12dp"
android:paddingLeft="6dp"
android:singleLine="true" android:singleLine="true"
android:ellipsize="end" android:ellipsize="end"
android:text="@string/status_bar_settings_settings_button" android:text="@string/status_bar_settings_settings_button"
@ -99,6 +99,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:paddingRight="6dp"
> >
<ImageView <ImageView
@ -122,7 +123,6 @@
android:layout_gravity="left|center_vertical" android:layout_gravity="left|center_vertical"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingLeft="6dp"
android:paddingRight="12dp" android:paddingRight="12dp"
android:singleLine="true" android:singleLine="true"
android:ellipsize="end" android:ellipsize="end"

View File

@ -892,13 +892,24 @@ public class NetworkController extends BroadcastReceiver {
mDataSignalIconId = mPhoneSignalIconId = 0; mDataSignalIconId = mPhoneSignalIconId = 0;
mobileLabel = ""; mobileLabel = "";
} else { } else {
// We want to show the carrier name even if data is not being routed over that link, so // We want to show the carrier name if in service and either:
// we look only at the service state here. // - We are connected to mobile data, or
mobileLabel = hasService() // - We are not connected to mobile data, as long as the *reason* packets are not
? mNetworkName // being routed over that link is that we have better connectivity via wifi.
: context.getString(R.string.status_bar_settings_signal_meter_disconnected); // If data is disconnected for some other reason but wifi is connected, we show nothing.
if (DEBUG) { // Otherwise (nothing connected) we show "No internet connection".
mobileLabel += "yyyyYYYYyyyyYYYY";
if (mDataConnected) {
mobileLabel = mNetworkName;
} else if (mWifiConnected) {
if (hasService()) {
mobileLabel = mNetworkName;
} else {
mobileLabel = "";
}
} else {
mobileLabel
= context.getString(R.string.status_bar_settings_signal_meter_disconnected);
} }
// Now for things that should only be shown when actually using mobile data. // Now for things that should only be shown when actually using mobile data.