summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPauloftheWest <paulofthewest@google.com>2014-12-12 09:09:40 -0800
committerPauloftheWest <paulofthewest@google.com>2014-12-12 12:21:17 -0800
commita886d69f9d69dc380872a3fa0ac63b21195cb570 (patch)
tree90f98908d3ac171adc818f706dba9d267045b98f /src
parent8a21ab00e5ec5141e4bd745ab9e7f161db98cb1a (diff)
downloadpackages_apps_Settings-a886d69f9d69dc380872a3fa0ac63b21195cb570.tar.gz
packages_apps_Settings-a886d69f9d69dc380872a3fa0ac63b21195cb570.tar.bz2
packages_apps_Settings-a886d69f9d69dc380872a3fa0ac63b21195cb570.zip
Fixed then icons of SIMs in the call dialog.
Bug: 18672758 Change-Id: I812e79a48b048f8449cc07fdcccab57a114cdd24
Diffstat (limited to 'src')
-rw-r--r--src/com/android/settings/sim/SimDialogActivity.java17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/com/android/settings/sim/SimDialogActivity.java b/src/com/android/settings/sim/SimDialogActivity.java
index 6aceb46c3..9bd9ab532 100644
--- a/src/com/android/settings/sim/SimDialogActivity.java
+++ b/src/com/android/settings/sim/SimDialogActivity.java
@@ -198,16 +198,26 @@ public class SimDialogActivity extends Activity {
}
};
+ ArrayList<SubscriptionInfo> callsSubInfoList = new ArrayList<SubscriptionInfo>();
if (id == CALLS_PICK) {
final TelecomManager telecomManager = TelecomManager.from(context);
final Iterator<PhoneAccountHandle> phoneAccounts =
telecomManager.getCallCapablePhoneAccounts().listIterator();
list.add(getResources().getString(R.string.sim_calls_ask_first_prefs_title));
+ callsSubInfoList.add(null);
while (phoneAccounts.hasNext()) {
final PhoneAccount phoneAccount =
telecomManager.getPhoneAccount(phoneAccounts.next());
list.add((String)phoneAccount.getLabel());
+ if (phoneAccount.hasCapabilities(PhoneAccount.CAPABILITY_SIM_SUBSCRIPTION)) {
+ final String phoneAccountId = phoneAccount.getAccountHandle().getId();
+ final SubscriptionInfo sir = Utils.findRecordBySubId(context,
+ Integer.parseInt(phoneAccountId));
+ callsSubInfoList.add(sir);
+ } else {
+ callsSubInfoList.add(null);
+ }
}
} else {
for (int i = 0; i < selectableSubInfoLength; ++i) {
@@ -225,7 +235,7 @@ public class SimDialogActivity extends Activity {
AlertDialog.Builder builder = new AlertDialog.Builder(context);
ListAdapter adapter = new SelectAccountListAdapter(
- subInfoList,
+ id == CALLS_PICK ? callsSubInfoList : subInfoList,
builder.getContext(),
R.layout.select_account_list_item,
arr, id);
@@ -274,7 +284,6 @@ public class SimDialogActivity extends Activity {
mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View rowView;
final ViewHolder holder;
- SubscriptionInfo sir;
if (convertView == null) {
// Cache views for faster scrolling
@@ -289,14 +298,14 @@ public class SimDialogActivity extends Activity {
holder = (ViewHolder) rowView.getTag();
}
- if (mDialogId == CALLS_PICK) {
+ final SubscriptionInfo sir = mSubInfoList.get(position);
+ if (sir == null) {
holder.title.setText(getItem(position));
holder.summary.setText("");
holder.icon.setImageDrawable(getResources()
.getDrawable(R.drawable.ic_live_help));
holder.icon.setAlpha(OPACITY);
} else {
- sir = mSubInfoList.get(position);
holder.title.setText(sir.getDisplayName());
holder.summary.setText(sir.getNumber());
holder.icon.setImageBitmap(sir.createIconBitmap(mContext));