diff options
author | Santos Cordon <santoscordon@google.com> | 2015-02-06 05:38:06 -0800 |
---|---|---|
committer | Etan Cohen <etancohen@google.com> | 2015-03-02 11:47:19 -0800 |
commit | 171d147905776a8442b43de83d3e8d5c34b8c644 (patch) | |
tree | 1a7662f54ea6afbe0a2b09c9583e2b6d9d8bf8db | |
parent | bd54ef091984e324bd7d72803a6803e2149a3ac4 (diff) | |
download | packages_apps_Settings-171d147905776a8442b43de83d3e8d5c34b8c644.zip packages_apps_Settings-171d147905776a8442b43de83d3e8d5c34b8c644.tar.gz packages_apps_Settings-171d147905776a8442b43de83d3e8d5c34b8c644.tar.bz2 |
Update Multi-SIM setting to use getSubIdForPhoneAccount API.
Settings app should not be parsing the subId direction from the phone
account. Instead this CL updates the settings app to use a new API to
grab the sub ID.
Change-Id: Iefd1831b04c061168fa2b135a2d296a27e3d4e92
-rw-r--r-- | src/com/android/settings/sim/SimDialogActivity.java | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/com/android/settings/sim/SimDialogActivity.java b/src/com/android/settings/sim/SimDialogActivity.java index 3170dae..4566662 100644 --- a/src/com/android/settings/sim/SimDialogActivity.java +++ b/src/com/android/settings/sim/SimDialogActivity.java @@ -29,6 +29,7 @@ import android.telecom.PhoneAccountHandle; import android.telecom.TelecomManager; import android.telephony.SubscriptionInfo; import android.telephony.SubscriptionManager; +import android.telephony.TelephonyManager; import android.text.TextUtils; import android.util.Log; import android.view.KeyEvent; @@ -210,6 +211,7 @@ public class SimDialogActivity extends Activity { ArrayList<SubscriptionInfo> callsSubInfoList = new ArrayList<SubscriptionInfo>(); if (id == CALLS_PICK) { final TelecomManager telecomManager = TelecomManager.from(context); + final TelephonyManager telephonyManager = TelephonyManager.from(context); final Iterator<PhoneAccountHandle> phoneAccounts = telecomManager.getCallCapablePhoneAccounts().listIterator(); @@ -219,13 +221,9 @@ public class SimDialogActivity extends Activity { final PhoneAccount phoneAccount = telecomManager.getPhoneAccount(phoneAccounts.next()); list.add((String)phoneAccount.getLabel()); - // 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)); + int subId = telephonyManager.getSubIdForPhoneAccount(phoneAccount); + if (subId != SubscriptionManager.INVALID_SUBSCRIPTION_ID) { + final SubscriptionInfo sir = Utils.findRecordBySubId(context, subId); callsSubInfoList.add(sir); } else { callsSubInfoList.add(null); |