Loading quickstep/src/com/android/quickstep/util/DeviceConfigHelper.kt +3 −1 Original line number Original line Diff line number Diff line Loading @@ -26,19 +26,21 @@ import android.provider.DeviceConfig.Properties import androidx.annotation.WorkerThread import androidx.annotation.WorkerThread import com.android.launcher3.BuildConfig import com.android.launcher3.BuildConfig import com.android.launcher3.util.Executors import com.android.launcher3.util.Executors import java.util.concurrent.CopyOnWriteArrayList /** Utility class to manage a set of device configurations */ /** Utility class to manage a set of device configurations */ class DeviceConfigHelper<ConfigType>(private val factory: (PropReader) -> ConfigType) { class DeviceConfigHelper<ConfigType>(private val factory: (PropReader) -> ConfigType) { var config: ConfigType var config: ConfigType private set private set private val allKeys: Set<String> private val allKeys: Set<String> private val propertiesListener = OnPropertiesChangedListener { onDevicePropsChanges(it) } private val propertiesListener = OnPropertiesChangedListener { onDevicePropsChanges(it) } private val sharedPrefChangeListener = OnSharedPreferenceChangeListener { _, _ -> private val sharedPrefChangeListener = OnSharedPreferenceChangeListener { _, _ -> recreateConfig() recreateConfig() } } private val changeListeners = mutableListOf<Runnable>() private val changeListeners = CopyOnWriteArrayList<Runnable>() init { init { // Initialize the default config once. // Initialize the default config once. Loading Loading
quickstep/src/com/android/quickstep/util/DeviceConfigHelper.kt +3 −1 Original line number Original line Diff line number Diff line Loading @@ -26,19 +26,21 @@ import android.provider.DeviceConfig.Properties import androidx.annotation.WorkerThread import androidx.annotation.WorkerThread import com.android.launcher3.BuildConfig import com.android.launcher3.BuildConfig import com.android.launcher3.util.Executors import com.android.launcher3.util.Executors import java.util.concurrent.CopyOnWriteArrayList /** Utility class to manage a set of device configurations */ /** Utility class to manage a set of device configurations */ class DeviceConfigHelper<ConfigType>(private val factory: (PropReader) -> ConfigType) { class DeviceConfigHelper<ConfigType>(private val factory: (PropReader) -> ConfigType) { var config: ConfigType var config: ConfigType private set private set private val allKeys: Set<String> private val allKeys: Set<String> private val propertiesListener = OnPropertiesChangedListener { onDevicePropsChanges(it) } private val propertiesListener = OnPropertiesChangedListener { onDevicePropsChanges(it) } private val sharedPrefChangeListener = OnSharedPreferenceChangeListener { _, _ -> private val sharedPrefChangeListener = OnSharedPreferenceChangeListener { _, _ -> recreateConfig() recreateConfig() } } private val changeListeners = mutableListOf<Runnable>() private val changeListeners = CopyOnWriteArrayList<Runnable>() init { init { // Initialize the default config once. // Initialize the default config once. Loading