mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-20 00:29:11 +01:00
Improve reconciliation logging and handling.
This commit is contained in:
@@ -57,17 +57,23 @@ public final class WallpaperStorage {
|
||||
*/
|
||||
@WorkerThread
|
||||
public static void onWallpaperDeselected(@NonNull Uri uri) {
|
||||
if (!isWallpaperUriUsed(uri)) {
|
||||
AttachmentId attachmentId = new PartUriParser(uri).getPartId();
|
||||
SignalDatabase.attachments().deleteAttachment(attachmentId);
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isWallpaperUriUsed(@NonNull Uri uri) {
|
||||
Uri globalUri = SignalStore.wallpaper().getWallpaperUri();
|
||||
if (Objects.equals(uri, globalUri)) {
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
int recipientCount = SignalDatabase.recipients().getWallpaperUriUsageCount(uri);
|
||||
if (recipientCount > 0) {
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
AttachmentId attachmentId = new PartUriParser(uri).getPartId();
|
||||
SignalDatabase.attachments().deleteAttachment(attachmentId);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user