Do not allow NPE if CarrierConfigManager service is null. am: 5cf46dc254 am: de4d24b5a7
Original change: https://android-review.googlesource.com/c/platform/packages/services/Telecomm/+/3122851
Change-Id: Id46b66db4e19605114267d24cdb980436feff934
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/src/com/android/server/telecom/CallLogManager.java b/src/com/android/server/telecom/CallLogManager.java
index 27535c0..4484e23 100644
--- a/src/com/android/server/telecom/CallLogManager.java
+++ b/src/com/android/server/telecom/CallLogManager.java
@@ -460,8 +460,8 @@
boolean okToLogEmergencyNumber = false;
CarrierConfigManager configManager = (CarrierConfigManager) mContext.getSystemService(
Context.CARRIER_CONFIG_SERVICE);
- PersistableBundle configBundle = configManager.getConfigForSubId(
- mPhoneAccountRegistrar.getSubscriptionIdForPhoneAccount(accountHandle));
+ PersistableBundle configBundle = (configManager != null) ? configManager.getConfigForSubId(
+ mPhoneAccountRegistrar.getSubscriptionIdForPhoneAccount(accountHandle)) : null;
if (configBundle != null) {
okToLogEmergencyNumber = configBundle.getBoolean(
CarrierConfigManager.KEY_ALLOW_EMERGENCY_NUMBERS_IN_CALL_LOG_BOOL);