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() { void setPreferenceEntries() {
mTelephonyManager = mTelephonyManager.createForSubscriptionId(mSubId); mTelephonyManager = mTelephonyManager.createForSubscriptionId(mSubId);
final PersistableBundle carrierConfig = mCarrierConfigCache.getConfigForSubId(mSubId); final PersistableBundle carrierConfig = mCarrierConfigCache.getConfigForSubId(mSubId);
final boolean display2gOptions = carrierConfig final boolean display2gOptions = carrierConfig != null
.getBoolean(CarrierConfigManager.KEY_PREFER_2G_BOOL); && carrierConfig.getBoolean(CarrierConfigManager.KEY_PREFER_2G_BOOL);
clearAllEntries(); clearAllEntries();
UiOptions.Builder uiOptions = UiOptions.newBuilder(); UiOptions.Builder uiOptions = UiOptions.newBuilder();
uiOptions.setType(getEnabledNetworkType()); uiOptions.setType(getEnabledNetworkType());