Only display sim card info on incoming SMS when multiple SIMs

// FREEBIE
This commit is contained in:
Moxie Marlinspike 2016-02-10 17:50:23 -08:00
parent b69c109d6b
commit 3a5a7cac73

View File

@ -334,10 +334,11 @@ public class ConversationItem extends LinearLayout
} }
private void setSimInfo(MessageRecord messageRecord) { 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); simInfoText.setVisibility(View.GONE);
} else { } else {
SubscriptionManagerCompat subscriptionManager = new SubscriptionManagerCompat(context);
Optional<SubscriptionInfoCompat> subscriptionInfo = subscriptionManager.getActiveSubscriptionInfo(messageRecord.getSubscriptionId()); Optional<SubscriptionInfoCompat> subscriptionInfo = subscriptionManager.getActiveSubscriptionInfo(messageRecord.getSubscriptionId());
if (subscriptionInfo.isPresent() && messageRecord.isOutgoing()) { if (subscriptionInfo.isPresent() && messageRecord.isOutgoing()) {