Refactor contact photo logic to not reuse drawables.

// FREEBIE
This commit is contained in:
Moxie Marlinspike
2015-06-23 10:15:33 -07:00
parent 8bb47bbdf1
commit 64df85f3ee
16 changed files with 295 additions and 275 deletions

View File

@@ -345,7 +345,7 @@ public class MmsDatabase extends MessagingDatabase {
? Util.toIsoString(notification.getFrom().getTextString())
: "";
Recipients recipients = RecipientFactory.getRecipientsFromString(context, fromString, false);
if (recipients.isEmpty()) recipients = RecipientFactory.getRecipientsFor(context, Recipient.getUnknownRecipient(context), false);
if (recipients.isEmpty()) recipients = RecipientFactory.getRecipientsFor(context, Recipient.getUnknownRecipient(), false);
return DatabaseFactory.getThreadDatabase(context).getThreadIdFor(recipients);
}
@@ -1054,13 +1054,13 @@ public class MmsDatabase extends MessagingDatabase {
private Recipients getRecipientsFor(String address) {
if (TextUtils.isEmpty(address) || address.equals("insert-address-token")) {
return RecipientFactory.getRecipientsFor(context, Recipient.getUnknownRecipient(context), false);
return RecipientFactory.getRecipientsFor(context, Recipient.getUnknownRecipient(), false);
}
Recipients recipients = RecipientFactory.getRecipientsFromString(context, address, false);
if (recipients == null || recipients.isEmpty()) {
return RecipientFactory.getRecipientsFor(context, Recipient.getUnknownRecipient(context), false);
return RecipientFactory.getRecipientsFor(context, Recipient.getUnknownRecipient(), false);
}
return recipients;

View File

@@ -368,7 +368,7 @@ public class SmsDatabase extends MessagingDatabase {
recipients = RecipientFactory.getRecipientsFromString(context, message.getSender(), true);
} else {
Log.w(TAG, "Sender is null, returning unknown recipient");
recipients = RecipientFactory.getRecipientsFor(context, Recipient.getUnknownRecipient(context), false);
recipients = RecipientFactory.getRecipientsFor(context, Recipient.getUnknownRecipient(), false);
}
Recipients groupRecipients;
@@ -615,13 +615,13 @@ public class SmsDatabase extends MessagingDatabase {
Recipients recipients = RecipientFactory.getRecipientsFromString(context, address, false);
if (recipients == null || recipients.isEmpty()) {
return RecipientFactory.getRecipientsFor(context, Recipient.getUnknownRecipient(context), false);
return RecipientFactory.getRecipientsFor(context, Recipient.getUnknownRecipient(), false);
}
return recipients;
} else {
Log.w(TAG, "getRecipientsFor() address is null");
return RecipientFactory.getRecipientsFor(context, Recipient.getUnknownRecipient(context), false);
return RecipientFactory.getRecipientsFor(context, Recipient.getUnknownRecipient(), false);
}
}