fix NPE when sim is absent
Bug: 123775402
Test: Manual
Change-Id: Ibf557b576c6249605e8e293c4c5b3377a9d2a286
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 1631b64..7533c25 100755
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -5132,6 +5132,10 @@
try {
final SubscriptionInfo info = mSubscriptionController.getActiveSubscriptionInfo(subId,
phone.getContext().getOpPackageName());
+ if (info == null) {
+ log("getSimLocaleForSubscriber, inactive subId: " + subId);
+ return null;
+ }
// Try and fetch the locale from the carrier properties or from the SIM language
// preferences (EF-PL and EF-LI)...
final int mcc = info.getMcc();