diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2015-01-04 00:11:55 -0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2015-01-04 00:11:55 -0800 |
commit | 1c3eb2ca249afa14e434e5fd025260127fef222e (patch) | |
tree | 871807c794f746b21e231ad3c5d6fe2e1e04fafd | |
parent | 39677b41f54726a0f39e11034bb4eed85cc33bb8 (diff) | |
parent | c520694a136dc9c981aa9b75f9047e2e988d6e2c (diff) | |
download | android_packages_apps_ContactsCommon-1c3eb2ca249afa14e434e5fd025260127fef222e.tar.gz android_packages_apps_ContactsCommon-1c3eb2ca249afa14e434e5fd025260127fef222e.tar.bz2 android_packages_apps_ContactsCommon-1c3eb2ca249afa14e434e5fd025260127fef222e.zip |
Merge "Contacts app crash during monkey test"
-rw-r--r-- | src/com/android/contacts/common/util/TelephonyManagerUtils.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/com/android/contacts/common/util/TelephonyManagerUtils.java b/src/com/android/contacts/common/util/TelephonyManagerUtils.java index 5f9b062d..ad7100b8 100644 --- a/src/com/android/contacts/common/util/TelephonyManagerUtils.java +++ b/src/com/android/contacts/common/util/TelephonyManagerUtils.java @@ -123,13 +123,18 @@ public class TelephonyManagerUtils { } long subId[] = SubscriptionManager.getSubId(subscription); + String subIdstr = null; + if (subId != null && subId.length > 0) { + subIdstr = String.valueOf(subId[0]); + } else { + return null; + } final TelecomManager telecomManager = (TelecomManager) context .getSystemService(Context.TELECOM_SERVICE); List<PhoneAccountHandle> pHandles = telecomManager.getCallCapablePhoneAccounts(); PhoneAccountHandle phoneAccountHandle = null; for (PhoneAccountHandle itorator : pHandles) { - if (subId != null - && String.valueOf(subId[0]).equals(itorator.getId())) { + if (subIdstr != null && subIdstr.equals(itorator.getId())) { phoneAccountHandle = itorator; } } |