File tree Expand file tree Collapse file tree 2 files changed +20
-9
lines changed
src/com/android/systemui/statusbar/policy Expand file tree Collapse file tree 2 files changed +20
-9
lines changed Original file line number Diff line number Diff line change 6363 android : layout_height =" wrap_content"
6464 android : layout_width =" wrap_content"
6565 android : layout_gravity =" center_vertical"
66+ android : paddingRight =" 6dp"
6667 >
6768
6869 <ImageView
8788 android : layout_width =" wrap_content"
8889 android : layout_height =" wrap_content"
8990 android : paddingRight =" 12dp"
90- android : paddingLeft =" 6dp"
9191 android : singleLine =" true"
9292 android : ellipsize =" end"
9393 android : text =" @string/status_bar_settings_settings_button"
9999 android : layout_height =" wrap_content"
100100 android : layout_width =" wrap_content"
101101 android : layout_gravity =" center_vertical"
102+ android : paddingRight =" 6dp"
102103 >
103104
104105 <ImageView
122123 android : layout_gravity =" left|center_vertical"
123124 android : layout_width =" wrap_content"
124125 android : layout_height =" wrap_content"
125- android : paddingLeft =" 6dp"
126126 android : paddingRight =" 12dp"
127127 android : singleLine =" true"
128128 android : ellipsize =" end"
Original file line number Diff line number Diff line change @@ -892,13 +892,24 @@ void refreshViews() {
892892 mDataSignalIconId = mPhoneSignalIconId = 0 ;
893893 mobileLabel = "" ;
894894 } else {
895- // We want to show the carrier name even if data is not being routed over that link, so
896- // we look only at the service state here.
897- mobileLabel = hasService ()
898- ? mNetworkName
899- : context .getString (R .string .status_bar_settings_signal_meter_disconnected );
900- if (DEBUG ) {
901- mobileLabel += "yyyyYYYYyyyyYYYY" ;
895+ // We want to show the carrier name if in service and either:
896+ // - We are connected to mobile data, or
897+ // - We are not connected to mobile data, as long as the *reason* packets are not
898+ // being routed over that link is that we have better connectivity via wifi.
899+ // If data is disconnected for some other reason but wifi is connected, we show nothing.
900+ // Otherwise (nothing connected) we show "No internet connection".
901+
902+ if (mDataConnected ) {
903+ mobileLabel = mNetworkName ;
904+ } else if (mWifiConnected ) {
905+ if (hasService ()) {
906+ mobileLabel = mNetworkName ;
907+ } else {
908+ mobileLabel = "" ;
909+ }
910+ } else {
911+ mobileLabel
912+ = context .getString (R .string .status_bar_settings_signal_meter_disconnected );
902913 }
903914
904915 // Now for things that should only be shown when actually using mobile data.
You can’t perform that action at this time.
0 commit comments