Fixed crash caused by non-integer phoneAccountId in SimDialogActivity.

Bug: 18834691
Change-Id: I75b5ba4d72523474fe91eaf80f8201d9a53a683a
This commit is contained in:
Sanket Padawe
2015-01-06 10:54:55 -08:00
parent c3068f0788
commit 4d902bcc8f

View File

@@ -219,7 +219,10 @@ public class SimDialogActivity extends Activity {
final PhoneAccount phoneAccount =
telecomManager.getPhoneAccount(phoneAccounts.next());
list.add((String)phoneAccount.getLabel());
if (phoneAccount.hasCapabilities(PhoneAccount.CAPABILITY_SIM_SUBSCRIPTION)) {
// Added check to add entry into callsSubInforList only if phoneAccountId is int
// Todo : Might have to change it later based on b/18904714
if (phoneAccount.hasCapabilities(PhoneAccount.CAPABILITY_SIM_SUBSCRIPTION) &&
TextUtils.isDigitsOnly(phoneAccount.getAccountHandle().getId())) {
final String phoneAccountId = phoneAccount.getAccountHandle().getId();
final SubscriptionInfo sir = Utils.findRecordBySubId(context,
Integer.parseInt(phoneAccountId));