am 56b135b9: Merge "Put PLMN and SPN on one line in the notification panel." into jb-dev
* commit '56b135b91051664ae9027f50e9f20b7fcf6565ba': Put PLMN and SPN on one line in the notification panel.
This commit is contained in:
@@ -21,6 +21,7 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.provider.Telephony;
|
||||
import android.text.TextUtils;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Slog;
|
||||
import android.view.View;
|
||||
@@ -91,24 +92,20 @@ public class CarrierLabel extends TextView {
|
||||
Slog.d("CarrierLabel", "updateNetworkName showSpn=" + showSpn + " spn=" + spn
|
||||
+ " showPlmn=" + showPlmn + " plmn=" + plmn);
|
||||
}
|
||||
StringBuilder str = new StringBuilder();
|
||||
boolean something = false;
|
||||
if (showPlmn && plmn != null) {
|
||||
str.append(plmn);
|
||||
something = true;
|
||||
}
|
||||
if (showSpn && spn != null) {
|
||||
if (something) {
|
||||
str.append('\n');
|
||||
}
|
||||
str.append(spn);
|
||||
something = true;
|
||||
}
|
||||
if (something) {
|
||||
setText(str.toString());
|
||||
final String str;
|
||||
// match logic in KeyguardStatusViewManager
|
||||
final boolean plmnValid = showPlmn && !TextUtils.isEmpty(plmn);
|
||||
final boolean spnValid = showSpn && !TextUtils.isEmpty(spn);
|
||||
if (plmnValid && spnValid) {
|
||||
str = plmn + "|" + spn;
|
||||
} else if (plmnValid) {
|
||||
str = plmn;
|
||||
} else if (spnValid) {
|
||||
str = spn;
|
||||
} else {
|
||||
setText(com.android.internal.R.string.lockscreen_carrier_default);
|
||||
str = "";
|
||||
}
|
||||
setText(str);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -447,12 +447,14 @@ public class PhoneStatusBar extends BaseStatusBar {
|
||||
|
||||
mNetworkController.addSignalCluster(signalCluster);
|
||||
signalCluster.setNetworkController(mNetworkController);
|
||||
|
||||
// for wifi-only devices, we show SSID; otherwise, we show PLMN
|
||||
if (mNetworkController.hasMobileDataFeature()) {
|
||||
mNetworkController.addMobileLabelView(mCarrierLabel);
|
||||
} else {
|
||||
mNetworkController.addWifiLabelView(mCarrierLabel);
|
||||
|
||||
if (SHOW_CARRIER_LABEL) {
|
||||
// for wifi-only devices, we show SSID; otherwise, we show PLMN
|
||||
if (mNetworkController.hasMobileDataFeature()) {
|
||||
mNetworkController.addMobileLabelView(mCarrierLabel);
|
||||
} else {
|
||||
mNetworkController.addWifiLabelView(mCarrierLabel);
|
||||
}
|
||||
}
|
||||
|
||||
// final ImageView wimaxRSSI =
|
||||
|
||||
Reference in New Issue
Block a user