Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ee4877f6 authored by Sihua Ma's avatar Sihua Ma
Browse files

Fix ConcurrentModificationException in OmniInvokerTest

Test: atest NexusLauncherRoboTests
Flag: TEST_ONLY
Change-Id: I31402443426e055fe470e11d98b52d07d64e9ca2
parent bad6ce48
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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.