From 3a5a7cac73a4446f5a03bbd610f33cd4105a22b6 Mon Sep 17 00:00:00 2001 From: Moxie Marlinspike Date: Wed, 10 Feb 2016 17:50:23 -0800 Subject: [PATCH] Only display sim card info on incoming SMS when multiple SIMs // FREEBIE --- src/org/thoughtcrime/securesms/ConversationItem.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/org/thoughtcrime/securesms/ConversationItem.java b/src/org/thoughtcrime/securesms/ConversationItem.java index 5186263b9c..c2bbfa9121 100644 --- a/src/org/thoughtcrime/securesms/ConversationItem.java +++ b/src/org/thoughtcrime/securesms/ConversationItem.java @@ -334,11 +334,12 @@ public class ConversationItem extends LinearLayout } private void setSimInfo(MessageRecord messageRecord) { - if (messageRecord.getSubscriptionId() == -1) { + SubscriptionManagerCompat subscriptionManager = new SubscriptionManagerCompat(context); + + if (messageRecord.getSubscriptionId() == -1 || subscriptionManager.getActiveSubscriptionInfoList().size() < 2) { simInfoText.setVisibility(View.GONE); } else { - SubscriptionManagerCompat subscriptionManager = new SubscriptionManagerCompat(context); - Optional subscriptionInfo = subscriptionManager.getActiveSubscriptionInfo(messageRecord.getSubscriptionId()); + Optional subscriptionInfo = subscriptionManager.getActiveSubscriptionInfo(messageRecord.getSubscriptionId()); if (subscriptionInfo.isPresent() && messageRecord.isOutgoing()) { simInfoText.setText(getContext().getString(R.string.ConversationItem_from_s, subscriptionInfo.get().getDisplayName()));