diff options
author | Tony Mak <tonymak@google.com> | 2016-06-28 15:44:27 +0100 |
---|---|---|
committer | Tony Mak <tonymak@google.com> | 2016-06-28 15:44:27 +0100 |
commit | 2a50ffe57c45c99bbc8ab92fd07383582be9f836 (patch) | |
tree | bf493b7d999a69eaa34798d4982e585a77100b68 /src/com/android/messaging/datamodel/data/ConversationListItemData.java | |
parent | d112c795ac1ce07d799f470cb8e7ec50efd3f340 (diff) | |
download | android_packages_apps_Messaging-2a50ffe57c45c99bbc8ab92fd07383582be9f836.tar.gz android_packages_apps_Messaging-2a50ffe57c45c99bbc8ab92fd07383582be9f836.tar.bz2 android_packages_apps_Messaging-2a50ffe57c45c99bbc8ab92fd07383582be9f836.zip |
Add badge in conversation view if the participant is a work contact
TODO: To handle conversation having more than one participants.
Bug: 29065176
Change-Id: I3820454bf2b76c151dc3a13d9be270502029160d
Diffstat (limited to 'src/com/android/messaging/datamodel/data/ConversationListItemData.java')
-rw-r--r-- | src/com/android/messaging/datamodel/data/ConversationListItemData.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/com/android/messaging/datamodel/data/ConversationListItemData.java b/src/com/android/messaging/datamodel/data/ConversationListItemData.java index b2e6e1c..77da49e 100644 --- a/src/com/android/messaging/datamodel/data/ConversationListItemData.java +++ b/src/com/android/messaging/datamodel/data/ConversationListItemData.java @@ -28,6 +28,7 @@ import com.android.messaging.datamodel.DatabaseHelper.ParticipantColumns; import com.android.messaging.datamodel.DatabaseWrapper; import com.android.messaging.datamodel.action.DeleteConversationAction; import com.android.messaging.util.Assert; +import com.android.messaging.util.ContactUtil; import com.android.messaging.util.Dates; import com.google.common.base.Joiner; @@ -155,10 +156,23 @@ public class ConversationListItemData { return mPreviewContentType; } + /** + * @see DatabaseHelper.ConversationColumns#PARTICIPANT_CONTACT_ID + * @return the contact id of the participant if it is a 1:1 conversation, -1 for group. + */ public long getParticipantContactId() { return mParticipantContactId; } + /** + * TODO: support group conversation. + * @see android.provider.ContactsContract#isEnterpriseContactId(long) + * @return is the participant an enterprise contact. False if it is a group conversation. + */ + public boolean isParticipantEnterpriseContact() { + return ContactUtil.isEnterpriseContactId(getParticipantContactId()); + } + public String getParticipantLookupKey() { return mParticipantLookupKey; } |