mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 01:40:07 +01:00
Implement ShortcutInfo for API 30.
This commit is contained in:
@@ -53,6 +53,7 @@ import org.thoughtcrime.securesms.recipients.RecipientId;
|
||||
import org.thoughtcrime.securesms.recipients.RecipientUtil;
|
||||
import org.thoughtcrime.securesms.storage.StorageSyncHelper;
|
||||
import org.thoughtcrime.securesms.tracing.Trace;
|
||||
import org.thoughtcrime.securesms.util.ConversationUtil;
|
||||
import org.thoughtcrime.securesms.util.CursorUtil;
|
||||
import org.thoughtcrime.securesms.util.JsonUtils;
|
||||
import org.thoughtcrime.securesms.util.SqlUtil;
|
||||
@@ -245,6 +246,7 @@ public class ThreadDatabase extends Database {
|
||||
SQLiteDatabase db = databaseHelper.getWritableDatabase();
|
||||
db.delete(TABLE_NAME, ID_WHERE, new String[] {threadId + ""});
|
||||
notifyConversationListListeners();
|
||||
ConversationUtil.clearShortcuts(context, Collections.singleton(threadId));
|
||||
}
|
||||
|
||||
private void deleteThreads(Set<Long> threadIds) {
|
||||
@@ -259,12 +261,14 @@ public class ThreadDatabase extends Database {
|
||||
|
||||
db.delete(TABLE_NAME, where, null);
|
||||
notifyConversationListListeners();
|
||||
ConversationUtil.clearShortcuts(context, threadIds);
|
||||
}
|
||||
|
||||
private void deleteAllThreads() {
|
||||
SQLiteDatabase db = databaseHelper.getWritableDatabase();
|
||||
db.delete(TABLE_NAME, null, null);
|
||||
notifyConversationListListeners();
|
||||
ConversationUtil.clearAllShortcuts(context);
|
||||
}
|
||||
|
||||
public void trimAllThreads(int length, long trimBeforeDate) {
|
||||
@@ -1194,6 +1198,10 @@ public class ThreadDatabase extends Database {
|
||||
}
|
||||
}
|
||||
|
||||
public @NonNull ThreadRecord getThreadRecordFor(@NonNull Recipient recipient) {
|
||||
return Objects.requireNonNull(getThreadRecord(getThreadIdFor(recipient)));
|
||||
}
|
||||
|
||||
@NonNull MergeResult merge(@NonNull RecipientId primaryRecipientId, @NonNull RecipientId secondaryRecipientId) {
|
||||
if (!databaseHelper.getWritableDatabase().inTransaction()) {
|
||||
throw new IllegalStateException("Must be in a transaction!");
|
||||
|
||||
Reference in New Issue
Block a user