am db494098: am 9209ce85: Merge "Changing sim selection dialog in Settings to use phoneAccount" into lmp-mr1-dev
* commit 'db4940988ddabb8f6c1768cb56ed3e7fa62a990d':
Changing sim selection dialog in Settings to use phoneAccount
diff --git a/src/com/android/settings/sim/SimSettings.java b/src/com/android/settings/sim/SimSettings.java
index e2f56cb..682f722 100644
--- a/src/com/android/settings/sim/SimSettings.java
+++ b/src/com/android/settings/sim/SimSettings.java
@@ -372,10 +372,25 @@
if (mDialogId == CALLS_PICK) {
holder.title.setText(getItem(position));
- holder.summary.setText("");
- holder.icon.setImageDrawable(getResources()
- .getDrawable(R.drawable.ic_live_help));
- holder.icon.setAlpha(OPACITY);
+ if (position == 0) {
+ holder.icon.setImageDrawable(getResources()
+ .getDrawable(R.drawable.ic_live_help));
+ holder.icon.setAlpha(OPACITY);
+ holder.summary.setText("");
+ } else {
+ final TelecomManager telecomManager = TelecomManager.from(getActivity());
+ final Iterator<PhoneAccountHandle> phoneAccounts =
+ telecomManager.getCallCapablePhoneAccounts().listIterator();
+ while (phoneAccounts.hasNext()) {
+ final PhoneAccount phoneAccount =
+ telecomManager.getPhoneAccount(phoneAccounts.next());
+ if (getItem(position).equals((String) phoneAccount.getLabel())) {
+ holder.icon.setImageBitmap(phoneAccount.getIconBitmap());
+ holder.summary
+ .setText(phoneAccount.getAddress().getSchemeSpecificPart());
+ }
+ }
+ }
} else {
sir = mSelectableSubInfos.get(position);
holder.title.setText(sir.getDisplayName());