mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-30 13:47:41 +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:
@@ -30,7 +30,7 @@ import org.kde.kdeconnect_tp.R;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
@PluginFactory.LoadablePlugin
|
@PluginFactory.LoadablePlugin
|
||||||
public class SystemvolumePlugin extends Plugin {
|
public class SystemvolumePlugin extends Plugin {
|
||||||
@@ -42,11 +42,11 @@ public class SystemvolumePlugin extends Plugin {
|
|||||||
void sinksChanged();
|
void sinksChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
private final HashMap<String, Sink> sinks;
|
private final ConcurrentHashMap<String, Sink> sinks;
|
||||||
private final ArrayList<SinkListener> listeners;
|
private final ArrayList<SinkListener> listeners;
|
||||||
|
|
||||||
public SystemvolumePlugin() {
|
public SystemvolumePlugin() {
|
||||||
sinks = new HashMap<>();
|
sinks = new ConcurrentHashMap<>();
|
||||||
listeners = new ArrayList<>();
|
listeners = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user