Merge "Don't crash from null ServiceState in cdma" into oc-mr1-dev

am: 88aa3d0f3e

Change-Id: I1bccabe56e1b7d497d6d74356adfbce46d24c860
This commit is contained in:
Jason Monk
2017-09-05 18:38:42 +00:00
committed by android-build-merger
2 changed files with 15 additions and 5 deletions

View File

@@ -345,7 +345,7 @@ public class MobileSignalController extends SignalController<
if (isCarrierNetworkChangeActive()) {
return false;
}
if (isCdma()) {
if (isCdma() && mServiceState != null) {
final int iconMode = mServiceState.getCdmaEriIconMode();
return mServiceState.getCdmaEriIconIndex() != EriInfo.ROAMING_INDICATOR_OFF
&& (iconMode == EriInfo.ROAMING_ICON_MODE_NORMAL
@@ -520,10 +520,12 @@ public class MobileSignalController extends SignalController<
+ " dataState=" + state.getDataRegState());
}
mServiceState = state;
mDataNetType = state.getDataNetworkType();
if (mDataNetType == TelephonyManager.NETWORK_TYPE_LTE && mServiceState != null &&
mServiceState.isUsingCarrierAggregation()) {
mDataNetType = TelephonyManager.NETWORK_TYPE_LTE_CA;
if (state != null) {
mDataNetType = state.getDataNetworkType();
if (mDataNetType == TelephonyManager.NETWORK_TYPE_LTE && mServiceState != null &&
mServiceState.isUsingCarrierAggregation()) {
mDataNetType = TelephonyManager.NETWORK_TYPE_LTE_CA;
}
}
updateTelephony();
}

View File

@@ -201,6 +201,14 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest {
}
}
@Test
public void testRoamingNoService_DoesNotCrash() {
setupDefaultSignal();
setCdma();
mServiceState = null;
updateServiceState();
}
@Test
@Ignore("Flaky")
public void testQsSignalStrength() {