mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-20 16:49:40 +01:00
Improve notification channel consistency checks with Android Conversations.
This commit is contained in:
@@ -8,6 +8,7 @@ import android.content.pm.ShortcutManager;
|
||||
import android.os.Build;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.annotation.WorkerThread;
|
||||
|
||||
@@ -19,7 +20,6 @@ import org.thoughtcrime.securesms.R;
|
||||
import org.thoughtcrime.securesms.conversation.ConversationIntents;
|
||||
import org.thoughtcrime.securesms.database.DatabaseFactory;
|
||||
import org.thoughtcrime.securesms.database.GroupDatabase;
|
||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
||||
import org.thoughtcrime.securesms.groups.GroupId;
|
||||
import org.thoughtcrime.securesms.jobs.ConversationShortcutUpdateJob;
|
||||
import org.thoughtcrime.securesms.notifications.NotificationChannels;
|
||||
@@ -132,6 +132,22 @@ public final class ConversationUtil {
|
||||
return getShortcutId(recipient.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract the recipient id from the provided shortcutId.
|
||||
*/
|
||||
public static @Nullable RecipientId getRecipientId(@Nullable String shortcutId) {
|
||||
if (shortcutId == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
return RecipientId.from(shortcutId);
|
||||
} catch (Throwable t) {
|
||||
Log.d(TAG, "Unable to parse recipientId from shortcutId", t);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresApi(CONVERSATION_SUPPORT_VERSION)
|
||||
public static int getMaxShortcuts(@NonNull Context context) {
|
||||
ShortcutManager shortcutManager = ServiceUtil.getShortcutManager(context);
|
||||
|
||||
Reference in New Issue
Block a user