Merge "Don't show emergency calls label unless it's a phone." into jb-mr2-dev

This commit is contained in:
Daniel Sandler
2013-05-29 04:36:23 +00:00
committed by Android (Google) Code Review
2 changed files with 21 additions and 11 deletions

View File

@@ -496,17 +496,21 @@ public class PhoneStatusBar extends BaseStatusBar {
mNetworkController.addSignalCluster(signalCluster);
signalCluster.setNetworkController(mNetworkController);
mEmergencyCallLabel = (TextView)mStatusBarWindow.findViewById(R.id.emergency_calls_only);
if (mEmergencyCallLabel != null) {
mNetworkController.addEmergencyLabelView(mEmergencyCallLabel);
mEmergencyCallLabel.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) { }});
mEmergencyCallLabel.addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
@Override
public void onLayoutChange(View v, int left, int top, int right, int bottom,
int oldLeft, int oldTop, int oldRight, int oldBottom) {
updateCarrierLabelVisibility(false);
}});
final boolean isAPhone = mNetworkController.hasVoiceCallingFeature();
if (isAPhone) {
mEmergencyCallLabel =
(TextView) mStatusBarWindow.findViewById(R.id.emergency_calls_only);
if (mEmergencyCallLabel != null) {
mNetworkController.addEmergencyLabelView(mEmergencyCallLabel);
mEmergencyCallLabel.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) { }});
mEmergencyCallLabel.addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
@Override
public void onLayoutChange(View v, int left, int top, int right, int bottom,
int oldLeft, int oldTop, int oldRight, int oldBottom) {
updateCarrierLabelVisibility(false);
}});
}
}
mCarrierLabel = (TextView)mStatusBarWindow.findViewById(R.id.carrier_label);

View File

@@ -263,6 +263,10 @@ public class NetworkController extends BroadcastReceiver {
return mHasMobileDataFeature;
}
public boolean hasVoiceCallingFeature() {
return mPhone.getPhoneType() != TelephonyManager.PHONE_TYPE_NONE;
}
public boolean isEmergencyOnly() {
return (mServiceState != null && mServiceState.isEmergencyOnly());
}
@@ -1377,6 +1381,8 @@ public class NetworkController extends BroadcastReceiver {
mConnected?"CONNECTED":"DISCONNECTED",
mConnectedNetworkType, mConnectedNetworkTypeName));
pw.println(" - telephony ------");
pw.print(" hasVoiceCallingFeature()=");
pw.println(hasVoiceCallingFeature());
pw.print(" hasService()=");
pw.println(hasService());
pw.print(" mHspaDataDistinguishable=");