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.Intent;
|
||||||
import android.content.IntentFilter;
|
import android.content.IntentFilter;
|
||||||
import android.provider.Telephony;
|
import android.provider.Telephony;
|
||||||
|
import android.text.TextUtils;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.util.Slog;
|
import android.util.Slog;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@@ -91,24 +92,20 @@ public class CarrierLabel extends TextView {
|
|||||||
Slog.d("CarrierLabel", "updateNetworkName showSpn=" + showSpn + " spn=" + spn
|
Slog.d("CarrierLabel", "updateNetworkName showSpn=" + showSpn + " spn=" + spn
|
||||||
+ " showPlmn=" + showPlmn + " plmn=" + plmn);
|
+ " showPlmn=" + showPlmn + " plmn=" + plmn);
|
||||||
}
|
}
|
||||||
StringBuilder str = new StringBuilder();
|
final String str;
|
||||||
boolean something = false;
|
// match logic in KeyguardStatusViewManager
|
||||||
if (showPlmn && plmn != null) {
|
final boolean plmnValid = showPlmn && !TextUtils.isEmpty(plmn);
|
||||||
str.append(plmn);
|
final boolean spnValid = showSpn && !TextUtils.isEmpty(spn);
|
||||||
something = true;
|
if (plmnValid && spnValid) {
|
||||||
}
|
str = plmn + "|" + spn;
|
||||||
if (showSpn && spn != null) {
|
} else if (plmnValid) {
|
||||||
if (something) {
|
str = plmn;
|
||||||
str.append('\n');
|
} else if (spnValid) {
|
||||||
}
|
str = spn;
|
||||||
str.append(spn);
|
|
||||||
something = true;
|
|
||||||
}
|
|
||||||
if (something) {
|
|
||||||
setText(str.toString());
|
|
||||||
} else {
|
} 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);
|
mNetworkController.addSignalCluster(signalCluster);
|
||||||
signalCluster.setNetworkController(mNetworkController);
|
signalCluster.setNetworkController(mNetworkController);
|
||||||
|
|
||||||
// for wifi-only devices, we show SSID; otherwise, we show PLMN
|
if (SHOW_CARRIER_LABEL) {
|
||||||
if (mNetworkController.hasMobileDataFeature()) {
|
// for wifi-only devices, we show SSID; otherwise, we show PLMN
|
||||||
mNetworkController.addMobileLabelView(mCarrierLabel);
|
if (mNetworkController.hasMobileDataFeature()) {
|
||||||
} else {
|
mNetworkController.addMobileLabelView(mCarrierLabel);
|
||||||
mNetworkController.addWifiLabelView(mCarrierLabel);
|
} else {
|
||||||
|
mNetworkController.addWifiLabelView(mCarrierLabel);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// final ImageView wimaxRSSI =
|
// final ImageView wimaxRSSI =
|
||||||
|
|||||||
Reference in New Issue
Block a user