summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLyubo <lyubodzhamov@gmail.com>2019-06-08 18:01:26 -0400
committerMichael Bestas <mkbestas@lineageos.org>2020-02-27 17:14:01 +0200
commite4c1caec3bfd891071fd128966825b71aced036a (patch)
tree361144e00763fd22e665fabd6a4598891e84be36
parentcfe7ce38240712ab07c77b1f8ba930e84404d493 (diff)
downloadpackages_apps_Messaging-e4c1caec3bfd891071fd128966825b71aced036a.tar.gz
packages_apps_Messaging-e4c1caec3bfd891071fd128966825b71aced036a.tar.bz2
packages_apps_Messaging-e4c1caec3bfd891071fd128966825b71aced036a.zip
Messaging: Handle multiple participants in custom notifications
* Fixes: https://gitlab.com/LineageOS/issues/android/issues/695 * Sets the conversation title in 'conversation notifications settings' as a string of comma separated participants names Change-Id: If900fc4c84de0ac036ecf6b0c346bd9eaccb0916
-rw-r--r--src/com/android/messaging/ui/conversationsettings/PeopleAndOptionsFragment.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/com/android/messaging/ui/conversationsettings/PeopleAndOptionsFragment.java b/src/com/android/messaging/ui/conversationsettings/PeopleAndOptionsFragment.java
index 00b31ef..00af751 100644
--- a/src/com/android/messaging/ui/conversationsettings/PeopleAndOptionsFragment.java
+++ b/src/com/android/messaging/ui/conversationsettings/PeopleAndOptionsFragment.java
@@ -63,6 +63,7 @@ public class PeopleAndOptionsFragment extends Fragment
private ListView mListView;
private OptionsListAdapter mOptionsListAdapter;
private PeopleListAdapter mPeopleListAdapter;
+ private List<ParticipantData> mOtherParticipants;
private final Binding<PeopleAndOptionsData> mBinding =
BindingBase.createBinding(this);
@@ -113,6 +114,7 @@ public class PeopleAndOptionsFragment extends Fragment
final List<ParticipantData> participants) {
mBinding.ensureBound(data);
mPeopleListAdapter.updateParticipants(participants);
+ mOtherParticipants = participants;
final ParticipantData otherParticipant = participants.size() == 1 ?
participants.get(0) : null;
mOptionsListAdapter.setOtherParticipant(otherParticipant);
@@ -122,12 +124,16 @@ public class PeopleAndOptionsFragment extends Fragment
public void onOptionsItemViewClicked(final PeopleOptionsItemData item) {
switch (item.getItemId()) {
case PeopleOptionsItemData.SETTING_NOTIFICATION:
+ ArrayList<String> participantsNames = new ArrayList<String>();
+ for (ParticipantData participant : mOtherParticipants) {
+ participantsNames.add(participant.getDisplayName(true));
+ }
NotificationsUtil.createNotificationChannelGroup(getActivity(),
NotificationsUtil.CONVERSATION_GROUP_NAME,
R.string.notification_channel_messages_title);
NotificationsUtil.createNotificationChannel(getActivity(),
mBinding.getData().getConversationId(),
- item.getOtherParticipant().getDisplayName(true),
+ String.join(", ", participantsNames),
NotificationManager.IMPORTANCE_DEFAULT,
NotificationsUtil.CONVERSATION_GROUP_NAME);
Intent intent = new Intent(Settings.ACTION_APP_NOTIFICATION_SETTINGS);