mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 17:29:32 +01:00
Don't keep around shortcuts for archived chats.
This commit is contained in:
committed by
Cody Henthorne
parent
a44a105cbc
commit
a87aa0fbe2
@@ -30,6 +30,7 @@ import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* ConversationUtil encapsulates support for Android 11+'s new Conversations system
|
||||
@@ -140,6 +141,14 @@ public final class ConversationUtil {
|
||||
return Math.min(ShortcutManagerCompat.getMaxShortcutCountPerActivity(context), 150);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the long-lived shortcuts for the given set of recipients.
|
||||
*/
|
||||
@WorkerThread
|
||||
public static void removeLongLivedShortcuts(@NonNull Context context, @NonNull Collection<RecipientId> recipients) {
|
||||
ShortcutManagerCompat.removeLongLivedShortcuts(context, recipients.stream().map(ConversationUtil::getShortcutId).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the shortcuts to match the provided recipient list. This call may fail due to getting
|
||||
* rate-limited.
|
||||
|
||||
Reference in New Issue
Block a user