Merge "[Settings] Add NPE protection for the bundle"

This commit is contained in:
TreeHugger Robot
2022-07-14 13:46:09 +00:00
committed by Android (Google) Code Review

View File

@@ -239,8 +239,8 @@ public class EnabledNetworkModePreferenceController extends
void setPreferenceEntries() {
mTelephonyManager = mTelephonyManager.createForSubscriptionId(mSubId);
final PersistableBundle carrierConfig = mCarrierConfigCache.getConfigForSubId(mSubId);
final boolean display2gOptions = carrierConfig
.getBoolean(CarrierConfigManager.KEY_PREFER_2G_BOOL);
final boolean display2gOptions = carrierConfig != null
&& carrierConfig.getBoolean(CarrierConfigManager.KEY_PREFER_2G_BOOL);
clearAllEntries();
UiOptions.Builder uiOptions = UiOptions.newBuilder();
uiOptions.setType(getEnabledNetworkType());