CMF Buds: Fix reading ANC status on newer buds

Newer buds send 6 bytes for ANC status instead of 3. Since the relevant
information is in the first 3 bytes and identical allow extra trailing
bytes when parsing.

Confirmed on the Buds 2 Plus. Likely also applies to Ear(a) (see #3994),
possibly other models as well.
This commit is contained in:
Dominik Riebeling
2026-05-02 19:50:44 +02:00
committed by José Rebelo
parent aaf5b3011f
commit 0cb14eb30d
@@ -300,7 +300,7 @@ public class Ear1Support extends AbstractHeadphoneBTBRDeviceSupport {
private GBDeviceEventUpdatePreferences handleAudioModeStatus(byte[] payload) { private GBDeviceEventUpdatePreferences handleAudioModeStatus(byte[] payload) {
final GBDeviceEventUpdatePreferences preferencesEvent = new GBDeviceEventUpdatePreferences(); final GBDeviceEventUpdatePreferences preferencesEvent = new GBDeviceEventUpdatePreferences();
if (payload.length == 3 && payload[0] == 0x01 && payload[2] == 0x00) { if (payload.length >= 3 && payload[0] == 0x01 && payload[2] == 0x00) {
try { try {
NothingAudioMode mode = NothingAudioMode.fromBitmask(payload[1]); NothingAudioMode mode = NothingAudioMode.fromBitmask(payload[1]);
LOG.info("Audio mode: " + mode.name()); LOG.info("Audio mode: " + mode.name());