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

Commit 7a3baf7d authored by Haijie Hong's avatar Haijie Hong
Browse files

Fix multi-toggle flicker bug

BUG: 343317785
Test: local tested
Flag: com.android.settings.flags.enable_bluetooth_device_details_polish
Change-Id: Ib5e700412c112ff6fa19b54f341fbd598c6b345c
parent c9b45073
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -58,6 +58,8 @@ class BluetoothDeviceDetailsViewModel(
            deviceSettingRepository.getDeviceSettingsConfig(cachedDevice)
        }

    private val spatialAudioModel by lazy { spatialAudioInteractor.getDeviceSetting(cachedDevice) }

    suspend fun getItems(fragment: FragmentTypeModel): List<DeviceSettingConfigItemModel>? =
        when (fragment) {
            is FragmentTypeModel.DeviceDetailsMainFragment -> items.await()?.mainItems
@@ -81,7 +83,7 @@ class BluetoothDeviceDetailsViewModel(
        }
        return when (settingId) {
            DeviceSettingId.DEVICE_SETTING_ID_SPATIAL_AUDIO_MULTI_TOGGLE ->
                spatialAudioInteractor.getDeviceSetting(cachedDevice)
                spatialAudioModel
            else -> deviceSettingRepository.getDeviceSetting(cachedDevice, settingId)
        }.map { it?.toPreferenceModel() }
    }