Fix ConcurrentModificationException in OmniInvokerTest
Test: atest NexusLauncherRoboTests Flag: TEST_ONLY Change-Id: I31402443426e055fe470e11d98b52d07d64e9ca2
This commit is contained in:
@@ -26,19 +26,21 @@ import android.provider.DeviceConfig.Properties
|
||||
import androidx.annotation.WorkerThread
|
||||
import com.android.launcher3.BuildConfig
|
||||
import com.android.launcher3.util.Executors
|
||||
import java.util.concurrent.CopyOnWriteArrayList
|
||||
|
||||
/** Utility class to manage a set of device configurations */
|
||||
class DeviceConfigHelper<ConfigType>(private val factory: (PropReader) -> ConfigType) {
|
||||
|
||||
var config: ConfigType
|
||||
private set
|
||||
|
||||
private val allKeys: Set<String>
|
||||
private val propertiesListener = OnPropertiesChangedListener { onDevicePropsChanges(it) }
|
||||
private val sharedPrefChangeListener = OnSharedPreferenceChangeListener { _, _ ->
|
||||
recreateConfig()
|
||||
}
|
||||
|
||||
private val changeListeners = mutableListOf<Runnable>()
|
||||
private val changeListeners = CopyOnWriteArrayList<Runnable>()
|
||||
|
||||
init {
|
||||
// Initialize the default config once.
|
||||
|
||||
Reference in New Issue
Block a user