Merge "Prevent ConcurrentModificationException while accessing mTunableLookup." into rvc-dev am: 86a72111c8

Change-Id: Ic73eabd20fd9f099a3ca81b456a5fce99928f40b
This commit is contained in:
Automerger Merge Worker
2020-03-11 20:21:25 +00:00

View File

@@ -41,9 +41,9 @@ import com.android.systemui.settings.CurrentUserTracker;
import com.android.systemui.statusbar.phone.StatusBarIconController; import com.android.systemui.statusbar.phone.StatusBarIconController;
import com.android.systemui.util.leak.LeakDetector; import com.android.systemui.util.leak.LeakDetector;
import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import javax.inject.Inject; import javax.inject.Inject;
import javax.inject.Singleton; import javax.inject.Singleton;
@@ -69,7 +69,8 @@ public class TunerServiceImpl extends TunerService {
// Map of Uris we listen on to their settings keys. // Map of Uris we listen on to their settings keys.
private final ArrayMap<Uri, String> mListeningUris = new ArrayMap<>(); private final ArrayMap<Uri, String> mListeningUris = new ArrayMap<>();
// Map of settings keys to the listener. // Map of settings keys to the listener.
private final HashMap<String, Set<Tunable>> mTunableLookup = new HashMap<>(); private final ConcurrentHashMap<String, Set<Tunable>> mTunableLookup =
new ConcurrentHashMap<>();
// Set of all tunables, used for leak detection. // Set of all tunables, used for leak detection.
private final HashSet<Tunable> mTunables = LeakDetector.ENABLED ? new HashSet<>() : null; private final HashSet<Tunable> mTunables = LeakDetector.ENABLED ? new HashSet<>() : null;
private final Context mContext; private final Context mContext;