/** * Check whether one of the provided addresses belongs to one of the contacts. * * @param addresses The addresses to search in contacts * @return <tt>true</tt>, if one address belongs to a contact. * <tt>false</tt>, otherwise. */ public boolean isAnyInContacts(final Address[] addresses) { if (addresses == null) { return false; } for (Address addr : addresses) { if (isInContacts(addr.getAddress())) { return true; } } return false; }
private boolean shouldShowPicturesFromSender(ShowPictures showPicturesSetting, Message message) { if (showPicturesSetting != ShowPictures.ONLY_FROM_CONTACTS) { return false; } String senderEmailAddress = getSenderEmailAddress(message); if (senderEmailAddress == null) { return false; } Contacts contacts = Contacts.getInstance(getContext()); return contacts.isInContacts(senderEmailAddress); }