Use a stub for config from carrier app if the app returns null.
Generally a carrier app should not return config as null. However
if it does it should be handled gracefully by the platform.
Test: manual
Bug: 179641392
Change-Id: Iaa2a105ea516c6fec835c2e69022ae955b364496
diff --git a/src/com/android/phone/CarrierConfigLoader.java b/src/com/android/phone/CarrierConfigLoader.java
index 4ff7316..785095a 100644
--- a/src/com/android/phone/CarrierConfigLoader.java
+++ b/src/com/android/phone/CarrierConfigLoader.java
@@ -463,7 +463,15 @@
resultData.getParcelable(KEY_CONFIG_BUNDLE);
saveConfigToXml(getCarrierPackageForPhoneId(phoneId), "",
phoneId, carrierId, config);
- mConfigFromCarrierApp[phoneId] = config;
+ if (config != null) {
+ mConfigFromCarrierApp[phoneId] = config;
+ } else {
+ logdWithLocalLog("Config from carrier app is null "
+ + "for phoneId " + phoneId);
+ // Put a stub bundle in place so that the rest of the logic
+ // continues smoothly.
+ mConfigFromCarrierApp[phoneId] = new PersistableBundle();
+ }
sendMessage(
obtainMessage(
EVENT_FETCH_CARRIER_DONE, phoneId, -1));