Fix NPE on some phones at startup.

Bug: 6877589
Change-Id: I65ff37b4cf6b59a72a7aa665f252f5fb34f3b183
This commit is contained in:
Daniel Sandler
2012-07-25 12:31:22 -04:00
parent 3ee47ae7ee
commit 9af376e57a

View File

@@ -917,6 +917,7 @@ public class NetworkController extends BroadcastReceiver {
String wifiLabel = "";
String mobileLabel = "";
int N;
final boolean emergencyOnly = (mServiceState != null && mServiceState.isEmergencyOnly());
if (!mHasMobileDataFeature) {
mDataSignalIconId = mPhoneSignalIconId = 0;
@@ -932,8 +933,8 @@ public class NetworkController extends BroadcastReceiver {
if (mDataConnected) {
mobileLabel = mNetworkName;
} else if (mConnected || mServiceState.isEmergencyOnly()) {
if (hasService() || mServiceState.isEmergencyOnly()) {
} else if (mConnected || emergencyOnly) {
if (hasService() || emergencyOnly) {
// The isEmergencyOnly test covers the case of a phone with no SIM
mobileLabel = mNetworkName;
} else {