diff options
| author | Daniel Sandler <dsandler@android.com> | 2012-01-26 13:02:32 -0800 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-01-26 13:02:32 -0800 |
| commit | 5b08738a62ece5bf0ca5d22a6f062e2fb67af272 (patch) | |
| tree | 218eb237e3c28aadbc187ac79ebe1f74e126725a | |
| parent | 6c055bbdf475e6cd324912326c802244b9a76c3b (diff) | |
| parent | 62a1eb8972f6eb1133060ae96142abcd57d347dd (diff) | |
| download | frameworks_base-5b08738a62ece5bf0ca5d22a6f062e2fb67af272.zip frameworks_base-5b08738a62ece5bf0ca5d22a6f062e2fb67af272.tar.gz frameworks_base-5b08738a62ece5bf0ca5d22a6f062e2fb67af272.tar.bz2 | |
Merge "Suppress mobile-out-of-service label if wifi connected." into ics-mr1
| -rw-r--r-- | packages/SystemUI/res/layout-sw600dp/status_bar_notification_panel_title.xml | 4 | ||||
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java | 25 |
2 files changed, 20 insertions, 9 deletions
diff --git a/packages/SystemUI/res/layout-sw600dp/status_bar_notification_panel_title.xml b/packages/SystemUI/res/layout-sw600dp/status_bar_notification_panel_title.xml index ef95936..b985aaf 100644 --- a/packages/SystemUI/res/layout-sw600dp/status_bar_notification_panel_title.xml +++ b/packages/SystemUI/res/layout-sw600dp/status_bar_notification_panel_title.xml @@ -63,6 +63,7 @@ android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_gravity="center_vertical" + android:paddingRight="6dp" > <ImageView @@ -87,7 +88,6 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingRight="12dp" - android:paddingLeft="6dp" android:singleLine="true" android:ellipsize="end" android:text="@string/status_bar_settings_settings_button" @@ -99,6 +99,7 @@ android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_gravity="center_vertical" + android:paddingRight="6dp" > <ImageView @@ -122,7 +123,6 @@ android:layout_gravity="left|center_vertical" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:paddingLeft="6dp" android:paddingRight="12dp" android:singleLine="true" android:ellipsize="end" 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 a44ad5f..d46ab6c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java @@ -892,13 +892,24 @@ public class NetworkController extends BroadcastReceiver { mDataSignalIconId = mPhoneSignalIconId = 0; 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"; + // We want to show the carrier name if in service and either: + // - We are connected to mobile data, or + // - We are not connected to mobile data, as long as the *reason* packets are not + // being routed over that link is that we have better connectivity via wifi. + // If data is disconnected for some other reason but wifi is connected, we show nothing. + // Otherwise (nothing connected) we show "No internet connection". + + 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. |
