Re-enable bubble menu shortcut on CFv2.

This commit is contained in:
Nicholas
2023-07-26 13:21:00 -04:00
committed by GitHub
parent fe5d5df2d7
commit 72d1e55373
3 changed files with 17 additions and 4 deletions

View File

@@ -47,6 +47,12 @@ public final class BubbleUtil {
@RequiresApi(CONVERSATION_SUPPORT_VERSION)
@WorkerThread
public static boolean canBubble(@NonNull Context context, @NonNull RecipientId recipientId, @Nullable Long threadId) {
Recipient recipient = Recipient.resolved(recipientId);
return canBubble(context, recipient, threadId);
}
@RequiresApi(CONVERSATION_SUPPORT_VERSION)
public static boolean canBubble(@NonNull Context context, @NonNull Recipient recipient, @Nullable Long threadId) {
if (threadId == null) {
Log.d(TAG, "Cannot bubble recipient without thread");
return false;
@@ -58,7 +64,6 @@ public final class BubbleUtil {
return false;
}
Recipient recipient = Recipient.resolved(recipientId);
if (recipient.isBlocked()) {
Log.d(TAG, "Cannot bubble blocked recipient");
return false;
@@ -66,7 +71,7 @@ public final class BubbleUtil {
NotificationManager notificationManager = ServiceUtil.getNotificationManager(context);
NotificationChannel conversationChannel = notificationManager.getNotificationChannel(ConversationUtil.getChannelId(context, recipient),
ConversationUtil.getShortcutId(recipientId));
ConversationUtil.getShortcutId(recipient.getId()));
final StringBuilder bubbleLoggingMessage = new StringBuilder("Bubble State:");
if (Build.VERSION.SDK_INT < 31) {