2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-30 05:37:43 +00:00

Fix ConcurrentModificationException

When onPacketReceived was called at the same time as getSinks, because
getSinks uses .values() and onPacketReceived does .put()
This commit is contained in:
Albert Vaca 2019-03-20 22:12:53 +01:00
parent b689548aa9
commit 360e4bc1cb

View File

@ -30,7 +30,7 @@ import org.kde.kdeconnect_tp.R;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.concurrent.ConcurrentHashMap;
@PluginFactory.LoadablePlugin
public class SystemvolumePlugin extends Plugin {
@ -42,11 +42,11 @@ public class SystemvolumePlugin extends Plugin {
void sinksChanged();
}
private final HashMap<String, Sink> sinks;
private final ConcurrentHashMap<String, Sink> sinks;
private final ArrayList<SinkListener> listeners;
public SystemvolumePlugin() {
sinks = new HashMap<>();
sinks = new ConcurrentHashMap<>();
listeners = new ArrayList<>();
}