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

Commit 15083cfe authored by Haijie Hong's avatar Haijie Hong
Browse files

Uncheck ANC toggle when it's disabled

Bug: 416612263
Test: local build
Flag: com.android.settings.flags.enable_bluetooth_settings_expressive_design
Change-Id: Ie49d7f6dff9f473fad16de004e8beafed060c0fa
parent 63d2dc83
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -402,7 +402,9 @@ abstract class BluetoothDetailsConfigurableFragment :
                        getDrawable(model.toggles[idx].icon)?.let {
                            pref.setUpButton(idx, model.toggles[idx].label, it)
                        }
                        pref.setCheckedIndex(model.selectedIndex)
                        pref.setCheckedIndex(
                            if (model.isAllowedChangingState) model.selectedIndex else -1
                        )
                        pref.setOnButtonClickListener { _, checkedId, isChecked ->
                            val checkedIndex =
                                when (checkedId) {
@@ -497,6 +499,7 @@ abstract class BluetoothDetailsConfigurableFragment :
        when (deviceSettingIcon) {
            is DeviceSettingIcon.BitmapIcon ->
                deviceSettingIcon.bitmap.toDrawable(requireContext().resources)

            is DeviceSettingIcon.ResourceIcon -> context?.getDrawable(deviceSettingIcon.resId)
            null -> null
        }?.apply {