CMF Buds: Fix ANC modes list update

- Fix the wrong flag being checked for some modes
- Remove unnecessary outer check that prevented the list update in some
  cases
This commit is contained in:
Dominik Riebeling
2026-05-02 19:50:44 +02:00
committed by José Rebelo
parent aae925febb
commit 24d1a40e39
@@ -59,10 +59,8 @@ public class EarSettingsCustomizer implements DeviceSpecificSettingsCustomizer {
}
}
if (!earCoordinator.supportsLightAnc() || !earCoordinator.supportsTransparency()) {
// If light anc and transparency is not supported, remove the values from the preference
// Remove unsupported anc modes from the preference
final Preference audioModePref = handler.findPreference(DeviceSettingsPreferenceConst.PREF_NOTHING_EAR1_AUDIOMODE);
if (audioModePref != null) {
final CharSequence[] originalEntries = ((ListPreference) audioModePref).getEntries();
final CharSequence[] originalEntryValues = ((ListPreference) audioModePref).getEntryValues();
@@ -74,10 +72,10 @@ public class EarSettingsCustomizer implements DeviceSpecificSettingsCustomizer {
if ("anclight".equals(originalEntryValues[i].toString()) && !earCoordinator.supportsLightAnc()) {
continue;
}
if ("ancmedium".equals(originalEntryValues[i].toString()) && !earCoordinator.supportsTransparency()) {
if ("ancmedium".equals(originalEntryValues[i].toString()) && !earCoordinator.supportsMediumAnc()) {
continue;
}
if ("ancadaptive".equals(originalEntryValues[i].toString()) && !earCoordinator.supportsTransparency()) {
if ("ancadaptive".equals(originalEntryValues[i].toString()) && !earCoordinator.supportsAdaptiveAnc()) {
continue;
}
if ("transparency".equals(originalEntryValues[i].toString()) && !earCoordinator.supportsTransparency()) {
@@ -91,7 +89,6 @@ public class EarSettingsCustomizer implements DeviceSpecificSettingsCustomizer {
((ListPreference) audioModePref).setEntryValues(entryValues.toArray(new CharSequence[0]));
}
}
}
@Override
public Set<String> getPreferenceKeysWithSummary() {