aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTyler Gunn <tgunn@google.com>2022-06-03 21:39:57 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2022-06-03 21:39:57 +0000
commit529cd5265bd8b0c468f3fcb8f46b9756b5d3350e (patch)
treebaa56576735b98e4a6167c1c9b13018e4d3061bb /src
parent936e030d6c425a8659ae5b5b520a131a0b6c30d6 (diff)
parent002968edbd58602c7e51eb7e55b47d5bbac878c1 (diff)
downloadContactsProvider-529cd5265bd8b0c468f3fcb8f46b9756b5d3350e.tar.gz
Merge "Add null-check for SubscriptionInfo when trying to get IccId." into tm-devandroid13-dev
Diffstat (limited to 'src')
-rw-r--r--src/com/android/providers/contacts/CallLogProvider.java8
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.
}