diff options
Diffstat (limited to 'src/com/android/providers/contacts/CallLogProvider.java')
-rw-r--r-- | src/com/android/providers/contacts/CallLogProvider.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/com/android/providers/contacts/CallLogProvider.java b/src/com/android/providers/contacts/CallLogProvider.java index b2674834..da2d0b8a 100644 --- a/src/com/android/providers/contacts/CallLogProvider.java +++ b/src/com/android/providers/contacts/CallLogProvider.java @@ -54,6 +54,7 @@ import android.provider.CallLog.Calls; import android.telecom.PhoneAccount; import android.telecom.PhoneAccountHandle; import android.telecom.TelecomManager; +import android.telephony.SubscriptionInfo; import android.telephony.SubscriptionManager; import android.telephony.TelephonyManager; import android.text.TextUtils; @@ -1349,8 +1350,11 @@ public class CallLogProvider extends ContentProvider { PhoneAccountHandle phoneAccountHandle = (PhoneAccountHandle) arg; String iccId = null; try { - iccId = mSubscriptionManager.getActiveSubscriptionInfo( - Integer.parseInt(phoneAccountHandle.getId())).getIccId(); + SubscriptionInfo info = mSubscriptionManager.getActiveSubscriptionInfo( + Integer.parseInt(phoneAccountHandle.getId())); + if (info != null) { + iccId = info.getIccId(); + } } catch (NumberFormatException nfe) { // Ignore the exception, iccId will remain null and be handled below. } |