diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/DownloadController.java b/TMessagesProj/src/main/java/org/telegram/messenger/DownloadController.java index 4bc86d44a9..5be8160ed9 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/DownloadController.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/DownloadController.java @@ -32,6 +32,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.Locale; +import java.util.concurrent.ConcurrentHashMap; import cn.hutool.core.util.StrUtil; import tw.nekomimi.nekogram.NekoConfig; @@ -72,7 +73,7 @@ public interface FileDownloadProgressListener { private HashMap>> loadingFileObservers = new HashMap<>(); private HashMap> loadingFileMessagesObservers = new HashMap<>(); - private SparseArray observersByTag = new SparseArray<>(); + private ConcurrentHashMap observersByTag = new ConcurrentHashMap<>(); private boolean listenerInProgress = false; private HashMap addLaterArray = new HashMap<>(); private ArrayList deleteLaterArray = new ArrayList<>(); @@ -80,11 +81,11 @@ public interface FileDownloadProgressListener { private boolean loadingAutoDownloadConfig; - private LongSparseArray typingTimes = new LongSparseArray<>(); + private ConcurrentHashMap typingTimes = new ConcurrentHashMap<>(); public final ArrayList downloadingFiles = new ArrayList<>(); public final ArrayList recentDownloadingFiles = new ArrayList<>(); - public final SparseArray unviewedDownloads = new SparseArray<>(); + public final ConcurrentHashMap unviewedDownloads = new ConcurrentHashMap<>(); public static class Preset { public int[] mask = new int[4];