Add null check for CarrierConfig
CarrierConfig maybe null when config loader is not ready, so we need to add null check here. Bug: 124447166 Test: RunSettingsRoboTests Change-Id: I3c104f1ca44bb0bcacad460c68084163c758746a
This commit is contained in:
@@ -111,4 +111,12 @@ public class AutoSelectPreferenceControllerTest {
|
||||
mContext.getString(R.string.manual_mode_disallowed_summary,
|
||||
mTelephonyManager.getSimOperatorName()));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void init_carrierConfigNull_shouldNotCrash() {
|
||||
when(mCarrierConfigManager.getConfigForSubId(SUB_ID)).thenReturn(null);
|
||||
|
||||
// Should not crash
|
||||
mController.init(SUB_ID);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user