summaryrefslogtreecommitdiff
path: root/src/com/android/car
diff options
context:
space:
mode:
authorRitwika Mitra <ritwikam@google.com>2020-06-17 20:30:16 -0700
committerRitwika Mitra <ritwikam@google.com>2020-07-10 17:35:35 +0000
commit27160a44416df0439aa0a0db0ce89bdacf8ba67a (patch)
tree1c3c961f90c7e6cba560e45738787824ca58c588 /src/com/android/car
parent2af5a024971b0cc5d7017d71edf53ff55e186665 (diff)
downloadMessenger-27160a44416df0439aa0a0db0ce89bdacf8ba67a.tar.gz
Construct RTL-friendly group conversation title.
Bug: 159221409 Test: manual, unit tested API Change-Id: I0b170d4ca5aa9f25c46c77493ade4098ed394e21
Diffstat (limited to 'src/com/android/car')
-rw-r--r--src/com/android/car/messenger/MessageNotificationDelegate.java19
1 files changed, 2 insertions, 17 deletions
diff --git a/src/com/android/car/messenger/MessageNotificationDelegate.java b/src/com/android/car/messenger/MessageNotificationDelegate.java
index 2b7126b..807b6d7 100644
--- a/src/com/android/car/messenger/MessageNotificationDelegate.java
+++ b/src/com/android/car/messenger/MessageNotificationDelegate.java
@@ -56,7 +56,6 @@ import com.bumptech.glide.request.target.SimpleTarget;
import com.bumptech.glide.request.transition.Transition;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
@@ -64,7 +63,6 @@ import java.util.Map;
import java.util.Set;
import java.util.concurrent.CompletableFuture;
import java.util.function.Consumer;
-import java.util.stream.Collectors;
/** Delegate class responsible for handling messaging service actions */
public class MessageNotificationDelegate extends BaseNotificationDelegate implements
@@ -410,24 +408,11 @@ public class MessageNotificationDelegate extends BaseNotificationDelegate implem
}
}
- notificationInfo.setConvoTitle(constructGroupConversationTitle(names));
+ notificationInfo.setConvoTitle(Utils.constructGroupConversationTitle(names,
+ mContext.getString(R.string.name_separator), mNotificationConversationTitleLength));
if (allNamesLoaded) mGeneratedGroupConversationTitles.add(conversationKey);
}
- /**
- * Given a name of all the participants in a group conversation (some names might be phone
- * numbers), this function creates the conversation title putting the names in alphabetical
- * order first, then adding any phone numbers. This title should not exceed the
- * mNotificationConversationTitleLength, so not all participants' names are guaranteed to be
- * in the conversation title.
- */
- private String constructGroupConversationTitle(List<String> names) {
- Collections.sort(names, Utils.ALPHA_THEN_NUMERIC_COMPARATOR);
-
- return names.stream().map(String::valueOf).collect(
- Collectors.joining(mContext.getString(R.string.name_separator)));
- }
-
private void loadPhoneNumberInfo(@Nullable String phoneNumber,
Consumer<? super TelecomUtils.PhoneNumberInfo> action) {
if (phoneNumber == null) {